public CFDbTestSwingUInt64ColViewEditJInternalFrame(
     ICFDbTestSwingSchema argSchema, ICFDbTestUInt64ColObj argFocus) {
   super();
   final String S_ProcName = "construct-schema-focus";
   if (argSchema == null) {
     throw CFLib.getDefaultExceptionFactory()
         .newNullArgumentException(getClass(), S_ProcName, 1, "argSchema");
   }
   setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
   // argFocus is optional; focus may be set later during execution as
   // conditions of the runtime change.
   swingSchema = argSchema;
   swingFocus = argFocus;
   if ((argFocus != null) && (!argFocus.getIsNew())) {
     argFocus = (ICFDbTestUInt64ColObj) argFocus.read(true);
     swingFocus = argFocus;
   }
   swingViewEditJPanel = argSchema.getUInt64ColFactory().newViewEditJPanel(argFocus);
   setContentPane(swingViewEditJPanel);
   Dimension dim = new Dimension(1024, 480);
   setSize(dim);
   dim = new Dimension(320, 240);
   setMinimumSize(dim);
   setTitle("View/Edit UInt64Col");
   setJMenuBar(getFrameMenuBar());
   setIconifiable(true);
   setMaximizable(true);
   setResizable(true);
   setClosable(false);
 }
 public void setSwingFocus(ICFLibAnyObj value) {
   final String S_ProcName = "setSwingFocus";
   if ((value == null) || (value instanceof ICFDbTestUInt64ColObj)) {
     super.setSwingFocus(value);
   } else {
     throw CFLib.getDefaultExceptionFactory()
         .newUnsupportedClassException(
             getClass(), S_ProcName, "value", value, "ICFDbTestUInt64ColObj");
   }
   ((ICFDbTestSwingUInt64ColJPanelCommon) swingViewEditJPanel).setSwingFocus(value);
   ICFDbTestUInt64ColObj argFocus = (ICFDbTestUInt64ColObj) value;
   if ((argFocus != null) && (!argFocus.getIsNew())) {
     argFocus = (ICFDbTestUInt64ColObj) argFocus.read(true);
     super.setSwingFocus(argFocus);
   }
 }
 public void actionPerformed(ActionEvent e) {
   final String S_ProcName = "actionPerformed";
   ICFDbTestUInt64ColObj focus = getSwingFocusAsUInt64Col();
   if (focus != null) {
     ICFDbTestUInt64ColEditObj editObj = (ICFDbTestUInt64ColEditObj) (focus.getEdit());
     if (editObj != null) {
       setPanelMode(CFJPanel.PanelMode.Update);
     } else {
       throw CFLib.getDefaultExceptionFactory()
           .newUsageException(
               getClass(), S_ProcName, "Cannot save on object that isn't being edited");
     }
   }
   try {
     setClosed(true);
   } catch (Exception x) {
   }
 }
 public void actionPerformed(ActionEvent e) {
   ICFDbTestUInt64ColObj focus = getSwingFocusAsUInt64Col();
   if (focus != null) {
     ICFDbTestUInt64ColEditObj editObj = (ICFDbTestUInt64ColEditObj) focus.getEdit();
     if (editObj != null) {
       if (editObj.getIsNew()) {
         editObj.endEdit();
         setSwingFocus(null);
         setPanelMode(CFJPanel.PanelMode.Unknown);
       } else {
         editObj.endEdit();
         setPanelMode(CFJPanel.PanelMode.View);
       }
     }
   }
   try {
     setClosed(true);
   } catch (Exception x) {
   }
 }
  public void startElement(String uri, String localName, String qName, Attributes attrs)
      throws SAXException {
    CFDbTestXMsgSchemaMessageFormatter schemaFormatter = null;
    try {
      // Common XML Attributes
      String attrId = null;
      String attrTenantId = null;
      String attrScopeId = null;
      // Attribute Extraction
      String attrLocalName;
      int numAttrs;
      int idxAttr;
      final String S_ProcName = "startElement";
      final String S_LocalName = "LocalName";

      assert qName.equals("RqstUInt64ColReadByScopeIdx");

      CFDbTestXMsgRqstHandler xmsgRqstHandler = (CFDbTestXMsgRqstHandler) getParser();
      if (xmsgRqstHandler == null) {
        throw CFLib.getDefaultExceptionFactory()
            .newNullArgumentException(getClass(), S_ProcName, 0, "getParser()");
      }

      schemaFormatter = xmsgRqstHandler.getSchemaMessageFormatter();

      ICFDbTestSchemaObj schemaObj = xmsgRqstHandler.getSchemaObj();
      if (schemaObj == null) {
        throw CFLib.getDefaultExceptionFactory()
            .newNullArgumentException(getClass(), S_ProcName, 0, "getParser().getSchemaObj()");
      }

      // Extract Attributes
      numAttrs = attrs.getLength();
      for (idxAttr = 0; idxAttr < numAttrs; idxAttr++) {
        attrLocalName = attrs.getLocalName(idxAttr);
        if (attrLocalName.equals("Id")) {
          if (attrId != null) {
            throw CFLib.getDefaultExceptionFactory()
                .newUniqueIndexViolationException(
                    getClass(), S_ProcName, S_LocalName, attrLocalName);
          }
          attrId = attrs.getValue(idxAttr);
        } else if (attrLocalName.equals("TenantId")) {
          if (attrTenantId != null) {
            throw CFLib.getDefaultExceptionFactory()
                .newUniqueIndexViolationException(
                    getClass(), S_ProcName, S_LocalName, attrLocalName);
          }
          attrTenantId = attrs.getValue(idxAttr);
        } else if (attrLocalName.equals("ScopeId")) {
          if (attrScopeId != null) {
            throw CFLib.getDefaultExceptionFactory()
                .newUniqueIndexViolationException(
                    getClass(), S_ProcName, S_LocalName, attrLocalName);
          }
          attrScopeId = attrs.getValue(idxAttr);
        } else if (attrLocalName.equals("schemaLocation")) {
          // ignored
        } else {
          throw CFLib.getDefaultExceptionFactory()
              .newUnrecognizedAttributeException(
                  getClass(), S_ProcName, getParser().getLocationInfo(), attrLocalName);
        }
      }

      // Ensure that required attributes have values
      if ((attrTenantId == null) || (attrTenantId.length() <= 0)) {
        throw CFLib.getDefaultExceptionFactory()
            .newNullArgumentException(getClass(), S_ProcName, 0, "TenantId");
      }
      if ((attrScopeId == null) || (attrScopeId.length() <= 0)) {
        throw CFLib.getDefaultExceptionFactory()
            .newNullArgumentException(getClass(), S_ProcName, 0, "ScopeId");
      }

      // Save named attributes to context
      CFLibXmlCoreContext curContext = getParser().getCurContext();
      // Convert string attributes to native Java types
      // and apply the converted attributes to the editBuff.

      long natTenantId;
      natTenantId = Long.parseLong(attrTenantId);

      long natScopeId;
      natScopeId = Long.parseLong(attrScopeId);

      // Read the objects
      List<ICFDbTestUInt64ColObj> list =
          schemaObj.getUInt64ColTableObj().readUInt64ColByScopeIdx(natTenantId, natScopeId);
      String responseOpening =
          schemaFormatter.formatRspnXmlPreamble()
              + "\n"
              + "\t"
              + CFDbTestXMsgValueMessageFormatter.formatValueRspnListOpenTag();
      xmsgRqstHandler.appendResponse(responseOpening);
      Iterator<ICFDbTestUInt64ColObj> iter = list.iterator();
      ICFDbTestUInt64ColObj cur;
      String subxml;
      while (iter.hasNext()) {
        cur = iter.next();
        subxml =
            CFDbTestXMsgValueMessageFormatter.formatValueRspnDerivedRec(
                "\n\t\t", cur.getValueBuff());
        xmsgRqstHandler.appendResponse(subxml);
      }
      String responseClosing =
          "\n"
              + "\t"
              + CFDbTestXMsgValueMessageFormatter.formatValueRspnListCloseTag()
              + schemaFormatter.formatRspnXmlPostamble();
      xmsgRqstHandler.appendResponse(responseClosing);
    } catch (RuntimeException e) {
      CFDbTestXMsgRqstHandler xmsgRqstHandler = ((CFDbTestXMsgRqstHandler) getParser());
      schemaFormatter = xmsgRqstHandler.getSchemaMessageFormatter();
      String response =
          schemaFormatter.formatRspnXmlPreamble()
              + "\n"
              + "\t"
              + CFDbTestXMsgSchemaMessageFormatter.formatRspnException("\n\t\t\t", e)
              + "\n"
              + schemaFormatter.formatRspnXmlPostamble();
      xmsgRqstHandler.resetResponse();
      xmsgRqstHandler.appendResponse(response);
      xmsgRqstHandler.setCaughtException(true);
    } catch (Error e) {
      CFDbTestXMsgRqstHandler xmsgRqstHandler = ((CFDbTestXMsgRqstHandler) getParser());
      schemaFormatter = xmsgRqstHandler.getSchemaMessageFormatter();
      String response =
          schemaFormatter.formatRspnXmlPreamble()
              + "\n"
              + "\t"
              + CFDbTestXMsgSchemaMessageFormatter.formatRspnException("\n\t\t\t", e)
              + "\n"
              + schemaFormatter.formatRspnXmlPostamble();
      xmsgRqstHandler.resetResponse();
      xmsgRqstHandler.appendResponse(response);
      xmsgRqstHandler.setCaughtException(true);
    }
  }