public int compare(ICFAsteriskExtensionsConfObj lhs, ICFAsteriskExtensionsConfObj rhs) {
   if (lhs == null) {
     if (rhs == null) {
       return (0);
     } else {
       return (-1);
     }
   } else if (rhs == null) {
     return (1);
   } else {
     String lhsValue = lhs.getObjQualifiedName();
     String rhsValue = rhs.getObjQualifiedName();
     if (lhsValue == null) {
       if (rhsValue == null) {
         return (0);
       } else {
         return (-1);
       }
     } else if (rhsValue == null) {
       return (1);
     } else {
       return (lhsValue.compareTo(rhsValue));
     }
   }
 }
 public void chose(ICFLibAnyObj value) {
   final String S_ProcName = "chose";
   Node cont;
   ICFAsteriskSchemaObj schemaObj = (ICFAsteriskSchemaObj) javafxSchema.getSchema();
   ICFAsteriskExtensionsConfObj focus = getJavaFXFocusAsExtensionsConf();
   ICFAsteriskExtensionsConfEditObj editObj = (ICFAsteriskExtensionsConfEditObj) focus.getEdit();
   if (editObj != null) {
     focus = editObj;
   }
   ICFSecurityHostNodeObj referencedObj =
       (ICFSecurityHostNodeObj) javafxReferenceParentHostNode.getReferencedObject();
   java.util.List<ICFSecurityHostNodeObj> listOfHostNode = null;
   CFSecurityAuthorization auth = schemaObj.getAuthorization();
   long containingClusterId = auth.getSecClusterId();
   listOfHostNode =
       schemaObj.getHostNodeTableObj().readHostNodeByClusterIdx(containingClusterId);
   if (listOfHostNode == null) {
     throw CFLib.getDefaultExceptionFactory()
         .newNullArgumentException(getClass(), S_ProcName, 0, "listOfHostNode");
   }
   Collection<ICFSecurityHostNodeObj> cltn = listOfHostNode;
   CFBorderPane form =
       javafxSchema
           .getHostNodeFactory()
           .newPickerForm(
               cfFormManager, referencedObj, null, cltn, new CallbackHostNodeChosen());
   ((ICFSecurityJavaFXHostNodePaneCommon) form).setPaneMode(CFPane.PaneMode.View);
   cfFormManager.pushForm(form);
 }
 public void choseHostNode(ICFSecurityHostNodeObj value) {
   if (javafxReferenceParentHostNode != null) {
     ICFAsteriskExtensionsConfObj cur = getJavaFXFocusAsExtensionsConf();
     if (cur != null) {
       ICFAsteriskExtensionsConfEditObj editObj =
           (ICFAsteriskExtensionsConfEditObj) cur.getEdit();
       if (null != editObj) {
         CFPane.PaneMode curMode = getPaneMode();
         if ((curMode == CFPane.PaneMode.Add) || (curMode == CFPane.PaneMode.Edit)) {
           javafxReferenceParentHostNode.setReferencedObject(value);
           editObj.setRequiredParentHostNode(value);
         }
       }
     }
   }
 }
 public void adjustComponentEnableStates() {
   CFPane.PaneMode mode = getPaneMode();
   boolean isEditing;
   switch (mode) {
     case Unknown:
     case View:
     case Delete:
       isEditing = false;
       break;
     case Add:
     case Edit:
     case Update:
       isEditing = true;
       break;
     default:
       isEditing = false;
       break;
   }
   if (isEditing) {
     ICFAsteriskExtensionsConfObj focus = getJavaFXFocusAsExtensionsConf();
     if (focus == null) {
       isEditing = false;
     } else if (null == focus.getEdit()) {
       isEditing = false;
     }
   }
   if (javafxReferenceParentHostNode != null) {
     javafxReferenceParentHostNode.setCustomDisable(!isEditing);
   }
   if (javafxEditorId != null) {
     javafxEditorId.setDisable(true);
   }
   if (javafxEditorFileFullName != null) {
     javafxEditorFileFullName.setDisable(!isEditing);
   }
   if (javafxEditorFileContents != null) {
     javafxEditorFileContents.setDisable(!isEditing);
   }
 }
  public void postFields() {
    final String S_ProcName = "postFields";
    ICFAsteriskExtensionsConfObj focus = getJavaFXFocusAsExtensionsConf();
    ICFAsteriskExtensionsConfEditObj editObj;
    if (focus != null) {
      editObj = (ICFAsteriskExtensionsConfEditObj) (focus.getEdit());
    } else {
      editObj = null;
    }
    if (editObj == null) {
      throw CFLib.getDefaultExceptionFactory()
          .newUsageException(
              getClass(), S_ProcName, "Pane is unfocused or is not editing the focus object");
    }

    javafxParentHostNodeObj =
        (ICFSecurityHostNodeObj) (javafxReferenceParentHostNode.getReferencedObject());
    editObj.setRequiredParentHostNode(javafxParentHostNodeObj);

    editObj.setRequiredFileFullName(getJavaFXEditorFileFullName().getStringValue());

    editObj.setRequiredFileContents(getJavaFXEditorFileContents().getTextValue());
  }
  public void populateFields() {
    ICFAsteriskExtensionsConfObj popObj;
    ICFAsteriskExtensionsConfObj focus = getJavaFXFocusAsExtensionsConf();
    if (focus != null) {
      popObj = (ICFAsteriskExtensionsConfObj) (focus.getEdit());
      if (popObj == null) {
        popObj = focus;
      }
    } else {
      popObj = null;
    }
    if (getPaneMode() == CFPane.PaneMode.Unknown) {
      popObj = null;
    }
    if (popObj == null) {
      javafxParentHostNodeObj = null;
    } else {
      javafxParentHostNodeObj =
          (ICFSecurityHostNodeObj) popObj.getRequiredParentHostNode(javafxIsInitializing);
    }
    if (javafxReferenceParentHostNode != null) {
      javafxReferenceParentHostNode.setReferencedObject(javafxParentHostNodeObj);
    }

    if (popObj == null) {
      getJavaFXEditorId().setInt64Value(null);
    } else {
      getJavaFXEditorId().setInt64Value(popObj.getRequiredId());
    }

    if (popObj == null) {
      getJavaFXEditorFileFullName().setStringValue(null);
    } else {
      getJavaFXEditorFileFullName().setStringValue(popObj.getRequiredFileFullName());
    }

    if (popObj == null) {
      getJavaFXEditorFileContents().setTextValue(null);
    } else {
      getJavaFXEditorFileContents().setTextValue(popObj.getRequiredFileContents());
    }
  }
 public void setPaneMode(CFPane.PaneMode value) {
   final String S_ProcName = "setPaneMode";
   CFPane.PaneMode oldValue = getPaneMode();
   if (oldValue == value) {
     return;
   }
   ICFAsteriskExtensionsConfObj focus = getJavaFXFocusAsExtensionsConf();
   if ((value != CFPane.PaneMode.Unknown) && (value != CFPane.PaneMode.View)) {
     if (focus == null) {
       throw CFLib.getDefaultExceptionFactory()
           .newNullArgumentException(getClass(), S_ProcName, 0, "javaFXFocus");
     }
   }
   ICFAsteriskExtensionsConfEditObj editObj;
   if (focus != null) {
     editObj = (ICFAsteriskExtensionsConfEditObj) focus.getEdit();
   } else {
     editObj = null;
   }
   switch (value) {
     case Unknown:
       switch (oldValue) {
         case Unknown:
           break;
         default:
           if (editObj != null) {
             editObj.endEdit();
           }
           break;
       }
       break;
     case Add:
       switch (oldValue) {
         case Unknown:
         case Add:
         case View:
           if (editObj == null) {
             if (focus != null) {
               if (!focus.getIsNew()) {
                 throw CFLib.getDefaultExceptionFactory()
                     .newUsageException(
                         getClass(),
                         S_ProcName,
                         "Transitioning to PaneMode Add requires Focus.getIsNew() to be true");
               }
               editObj = (ICFAsteriskExtensionsConfEditObj) focus.beginEdit();
               if (editObj == null) {
                 throw CFLib.getDefaultExceptionFactory()
                     .newUsageException(
                         getClass(),
                         S_ProcName,
                         "Expected beginEdit() to return a new edition of the focus object");
               }
             } else {
               throw CFLib.getDefaultExceptionFactory()
                   .newNullArgumentException(getClass(), S_ProcName, 0, "focus");
             }
           }
           break;
         case Edit:
           throw CFLib.getDefaultExceptionFactory()
               .newUsageException(
                   getClass(), S_ProcName, "Cannot transition PaneMode Edit to Add");
         case Update:
           if ((editObj == null) || (!editObj.getIsNew())) {
             throw CFLib.getDefaultExceptionFactory()
                 .newUsageException(
                     getClass(), S_ProcName, "Cannot transition PaneMode Update to Add");
           }
           break;
         case Delete:
           throw CFLib.getDefaultExceptionFactory()
               .newUsageException(
                   getClass(), S_ProcName, "Cannot transition PaneMode Delete to Add");
         default:
           throw CFLib.getDefaultExceptionFactory()
               .newUsageException(
                   getClass(), S_ProcName, "Cannot transition PaneMode default to Add");
       }
       break;
     case View:
       switch (oldValue) {
         case Unknown:
           break;
         case View:
           break;
         case Edit:
           break;
         case Update:
           break;
         case Delete:
           break;
         default:
           throw CFLib.getDefaultExceptionFactory()
               .newUsageException(
                   getClass(), S_ProcName, "Cannot transition PaneMode " + oldValue + " to View");
       }
       if (editObj != null) {
         editObj.endEdit();
       }
       break;
     case Edit:
       switch (oldValue) {
         case Unknown:
           if (editObj == null) {
             editObj = (ICFAsteriskExtensionsConfEditObj) focus.beginEdit();
             if (editObj == null) {
               throw CFLib.getDefaultExceptionFactory()
                   .newUsageException(
                       getClass(),
                       S_ProcName,
                       "Expected beginEdit() to return a new edition of the focus object");
             }
           }
           break;
         case View:
           if (editObj == null) {
             editObj = (ICFAsteriskExtensionsConfEditObj) focus.beginEdit();
             if (editObj == null) {
               throw CFLib.getDefaultExceptionFactory()
                   .newUsageException(
                       getClass(),
                       S_ProcName,
                       "Expected beginEdit() to return a new edition of the focus object");
             }
           }
           break;
         case Edit:
           if (editObj == null) {
             editObj = (ICFAsteriskExtensionsConfEditObj) focus.beginEdit();
             if (editObj == null) {
               throw CFLib.getDefaultExceptionFactory()
                   .newUsageException(
                       getClass(),
                       S_ProcName,
                       "Expected beginEdit() to return a new edition of the focus object");
             }
           }
           break;
         case Update:
           if (editObj == null) {
             throw CFLib.getDefaultExceptionFactory()
                 .newUsageException(
                     getClass(),
                     S_ProcName,
                     "Cannot transition PaneMode " + oldValue + " to Edit");
           }
           break;
         default:
           throw CFLib.getDefaultExceptionFactory()
               .newUsageException(
                   getClass(), S_ProcName, "Cannot transition PaneMode " + oldValue + " to Edit");
       }
       break;
     case Update:
       if ((oldValue != CFPane.PaneMode.Edit) && (oldValue != CFPane.PaneMode.Add)) {
         throw CFLib.getDefaultExceptionFactory()
             .newUsageException(
                 getClass(), S_ProcName, "Cannot transition from mode " + oldValue + " to Update");
       }
       super.setPaneMode(value);
       if (editObj != null) {
         postFields();
         if (editObj.getIsNew()) {
           focus = (ICFAsteriskExtensionsConfObj) editObj.create();
           setJavaFXFocus(focus);
         } else {
           editObj.update();
         }
         editObj.endEdit();
         editObj = null;
       }
       setPaneMode(CFPane.PaneMode.View);
       break;
     case Delete:
       switch (oldValue) {
         case View:
           if (focus != null) {
             if (editObj == null) {
               editObj = (ICFAsteriskExtensionsConfEditObj) focus.beginEdit();
               if (editObj == null) {
                 throw CFLib.getDefaultExceptionFactory()
                     .newUsageException(
                         getClass(),
                         S_ProcName,
                         "Expected beginEdit() to return a new edition of the focus object");
               }
             }
           }
           break;
         case Edit:
           if (focus != null) {
             if (editObj == null) {
               editObj = (ICFAsteriskExtensionsConfEditObj) focus.beginEdit();
               if (editObj == null) {
                 throw CFLib.getDefaultExceptionFactory()
                     .newUsageException(
                         getClass(),
                         S_ProcName,
                         "Expected beginEdit() to return a new edition of the focus object");
               }
             }
           }
           break;
         case Update:
           throw CFLib.getDefaultExceptionFactory()
               .newUsageException(
                   getClass(), S_ProcName, "Cannot transition PaneMode Update to Delete");
         case Delete:
           if (editObj == null) {
             editObj = (ICFAsteriskExtensionsConfEditObj) focus.beginEdit();
             if (editObj == null) {
               throw CFLib.getDefaultExceptionFactory()
                   .newUsageException(
                       getClass(),
                       S_ProcName,
                       "Expected beginEdit() to return a new edition of the focus object");
             }
           }
           break;
         default:
           throw CFLib.getDefaultExceptionFactory()
               .newUsageException(
                   getClass(),
                   S_ProcName,
                   "Cannot transition PaneMode " + oldValue + " to Delete");
       }
       editObj.delete();
       editObj.endEdit();
       setJavaFXFocus(null);
       setPaneMode(CFPane.PaneMode.Unknown);
       break;
     default:
       switch (oldValue) {
         case Unknown:
           break;
         default:
           if (editObj != null) {
             editObj.endEdit();
           }
           break;
       }
       break;
   }
   super.setPaneMode(value);
   populateFields();
   adjustComponentEnableStates();
 }