public void actionPerformed(ActionEvent e) { final String S_ProcName = "actionPerformed"; ICFDbTestSchemaObj schemaObj = swingSchema.getSchema(); ICFDbTestTextColObj obj = (ICFDbTestTextColObj) schemaObj.getTextColTableObj().newInstance(); JInternalFrame frame = swingSchema.getTextColFactory().newViewEditJInternalFrame(obj); frame.addInternalFrameListener(getViewEditInternalFrameListener()); ICFDbTestTextColEditObj edit = (ICFDbTestTextColEditObj) (obj.beginEdit()); if (edit == null) { throw CFLib.getDefaultExceptionFactory() .newNullArgumentException(getClass(), S_ProcName, 0, "edit"); } ICFSecurityTenantObj secTenant = schemaObj.getSecTenant(); edit.setRequiredOwnerTenant(secTenant); ICFDbTestTableObj container = (ICFDbTestTableObj) (getSwingContainer()); if (container == null) { throw CFLib.getDefaultExceptionFactory() .newNullArgumentException(getClass(), S_ProcName, 0, "SwingContainer"); } edit.setRequiredContainerTable(container); ICFDbTestSwingTextColJPanelCommon jpanelCommon = (ICFDbTestSwingTextColJPanelCommon) frame; jpanelCommon.setPanelMode(CFJPanel.PanelMode.Add); Container cont = getParent(); while ((cont != null) && (!(cont instanceof JInternalFrame))) { cont = cont.getParent(); } if (cont != null) { JInternalFrame myInternalFrame = (JInternalFrame) cont; myInternalFrame.getDesktopPane().add(frame); frame.setVisible(true); frame.show(); } }
public void mousePressed(MouseEvent e) { if (e.getButton() != MouseEvent.BUTTON1) { return; } if (e.getClickCount() != 2) { return; } JTable table = (JTable) e.getSource(); Point p = e.getPoint(); int row = table.rowAtPoint(p); if (row < 0) { return; } ListTableModel model = getDataModel(); ICFDbTestTextDefObj o = (ICFDbTestTextDefObj) model.getValueAt(row, COLID_ROW_HEADER); if (o == null) { return; } JInternalFrame frame = null; String classCode = o.getClassCode(); if (classCode.equals("TXTD")) { frame = swingSchema.getTextDefFactory().newViewEditJInternalFrame(o); frame.addInternalFrameListener(getViewEditInternalFrameListener()); ((ICFDbTestSwingTextDefJPanelCommon) frame).setPanelMode(CFJPanel.PanelMode.View); } else if (classCode.equals("TXTC")) { frame = swingSchema.getTextColFactory().newViewEditJInternalFrame((ICFDbTestTextColObj) o); frame.addInternalFrameListener(getViewEditInternalFrameListener()); ((ICFDbTestSwingTextColJPanelCommon) frame).setPanelMode(CFJPanel.PanelMode.View); } else if (classCode.equals("TXTT")) { frame = swingSchema.getTextTypeFactory().newViewEditJInternalFrame((ICFDbTestTextTypeObj) o); frame.addInternalFrameListener(getViewEditInternalFrameListener()); ((ICFDbTestSwingTextTypeJPanelCommon) frame).setPanelMode(CFJPanel.PanelMode.View); } else { frame = null; } if (frame == null) { return; } Container cont = getParent(); while ((cont != null) && (!(cont instanceof JInternalFrame))) { cont = cont.getParent(); } if (cont != null) { JInternalFrame myInternalFrame = (JInternalFrame) cont; myInternalFrame.getDesktopPane().add(frame); frame.setVisible(true); frame.show(); } }
public void actionPerformed(ActionEvent e) { final String S_ProcName = "actionPerformed"; ICFDbTestSchemaObj schemaObj = swingSchema.getSchema(); if (schemaObj == null) { throw CFLib.getDefaultExceptionFactory() .newNullArgumentException(getClass(), S_ProcName, 0, "schemaObj"); } ICFDbTestTextDefObj selectedInstance = getSwingFocusAsTextDef(); if (selectedInstance != null) { String classCode = selectedInstance.getClassCode(); if ("TXTD".equals(classCode)) { JInternalFrame frame = swingSchema.getTextDefFactory().newAskDeleteJInternalFrame(selectedInstance); ((ICFDbTestSwingTextDefJPanelCommon) frame).setPanelMode(CFJPanel.PanelMode.View); frame.addInternalFrameListener(getViewEditInternalFrameListener()); Container cont = getParent(); while ((cont != null) && (!(cont instanceof JInternalFrame))) { cont = cont.getParent(); } if (cont != null) { JInternalFrame myInternalFrame = (JInternalFrame) cont; myInternalFrame.getDesktopPane().add(frame); frame.setVisible(true); frame.show(); } } else if ("TXTC".equals(classCode)) { ICFDbTestTextColObj obj = (ICFDbTestTextColObj) selectedInstance; JInternalFrame frame = swingSchema.getTextColFactory().newAskDeleteJInternalFrame(obj); ((ICFDbTestSwingTextColJPanelCommon) frame).setPanelMode(CFJPanel.PanelMode.View); frame.addInternalFrameListener(getViewEditInternalFrameListener()); Container cont = getParent(); while ((cont != null) && (!(cont instanceof JInternalFrame))) { cont = cont.getParent(); } if (cont != null) { JInternalFrame myInternalFrame = (JInternalFrame) cont; myInternalFrame.getDesktopPane().add(frame); frame.setVisible(true); frame.show(); } } else if ("TXTT".equals(classCode)) { ICFDbTestTextTypeObj obj = (ICFDbTestTextTypeObj) selectedInstance; JInternalFrame frame = swingSchema.getTextTypeFactory().newAskDeleteJInternalFrame(obj); ((ICFDbTestSwingTextTypeJPanelCommon) frame).setPanelMode(CFJPanel.PanelMode.View); frame.addInternalFrameListener(getViewEditInternalFrameListener()); Container cont = getParent(); while ((cont != null) && (!(cont instanceof JInternalFrame))) { cont = cont.getParent(); } if (cont != null) { JInternalFrame myInternalFrame = (JInternalFrame) cont; myInternalFrame.getDesktopPane().add(frame); frame.setVisible(true); frame.show(); } } else { throw CFLib.getDefaultExceptionFactory() .newUnsupportedClassException( getClass(), S_ProcName, "selectedInstance", selectedInstance, "ICFDbTestTextDefObj, ICFDbTestTextColObj, ICFDbTestTextTypeObj"); } } }