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; } FinderTableModel model = getDataModel(); ICFBamSysClusterObj o = (ICFBamSysClusterObj) model.getValueAt(row, COLID_ROW_HEADER); if (o == null) { return; } JInternalFrame frame = swingSchema.getSysClusterFactory().newViewEditJInternalFrame(o); ((ICFBamSwingSysClusterJPanelCommon) frame).setPanelMode(CFJPanel.PanelMode.View); 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"; if (getSwingFocusAsDoubleCol() != null) { if (null == getSwingFocusAsDoubleCol().getEdit()) { JInternalFrame frame = swingSchema .getDoubleColFactory() .newAskDeleteJInternalFrame(getSwingFocusAsDoubleCol()); ((ICFBamSwingDoubleColJPanelCommon) 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"); } } }