public void actionPerformed(ActionEvent e) { final String S_ProcName = "actionPerformed"; Container cont = getParent(); while ((cont != null) && (!(cont instanceof JInternalFrame))) { cont = cont.getParent(); } if (cont != null) { JInternalFrame frame = (JInternalFrame) cont; if (frame instanceof ICFSecuritySwingSecGroupJPanelCommon) { ICFSecuritySwingSecGroupJPanelCommon jpanelCommon = (ICFSecuritySwingSecGroupJPanelCommon) frame; jpanelCommon.setPanelMode(CFJPanel.PanelMode.Unknown); ICFSecuritySecGroupEditObj editObj = (ICFSecuritySecGroupEditObj) jpanelCommon.getSwingFocusAsSecGroup().getEdit(); if (editObj != null) { editObj.endEdit(); } } else { throw CFLib.getDefaultExceptionFactory() .newUnsupportedClassException( getClass(), S_ProcName, "frame", frame, "ICFSecuritySwingSecGroupJPanelCommon"); } try { frame.setClosed(true); } catch (Exception x) { } } }
public void deleteSecGroupByIdIdx(long ClusterId, int SecGroupId) { CFSecuritySecGroupPKey pkey = ((ICFSecuritySchema) schema.getBackingStore()).getFactorySecGroup().newPKey(); pkey.setRequiredClusterId(ClusterId); pkey.setRequiredSecGroupId(SecGroupId); ICFSecuritySecGroupObj obj = readSecGroup(pkey); if (obj != null) { ICFSecuritySecGroupEditObj editObj = (ICFSecuritySecGroupEditObj) obj.getEdit(); boolean editStarted; if (editObj == null) { editObj = (ICFSecuritySecGroupEditObj) obj.beginEdit(); if (editObj != null) { editStarted = true; } else { editStarted = false; } } else { editStarted = false; } if (editObj != null) { editObj.delete(); if (editStarted) { editObj.endEdit(); } } obj.forget(true); } }