public void setSwingDataCollection(Collection<ICFSecurityISOCountryObj> value) { final String S_ProcName = "setSwingDataCollection"; swingDataCollection = value; if (swingDataCollection == null) { arrayOfISOCountry = new ICFSecurityISOCountryObj[0]; } else { int len = value.size(); arrayOfISOCountry = new ICFSecurityISOCountryObj[len]; Iterator<ICFSecurityISOCountryObj> iter = swingDataCollection.iterator(); int idx = 0; while (iter.hasNext() && (idx < len)) { arrayOfISOCountry[idx++] = iter.next(); } if (idx < len) { throw CFLib.getDefaultExceptionFactory() .newRuntimeException( getClass(), S_ProcName, "Collection iterator did not fully populate the array copy"); } if (iter.hasNext()) { throw CFLib.getDefaultExceptionFactory() .newRuntimeException( getClass(), S_ProcName, "Collection iterator had left over items when done populating array copy"); } Arrays.sort(arrayOfISOCountry, compareISOCountryByQualName); } PickerTableModel tblDataModel = getDataModel(); if (tblDataModel != null) { tblDataModel.fireTableDataChanged(); } }
public void actionPerformed(ActionEvent e) { final String S_ProcName = "actionPerformed"; ICFInternetSchemaObj schemaObj = swingSchema.getSchema(); ICFInternetMajorVersionObj obj = (ICFInternetMajorVersionObj) schemaObj.getMajorVersionTableObj().newInstance(); JInternalFrame frame = swingSchema.getMajorVersionFactory().newViewEditJInternalFrame(obj); frame.addInternalFrameListener(getViewEditInternalFrameListener()); ICFInternetMajorVersionEditObj edit = (ICFInternetMajorVersionEditObj) (obj.beginEdit()); if (edit == null) { throw CFLib.getDefaultExceptionFactory() .newNullArgumentException(getClass(), S_ProcName, 0, "edit"); } ICFSecurityTenantObj secTenant = schemaObj.getSecTenant(); edit.setRequiredOwnerTenant(secTenant); ICFInternetRealProjectObj container = (ICFInternetRealProjectObj) (getSwingContainer()); if (container == null) { throw CFLib.getDefaultExceptionFactory() .newNullArgumentException(getClass(), S_ProcName, 0, "SwingContainer"); } edit.setRequiredContainerParent(container); ICFInternetSwingMajorVersionJPanelCommon jpanelCommon = (ICFInternetSwingMajorVersionJPanelCommon) 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 actionPerformed(ActionEvent e) { final String S_ProcName = "actionPerformed"; ICFAccSchemaObj schemaObj = swingSchema.getSchema(); if (schemaObj == null) { throw CFLib.getDefaultExceptionFactory() .newNullArgumentException(getClass(), S_ProcName, 0, "schemaObj"); } ICFSecurityServiceObj selectedInstance = getSwingFocusAsService(); if (selectedInstance != null) { String classCode = selectedInstance.getClassCode(); if ("HSVC".equals(classCode)) { JInternalFrame frame = swingSchema.getServiceFactory().newAskDeleteJInternalFrame(selectedInstance); ((ICFAccSwingServiceJPanelCommon) 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, "ICFAccServiceObj"); } } }
public CFSecuritySwingISOTimezoneFinderJPanel(ICFSecuritySwingSchema argSchema) { super(); final String S_ProcName = "construct-schema-focus"; if (argSchema == null) { throw CFLib.getDefaultExceptionFactory() .newNullArgumentException(getClass(), S_ProcName, 1, "argSchema"); } swingSchema = argSchema; dataTable = new JTable(getDataModel(), getDataColumnModel(), getDataListSelectionModel()); dataTable.addMouseListener(getDataListMouseAdapter()); dataTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); dataTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); dataTable.setUpdateSelectionOnSort(true); dataTable.setRowHeight(25); getDataListSelectionModel().addListSelectionListener(getDataListSelectionListener()); dataScrollPane = new JScrollPane( dataTable, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); dataScrollPane.setColumnHeader( new JViewport() { @Override public Dimension getPreferredSize() { Dimension sz = super.getPreferredSize(); sz.height = 25; return (sz); } }); dataTable.setFillsViewportHeight(true); add(dataScrollPane); loadData(true); doLayout(); swingIsInitializing = false; }
public void valueChanged(ListSelectionEvent lse) { final String S_ProcName = "valueChanged"; ICFBamId64GenObj selectedObj; if (lse.getValueIsAdjusting()) { return; } if (dataTable == null) { return; } int dataRow = dataTable.getSelectedRow(); int modelIndex = dataTable.convertRowIndexToModel(dataRow); PickerTableModel tblDataModel = getDataModel(); Object selectedRowData = tblDataModel.getValueAt(modelIndex, COLID_ROW_HEADER); if (selectedRowData != null) { if (selectedRowData instanceof ICFBamId64GenObj) { int selectedCount = dataTable.getSelectedRowCount(); if (selectedCount <= 0) { selectedObj = null; } else if (selectedCount == 1) { selectedObj = (ICFBamId64GenObj) selectedRowData; } else { selectedObj = null; } } else { selectedObj = null; throw CFLib.getDefaultExceptionFactory() .newUnsupportedClassException( getClass(), S_ProcName, "selectedRowData", selectedRowData, "ICFBamId64GenObj"); } } else { selectedObj = null; } setSwingFocus(selectedObj); adjustFeedback(); }
public void actionPerformed(ActionEvent e) { final String S_ProcName = "actionPerformed"; ICFBamSchemaObj schemaObj = swingSchema.getSchema(); ICFBamAuditActionObj obj = (ICFBamAuditActionObj) schemaObj.getAuditActionTableObj().newInstance(); JInternalFrame frame = swingSchema.getAuditActionFactory().newViewEditJInternalFrame(obj); frame.addInternalFrameListener(getViewEditInternalFrameListener()); ICFBamAuditActionEditObj edit = (ICFBamAuditActionEditObj) (obj.beginEdit()); if (edit == null) { throw CFLib.getDefaultExceptionFactory() .newNullArgumentException(getClass(), S_ProcName, 0, "edit"); } ICFBamSwingAuditActionJPanelCommon jpanelCommon = (ICFBamSwingAuditActionJPanelCommon) 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 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 setSwingFocus(ICFLibAnyObj value) { final String S_ProcName = "setSwingFocus"; if ((value == null) || (value instanceof ICFInternetVersionObj)) { super.setSwingFocus(value); } else { throw CFLib.getDefaultExceptionFactory() .newUnsupportedClassException( getClass(), S_ProcName, "value", value, "ICFInternetVersionObj"); } adjustListMenuBar(); }
public CFInternetSwingVersionListJPanel( ICFInternetSwingSchema argSchema, ICFLibAnyObj argContainer, ICFInternetVersionObj argFocus, Collection<ICFInternetVersionObj> argDataCollection, ICFJRefreshCallback refreshCallback, boolean sortByChain) { super(); final String S_ProcName = "construct-schema-focus"; if (argSchema == null) { throw CFLib.getDefaultExceptionFactory() .newNullArgumentException(getClass(), S_ProcName, 1, "argSchema"); } // argFocus is optional; focus may be set later during execution as // conditions of the runtime change. swingSchema = argSchema; swingFocus = argFocus; swingContainer = argContainer; swingRefreshCallback = refreshCallback; swingSortByChain = sortByChain; setSwingDataCollection(argDataCollection); dataTable = new JTable(getDataModel(), getDataColumnModel(), getDataListSelectionModel()); dataTable.addMouseListener(getDataListMouseAdapter()); dataTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); dataTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); dataTable.setUpdateSelectionOnSort(true); dataTable.setRowHeight(25); getDataListSelectionModel().addListSelectionListener(getDataListSelectionListener()); dataScrollPane = new JScrollPane( dataTable, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); dataScrollPane.setColumnHeader( new JViewport() { @Override public Dimension getPreferredSize() { Dimension sz = super.getPreferredSize(); sz.height = 25; return (sz); } }); dataTable.setFillsViewportHeight(true); // Do initial layout setSize(1024, 480); JMenuBar menuBar = getPanelMenuBar(); add(menuBar); menuBar.setBounds(0, 0, 1024, 25); add(dataScrollPane); dataScrollPane.setBounds(0, 25, 1024, 455); adjustListMenuBar(); doLayout(); swingIsInitializing = false; }
public void valueChanged(ListSelectionEvent lse) { final String S_ProcName = "valueChanged"; ICFSecurityISOTimezoneObj selectedObj; if (lse.getValueIsAdjusting()) { return; } if (dataTable == null) { return; } int dataRow = dataTable.getSelectedRow(); int modelIndex = dataTable.convertRowIndexToModel(dataRow); FinderTableModel tblDataModel = getDataModel(); Object selectedRowData = tblDataModel.getValueAt(modelIndex, COLID_ROW_HEADER); if (selectedRowData != null) { if (selectedRowData instanceof ICFSecurityISOTimezoneObj) { int selectedCount = dataTable.getSelectedRowCount(); if (selectedCount <= 0) { selectedObj = null; } else if (selectedCount == 1) { selectedObj = (ICFSecurityISOTimezoneObj) selectedRowData; } else { selectedObj = null; } } else { selectedObj = null; throw CFLib.getDefaultExceptionFactory() .newUnsupportedClassException( getClass(), S_ProcName, "selectedRowData", selectedRowData, "ICFSecurityISOTimezoneObj"); } } else { selectedObj = null; } Container cont = getParent(); while ((cont != null) && (!(cont instanceof CFJInternalFrame))) { cont = cont.getParent(); } if (cont != null) { CFJInternalFrame frame = (CFJInternalFrame) cont; if (frame instanceof ICFSecuritySwingISOTimezoneJPanelCommon) { ICFSecuritySwingISOTimezoneJPanelCommon jpanelCommon = (ICFSecuritySwingISOTimezoneJPanelCommon) frame; jpanelCommon.setSwingFocus(selectedObj); } } }
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"); } invokeWhenChosen.choseISOCountry(null); try { Container cont = getParent(); while ((cont != null) && (!(cont instanceof JInternalFrame))) { cont = cont.getParent(); } if (cont != null) { ((JInternalFrame) cont).setClosed(true); } } catch (Exception x) { } }
public void actionPerformed(ActionEvent e) { final String S_ProcName = "actionPerformed"; ICFFreeSwitchSchemaObj schemaObj = swingSchema.getSchema(); if (schemaObj == null) { throw CFLib.getDefaultExceptionFactory() .newNullArgumentException(getClass(), S_ProcName, 0, "schemaObj"); } ICFSecurityTSecGroupMemberObj selectedInstance = getSwingFocusAsTSecGroupMember(); invokeWhenChosen.choseTSecGroupMember(selectedInstance); try { Container cont = getParent(); while ((cont != null) && (!(cont instanceof JInternalFrame))) { cont = cont.getParent(); } if (cont != null) { ((JInternalFrame) cont).setClosed(true); } } catch (Exception x) { } }
public void setSwingFocus(ICFLibAnyObj value) { final String S_ProcName = "setSwingFocus"; if ((value == null) || (value instanceof ICFSecurityISOCountryObj)) { super.setSwingFocus(value); } else { throw CFLib.getDefaultExceptionFactory() .newUnsupportedClassException( getClass(), S_ProcName, "value", value, "ICFSecurityISOCountryObj"); } if (dataTable == null) { return; } if (value == null) { dataTable.clearSelection(); } else { ICFInternetISOCountryObj curSelected; PickerTableModel tblDataModel = getDataModel(); int selectedRow = dataTable.getSelectedRow(); int modelIndex = dataTable.convertRowIndexToModel(selectedRow); if (selectedRow >= 0) { Object selectedRowData = tblDataModel.getValueAt(modelIndex, COLID_ROW_HEADER); curSelected = (ICFInternetISOCountryObj) selectedRowData; } else { curSelected = null; } if (curSelected != value) { int len = tblDataModel.getRowCount(); int idx = 0; while ((idx < len) && (tblDataModel.getValueAt(idx, COLID_ROW_HEADER) != value)) { idx++; } if (idx < len) { int viewRow = dataTable.convertRowIndexToView(idx); dataTable.clearSelection(); dataTable.addRowSelectionInterval(viewRow, viewRow); } } } }
public CFInternetSwingISOCountryPickerJPanel( ICFInternetSwingSchema argSchema, ICFSecurityISOCountryObj argFocus, ICFLibAnyObj argContainer, Collection<ICFSecurityISOCountryObj> argDataCollection, ICFInternetSwingISOCountryChosen whenChosen) { super(); final String S_ProcName = "construct-schema-focus"; if (argSchema == null) { throw CFLib.getDefaultExceptionFactory() .newNullArgumentException(getClass(), S_ProcName, 1, "argSchema"); } if (whenChosen == null) { throw CFLib.getDefaultExceptionFactory() .newNullArgumentException(getClass(), S_ProcName, 5, "whenChosen"); } invokeWhenChosen = whenChosen; // argFocus is optional; focus may be set later during execution as // conditions of the runtime change. swingSchema = argSchema; swingFocus = argFocus; swingContainer = argContainer; setSwingDataCollection(argDataCollection); dataTable = new JTable(getDataModel(), getDataColumnModel(), getDataListSelectionModel()); dataTable.addMouseListener(getDataListMouseAdapter()); dataTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); dataTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); dataTable.setUpdateSelectionOnSort(true); dataTable.setRowHeight(25); getDataListSelectionModel().addListSelectionListener(getDataListSelectionListener()); dataScrollPane = new JScrollPane( dataTable, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); dataScrollPane.setColumnHeader( new JViewport() { @Override public Dimension getPreferredSize() { Dimension sz = super.getPreferredSize(); sz.height = 25; return (sz); } }); dataTable.setFillsViewportHeight(true); actionCancel = new ActionCancel(); buttonCancel = new JButton(actionCancel); actionChooseNone = new ActionChooseNone(); buttonChooseNone = new JButton(actionChooseNone); actionChooseSelected = new ActionChooseSelectedISOCountry(); buttonChooseSelected = new JButton(actionChooseSelected); // Do initial layout setSize(1024, 480); add(buttonChooseNone); add(buttonChooseSelected); add(buttonCancel); add(dataScrollPane); dataScrollPane.setBounds(0, 35, 1024, 455); doLayout(); setSwingFocusAsISOCountry(argFocus); }
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().newViewEditJInternalFrame(selectedInstance); frame.addInternalFrameListener(getViewEditInternalFrameListener()); ((ICFInternetSwingVersionJPanelCommon) frame).setPanelMode(CFJPanel.PanelMode.Edit); 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().newViewEditJInternalFrame(obj); frame.addInternalFrameListener(getViewEditInternalFrameListener()); ((ICFInternetSwingMajorVersionJPanelCommon) frame).setPanelMode(CFJPanel.PanelMode.Edit); 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().newViewEditJInternalFrame(obj); frame.addInternalFrameListener(getViewEditInternalFrameListener()); ((ICFInternetSwingMinorVersionJPanelCommon) frame).setPanelMode(CFJPanel.PanelMode.Edit); 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"); } } }
public Object getValueAt(int row, int column) { final String S_ProcName = "getValueAt"; if ((row < 0) || (column < -1)) { return (null); } if (arrayOfTextDef == null) { return (null); } int len = arrayOfTextDef.length; if (row >= len) { return (null); } ICFDbTestTextDefObj obj = arrayOfTextDef[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("TXTD")) { retval = "TextDef"; } else if (classCode.equals("TXTC")) { retval = "TextCol"; } else if (classCode.equals("TXTT")) { retval = "TextType"; } 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_NAME: retval = obj.getRequiredName(); if (retval == null) { retval = ""; } break; case COLID_DEFAULTVISIBILITY: retval = new Boolean(obj.getRequiredDefaultVisibility()); break; case COLID_INITVAL: retval = obj.getOptionalInitVal(); if (retval == null) { retval = ""; } break; default: retval = null; break; } return (retval); }