public void adjustComponentEnableStates() {
   CFJPanel.PanelMode mode = getPanelMode();
   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) {
     ICFSecurityTSecGroupObj focus = getSwingFocusAsTSecGroup();
     if (focus == null) {
       isEditing = false;
     } else if (null == focus.getEdit()) {
       isEditing = false;
     }
   }
   if (swingReferenceContainerTenant != null) {
     swingReferenceContainerTenant.setEnabled(false);
   }
   if (swingEditorTSecGroupId != null) {
     swingEditorTSecGroupId.setEnabled(false);
   }
   if (swingEditorName != null) {
     swingEditorName.setEnabled(isEditing);
   }
 }
  public void populateFields() {
    ICFSecurityTSecGroupObj popObj;
    ICFSecurityTSecGroupObj focus = getSwingFocusAsTSecGroup();
    if (focus != null) {
      popObj = (ICFSecurityTSecGroupObj) (focus.getEdit());
      if (popObj == null) {
        popObj = focus;
      }
    } else {
      popObj = null;
    }
    if (getPanelMode() == CFJPanel.PanelMode.Unknown) {
      popObj = null;
    }
    if (popObj == null) {
      swingContainerTenantObj = null;
    } else {
      swingContainerTenantObj =
          (ICFDbTestTenantObj) popObj.getRequiredContainerTenant(swingIsInitializing);
    }
    if (swingReferenceContainerTenant != null) {
      swingReferenceContainerTenant.setReferencedObject(swingContainerTenantObj);
    }

    if (popObj == null) {
      getSwingEditorTSecGroupId().setInt32Value(null);
    } else {
      getSwingEditorTSecGroupId().setInt32Value(popObj.getRequiredTSecGroupId());
    }

    if (popObj == null) {
      getSwingEditorName().setStringValue(null);
    } else {
      getSwingEditorName().setStringValue(popObj.getRequiredName());
    }
  }