public void populateFields() {
    ICFInternetDomainBaseObj popObj;
    ICFInternetDomainBaseObj focus = getSwingFocusAsDomainBase();
    if (focus != null) {
      popObj = (ICFInternetDomainBaseObj) (focus.getEdit());
      if (popObj == null) {
        popObj = focus;
      }
    } else {
      popObj = null;
    }
    if (getPanelMode() == CFJPanel.PanelMode.Unknown) {
      popObj = null;
    }
    if (popObj == null) {
      swingOwnerTenantObj = null;
    } else {
      swingOwnerTenantObj = (ICFBamTenantObj) popObj.getRequiredOwnerTenant(swingIsInitializing);
    }
    if (swingReferenceOwnerTenant != null) {
      swingReferenceOwnerTenant.setReferencedObject(swingOwnerTenantObj);
    }

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

    if (popObj == null) {
      getSwingEditorDescription().setStringValue(null);
    } else {
      getSwingEditorDescription().setStringValue(popObj.getOptionalDescription());
    }
  }
 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) {
     ICFInternetDomainBaseObj focus = getSwingFocusAsDomainBase();
     if (focus == null) {
       isEditing = false;
     } else if (null == focus.getEdit()) {
       isEditing = false;
     }
   }
   if (swingReferenceOwnerTenant != null) {
     swingReferenceOwnerTenant.setEnabled(false);
   }
   if (swingEditorId != null) {
     swingEditorId.setEnabled(false);
   }
   if (swingEditorDescription != null) {
     swingEditorDescription.setEnabled(isEditing);
   }
 }