public Object getValueAt(int row, int column) { final String S_ProcName = "getValueAt"; if ((row < 0) || (column < -1)) { return (null); } if (arrayOfVersion == null) { return (null); } int len = arrayOfVersion.length; if (row >= len) { return (null); } ICFInternetVersionObj obj = arrayOfVersion[row]; if (obj == null) { return (null); } Object retval; switch (column) { case COLID_ROW_HEADER: retval = obj; break; case COLID_OBJQUALIFIEDNAME: retval = obj.getObjQualifiedName(); break; case COLID_OBJKIND: String classCode = obj.getClassCode(); if (classCode.equals("VERN")) { retval = "Version"; } else if (classCode.equals("MJVR")) { retval = "MajorVersion"; } else if (classCode.equals("MNVR")) { retval = "MinorVersion"; } else { throw CFLib.getDefaultExceptionFactory() .newRuntimeException( getClass(), S_ProcName, "Unsupported class code \"" + classCode + "\" detected"); } break; case COLID_ID: retval = new Long(obj.getRequiredId()); break; case COLID_DESCRIPTION: retval = obj.getOptionalDescription(); if (retval == null) { retval = ""; } break; default: retval = null; break; } return (retval); }
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(); ICFInternetVersionObj o = (ICFInternetVersionObj) model.getValueAt(row, COLID_ROW_HEADER); if (o == null) { return; } JInternalFrame frame = null; String classCode = o.getClassCode(); if (classCode.equals("VERN")) { frame = swingSchema.getVersionFactory().newViewEditJInternalFrame(o); frame.addInternalFrameListener(getViewEditInternalFrameListener()); ((ICFInternetSwingVersionJPanelCommon) frame).setPanelMode(CFJPanel.PanelMode.View); } else if (classCode.equals("MJVR")) { frame = swingSchema .getMajorVersionFactory() .newViewEditJInternalFrame((ICFInternetMajorVersionObj) o); frame.addInternalFrameListener(getViewEditInternalFrameListener()); ((ICFInternetSwingMajorVersionJPanelCommon) frame).setPanelMode(CFJPanel.PanelMode.View); } else if (classCode.equals("MNVR")) { frame = swingSchema .getMinorVersionFactory() .newViewEditJInternalFrame((ICFInternetMinorVersionObj) o); frame.addInternalFrameListener(getViewEditInternalFrameListener()); ((ICFInternetSwingMinorVersionJPanelCommon) 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"; ICFInternetSchemaObj schemaObj = swingSchema.getSchema(); if (schemaObj == null) { throw CFLib.getDefaultExceptionFactory() .newNullArgumentException(getClass(), S_ProcName, 0, "schemaObj"); } ICFInternetVersionObj selectedInstance = getSwingFocusAsVersion(); if (selectedInstance != null) { String classCode = selectedInstance.getClassCode(); if ("VERN".equals(classCode)) { JInternalFrame frame = swingSchema.getVersionFactory().newAskDeleteJInternalFrame(selectedInstance); ((ICFInternetSwingVersionJPanelCommon) 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 ("MJVR".equals(classCode)) { ICFInternetMajorVersionObj obj = (ICFInternetMajorVersionObj) selectedInstance; JInternalFrame frame = swingSchema.getMajorVersionFactory().newAskDeleteJInternalFrame(obj); ((ICFInternetSwingMajorVersionJPanelCommon) 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 ("MNVR".equals(classCode)) { ICFInternetMinorVersionObj obj = (ICFInternetMinorVersionObj) selectedInstance; JInternalFrame frame = swingSchema.getMinorVersionFactory().newAskDeleteJInternalFrame(obj); ((ICFInternetSwingMinorVersionJPanelCommon) 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, "ICFInternetVersionObj, ICFInternetMajorVersionObj, ICFInternetMinorVersionObj"); } } }