public void setSwingFocus(ICFLibAnyObj value) {
   final String S_ProcName = "setSwingFocus";
   if ((value == null) || (value instanceof ICFBamTokenDefObj)) {
     super.setSwingFocus(value);
   } else {
     throw CFLib.getDefaultExceptionFactory()
         .newUnsupportedClassException(
             getClass(), S_ProcName, "value", value, "ICFBamTokenDefObj");
   }
   ((ICFBamSwingTokenDefJPanelCommon) swingViewEditJPanel).setSwingFocus(value);
   ICFBamTokenDefObj argFocus = (ICFBamTokenDefObj) value;
   if ((argFocus != null) && (!argFocus.getIsNew())) {
     argFocus = (ICFBamTokenDefObj) argFocus.read(true);
     super.setSwingFocus(argFocus);
   }
 }
 public void actionPerformed(ActionEvent e) {
   final String S_ProcName = "actionPerformed";
   if (getSwingFocusAsTokenDef() != null) {
     if (null == getSwingFocusAsTokenDef().getEdit()) {
       JInternalFrame frame =
           swingSchema
               .getTokenDefFactory()
               .newAskDeleteJInternalFrame(getSwingFocusAsTokenDef());
       ((ICFBamSwingTokenDefJPanelCommon) frame).setPanelMode(CFJPanel.PanelMode.View);
       getDesktopPane().add(frame);
       frame.setVisible(true);
       frame.show();
     } else {
       throw CFLib.getDefaultExceptionFactory()
           .newUsageException(
               getClass(),
               S_ProcName,
               "Cannot begin deletion of an object already edited by another window instance");
     }
   }
 }
 public void setPanelMode(CFJPanel.PanelMode value) {
   CFJPanel.PanelMode oldMode = getPanelMode();
   if (oldMode == value) {
     return;
   }
   super.setPanelMode(value);
   ((ICFBamSwingTokenDefJPanelCommon) swingViewEditJPanel).setPanelMode(value);
   if (value == CFJPanel.PanelMode.View) {
     if (actionEdit != null) {
       actionEdit.setEnabled(true);
     }
     if (actionSave != null) {
       actionSave.setEnabled(false);
     }
     if (actionDelete != null) {
       actionDelete.setEnabled(true);
     }
     if (actionClose != null) {
       actionClose.setEnabled(true);
     }
   } else if (value == CFJPanel.PanelMode.Edit) {
     if (actionEdit != null) {
       actionEdit.setEnabled(false);
     }
     if (actionSave != null) {
       actionSave.setEnabled(true);
     }
     if (actionDelete != null) {
       actionDelete.setEnabled(false);
     }
     if (actionClose != null) {
       actionClose.setEnabled(true);
     }
   } else if (value == CFJPanel.PanelMode.Add) {
     if (actionEdit != null) {
       actionEdit.setEnabled(false);
     }
     if (actionSave != null) {
       actionSave.setEnabled(true);
     }
     if (actionDelete != null) {
       actionDelete.setEnabled(false);
     }
     if (actionClose != null) {
       actionClose.setEnabled(true);
     }
   } else {
     if (actionEdit != null) {
       actionEdit.setEnabled(false);
     }
     if (actionSave != null) {
       actionSave.setEnabled(false);
     }
     if (actionDelete != null) {
       actionDelete.setEnabled(false);
     }
     if (actionClose != null) {
       actionClose.setEnabled(true);
     }
   }
 }