List of usage examples for javax.swing ListSelectionModel SINGLE_SELECTION
int SINGLE_SELECTION
To view the source code for javax.swing ListSelectionModel SINGLE_SELECTION.
Click Source Link
From source file:com.mirth.connect.client.ui.codetemplate.CodeTemplateImportDialog.java
private void initComponents() { setBackground(UIConstants.BACKGROUND_COLOR); getContentPane().setBackground(getBackground()); topPanel = new JPanel(); topPanel.setBackground(getBackground()); linkPanel = new JPanel(); linkPanel.setBackground(topPanel.getBackground()); linkLeftPanel = new JPanel(); linkLeftPanel.setBackground(linkPanel.getBackground()); linkLeftSelectAllLabel = new JLabel("<html><u>All</u></html>"); linkLeftSelectAllLabel.setForeground(Color.BLUE); linkLeftSelectAllLabel.setCursor(new Cursor(Cursor.HAND_CURSOR)); linkLeftSelectAllLabel.addMouseListener(new MouseAdapter() { public void mouseReleased(MouseEvent evt) { for (int row = 0; row < importTreeTable.getRowCount(); row++) { importTreeTable.getModel().setValueAt(true, row, IMPORT_SELECTED_COLUMN); }//from w w w . j a va 2 s . c om } }); linkLeftDeselectAllLabel = new JLabel("<html><u>None</u></html>"); linkLeftDeselectAllLabel.setForeground(Color.BLUE); linkLeftDeselectAllLabel.setCursor(new Cursor(Cursor.HAND_CURSOR)); linkLeftDeselectAllLabel.addMouseListener(new MouseAdapter() { public void mouseReleased(MouseEvent evt) { for (int row = 0; row < importTreeTable.getRowCount(); row++) { importTreeTable.getModel().setValueAt(false, row, IMPORT_SELECTED_COLUMN); } } }); linkRightPanel = new JPanel(); linkRightPanel.setBackground(linkPanel.getBackground()); linkRightOverwriteAllLabel = new JLabel("<html><u>All</u></html>"); linkRightOverwriteAllLabel.setForeground(Color.BLUE); linkRightOverwriteAllLabel.setCursor(new Cursor(Cursor.HAND_CURSOR)); linkRightOverwriteAllLabel.addMouseListener(new MouseAdapter() { public void mouseReleased(MouseEvent evt) { for (int row = 0; row < importTreeTable.getRowCount(); row++) { TreePath path = importTreeTable.getPathForRow(row); if (path != null) { ImportTreeTableNode node = (ImportTreeTableNode) path.getLastPathComponent(); if (node instanceof ImportLibraryTreeTableNode) { ImportLibraryTreeTableNode libraryNode = (ImportLibraryTreeTableNode) node; if (libraryNode.getConflicts().getMatchingLibrary() != null) { importTreeTable.getModel().setValueAt(true, row, IMPORT_OVERWRITE_COLUMN); } } else if (node instanceof ImportCodeTemplateTreeTableNode) { ImportCodeTemplateTreeTableNode codeTemplateNode = (ImportCodeTemplateTreeTableNode) node; if (codeTemplateNode.getConflicts().getMatchingCodeTemplate() != null) { importTreeTable.getModel().setValueAt(true, row, IMPORT_OVERWRITE_COLUMN); } } } } } }); linkRightOverwriteNoneLabel = new JLabel("<html><u>None</u></html>"); linkRightOverwriteNoneLabel.setForeground(Color.BLUE); linkRightOverwriteNoneLabel.setCursor(new Cursor(Cursor.HAND_CURSOR)); linkRightOverwriteNoneLabel.addMouseListener(new MouseAdapter() { public void mouseReleased(MouseEvent evt) { for (int row = 0; row < importTreeTable.getRowCount(); row++) { TreePath path = importTreeTable.getPathForRow(row); if (path != null) { ImportTreeTableNode node = (ImportTreeTableNode) path.getLastPathComponent(); if (node instanceof ImportLibraryTreeTableNode) { ImportLibraryTreeTableNode libraryNode = (ImportLibraryTreeTableNode) node; if (libraryNode.getConflicts().getMatchingLibrary() != null) { importTreeTable.getModel().setValueAt(false, row, IMPORT_OVERWRITE_COLUMN); } } else if (node instanceof ImportCodeTemplateTreeTableNode) { ImportCodeTemplateTreeTableNode codeTemplateNode = (ImportCodeTemplateTreeTableNode) node; if (codeTemplateNode.getConflicts().getMatchingCodeTemplate() != null) { importTreeTable.getModel().setValueAt(false, row, IMPORT_OVERWRITE_COLUMN); } } } } } }); final TableCellEditor templateCellEditor = new NameCellEditor(); importTreeTable = new JXTreeTable() { @Override public boolean isCellEditable(int row, int column) { return (column == IMPORT_OVERWRITE_COLUMN || column == IMPORT_SELECTED_COLUMN || column == IMPORT_NAME_COLUMN); } @Override public TableCellEditor getCellEditor(int row, int column) { if (isHierarchical(column)) { return templateCellEditor; } else { return super.getCellEditor(row, column); } } }; importTreeTable.setLargeModel(true); DefaultTreeTableModel model = new ImportTreeTableModel(); model.setColumnIdentifiers(Arrays.asList(new String[] { "", "Name", "Overwrite", "Conflicts", "Id" })); DefaultMutableTreeTableNode rootNode = new DefaultMutableTreeTableNode(); model.setRoot(rootNode); importTreeTable.setTreeTableModel(model); Set<String> addedCodeTemplateIds = new HashSet<String>(); if (unassignedCodeTemplates) { ImportTreeTableNode libraryNode = new ImportUnassignedLibraryTreeTableNode("Select a library", ""); CodeTemplateLibrary library = importLibraries.get(0); for (CodeTemplate codeTemplate : library.getCodeTemplates()) { if (!addedCodeTemplateIds.contains(codeTemplate.getId())) { libraryNode .add(new ImportCodeTemplateTreeTableNode(codeTemplate.getName(), codeTemplate.getId())); addedCodeTemplateIds.add(codeTemplate.getId()); importCodeTemplateMap.put(codeTemplate.getId(), codeTemplate); } } rootNode.add(libraryNode); } else { Set<String> addedLibraryIds = new HashSet<String>(); for (CodeTemplateLibrary library : importLibraries) { if (!addedLibraryIds.contains(library.getId())) { ImportTreeTableNode libraryNode = new ImportLibraryTreeTableNode(library.getName(), library.getId()); importLibraryMap.put(library.getId(), library); for (CodeTemplate codeTemplate : library.getCodeTemplates()) { if (!addedCodeTemplateIds.contains(codeTemplate.getId())) { libraryNode.add(new ImportCodeTemplateTreeTableNode(codeTemplate.getName(), codeTemplate.getId())); addedCodeTemplateIds.add(codeTemplate.getId()); importCodeTemplateMap.put(codeTemplate.getId(), codeTemplate); } } rootNode.add(libraryNode); addedLibraryIds.add(library.getId()); } } } importTreeTable.setOpenIcon(null); importTreeTable.setClosedIcon(null); importTreeTable.setLeafIcon(null); importTreeTable.setRootVisible(false); importTreeTable.setDoubleBuffered(true); importTreeTable.setDragEnabled(false); importTreeTable.setRowSelectionAllowed(true); importTreeTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); importTreeTable.setRowHeight(UIConstants.ROW_HEIGHT); importTreeTable.setFocusable(true); importTreeTable.setOpaque(true); importTreeTable.getTableHeader().setReorderingAllowed(false); importTreeTable.putClientProperty("terminateEditOnFocusLost", Boolean.TRUE); importTreeTable.setEditable(true); importTreeTable.setSortable(false); importTreeTable.setAutoCreateColumnsFromModel(false); importTreeTable.setShowGrid(true, true); if (Preferences.userNodeForPackage(Mirth.class).getBoolean("highlightRows", true)) { importTreeTable.setHighlighters(HighlighterFactory .createAlternateStriping(UIConstants.HIGHLIGHTER_COLOR, UIConstants.BACKGROUND_COLOR)); } importTreeTable.addMouseListener(new MouseAdapter() { @Override public void mousePressed(MouseEvent evt) { checkSelection(evt); } @Override public void mouseReleased(MouseEvent evt) { checkSelection(evt); } private void checkSelection(MouseEvent evt) { int row = importTreeTable.rowAtPoint(new Point(evt.getX(), evt.getY())); if (row < 0) { importTreeTable.clearSelection(); } } }); importTreeTable.addTreeWillExpandListener(new TreeWillExpandListener() { @Override public void treeWillExpand(TreeExpansionEvent event) throws ExpandVetoException { } @Override public void treeWillCollapse(TreeExpansionEvent event) throws ExpandVetoException { throw new ExpandVetoException(event); } }); importTreeTable.setTreeCellRenderer(new NameCellRenderer()); importTreeTable.getModel().addTableModelListener(new TableModelListener() { @Override public void tableChanged(TableModelEvent evt) { if (evt.getColumn() != IMPORT_CONFLICTS_COLUMN) { for (int row = evt.getFirstRow(); row <= evt.getLastRow() && row < importTreeTable.getRowCount(); row++) { TreePath path = importTreeTable.getPathForRow(row); if (path != null) { ImportTreeTableNode node = (ImportTreeTableNode) path.getLastPathComponent(); if (path.getPathCount() == 2) { if (node instanceof ImportUnassignedLibraryTreeTableNode) { String libraryName = (String) node.getValueAt(IMPORT_NAME_COLUMN); String libraryId = null; for (CodeTemplateLibrary library : PlatformUI.MIRTH_FRAME.codeTemplatePanel .getCachedCodeTemplateLibraries().values()) { if (library.getName().equals(libraryName)) { libraryId = library.getId(); break; } } node.setValueAt(libraryId, IMPORT_ID_COLUMN); } else if (node instanceof ImportLibraryTreeTableNode) { ImportLibraryTreeTableNode libraryNode = (ImportLibraryTreeTableNode) node; libraryNode.setConflicts(getLibraryConflicts(node)); } for (Enumeration<? extends TreeTableNode> codeTemplateNodes = node .children(); codeTemplateNodes.hasMoreElements();) { ImportCodeTemplateTreeTableNode codeTemplateNode = (ImportCodeTemplateTreeTableNode) codeTemplateNodes .nextElement(); codeTemplateNode.setConflicts(getCodeTemplateConflicts(codeTemplateNode)); } importTreeTable.updateUI(); } else if (path.getPathCount() == 3) { ImportCodeTemplateTreeTableNode codeTemplateNode = (ImportCodeTemplateTreeTableNode) node; codeTemplateNode.setConflicts(getCodeTemplateConflicts(node)); } } } } updateImportButton(); updateErrorsAndWarnings(); } }); importTreeTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() { @Override public void valueChanged(ListSelectionEvent evt) { if (!evt.getValueIsAdjusting()) { updateImportButton(); updateErrorsAndWarnings(); } } }); importTreeTable.expandAll(); importTreeTable.getColumnModel().getColumn(IMPORT_SELECTED_COLUMN).setMinWidth(20); importTreeTable.getColumnModel().getColumn(IMPORT_SELECTED_COLUMN).setMaxWidth(20); importTreeTable.getColumnModel().getColumn(IMPORT_SELECTED_COLUMN) .setCellRenderer(new ImportSelectedCellRenderer()); importTreeTable.getColumnModel().getColumn(IMPORT_SELECTED_COLUMN) .setCellEditor(new ImportSelectedCellEditor()); importTreeTable.getColumnModel().getColumn(IMPORT_OVERWRITE_COLUMN).setMinWidth(60); importTreeTable.getColumnModel().getColumn(IMPORT_OVERWRITE_COLUMN).setMaxWidth(60); importTreeTable.getColumnModel().getColumn(IMPORT_OVERWRITE_COLUMN) .setCellRenderer(new OverwriteCellRenderer()); importTreeTable.getColumnModel().getColumn(IMPORT_OVERWRITE_COLUMN) .setCellEditor(new OverwriteCellEditor()); importTreeTable.getColumnModel().getColumn(IMPORT_CONFLICTS_COLUMN).setMinWidth(60); importTreeTable.getColumnModel().getColumn(IMPORT_CONFLICTS_COLUMN).setMaxWidth(60); importTreeTable.getColumnModel().getColumn(IMPORT_CONFLICTS_COLUMN).setCellRenderer(new IconCellRenderer()); importTreeTable.getColumnModel().removeColumn(importTreeTable.getColumnModel().getColumn(IMPORT_ID_COLUMN)); importTreeTableScrollPane = new JScrollPane(importTreeTable); importTreeTableScrollPane.setBorder(BorderFactory.createMatteBorder(1, 1, 1, 1, new Color(0x6E6E6E))); warningsPanel = new JPanel(); warningsPanel.setBackground(getBackground()); warningsPanel.setVisible(false); warningsLabel = new JLabel(UIConstants.ICON_WARNING); warningsTextArea = new JTextArea(); warningsTextArea.setLineWrap(true); warningsTextArea.setWrapStyleWord(true); errorsPanel = new JPanel(); errorsPanel.setBackground(getBackground()); errorsPanel.setVisible(false); errorsLabel = new JLabel(UIConstants.ICON_ERROR); errorsTextArea = new JTextArea(); errorsTextArea.setLineWrap(true); errorsTextArea.setWrapStyleWord(true); separator = new JSeparator(); buttonPanel = new JPanel(); buttonPanel.setBackground(getBackground()); importButton = new JButton("Import"); importButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { try { boolean warnings = false; for (Enumeration<? extends TreeTableNode> libraryNodes = ((TreeTableNode) importTreeTable .getTreeTableModel().getRoot()).children(); libraryNodes.hasMoreElements();) { for (Enumeration<? extends TreeTableNode> codeTemplateNodes = libraryNodes.nextElement() .children(); codeTemplateNodes.hasMoreElements();) { ImportCodeTemplateTreeTableNode codeTemplateNode = (ImportCodeTemplateTreeTableNode) codeTemplateNodes .nextElement(); if ((boolean) codeTemplateNode.getValueAt(IMPORT_SELECTED_COLUMN)) { CodeTemplateConflicts conflicts = codeTemplateNode.getConflicts(); if (conflicts.getMatchingCodeTemplate() != null) { warnings = true; break; } } } if (warnings) { break; } } if (!warnings || PlatformUI.MIRTH_FRAME.alertOption(CodeTemplateImportDialog.this, "Some selected rows have warnings. Are you sure you wish to continue?")) { save(); dispose(); } } catch (Exception e) { PlatformUI.MIRTH_FRAME.alertThrowable(CodeTemplateImportDialog.this, e, "Unable to import: " + e.getMessage()); } } }); cancelButton = new JButton("Cancel"); cancelButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { if (confirmClose()) { dispose(); } } }); updateImportButton(); }
From source file:net.sourceforge.msscodefactory.cfcrm.v2_0.CFCrmSwing.CFCrmSwingURLProtocolFinderJPanel.java
public CFCrmSwingURLProtocolFinderJPanel(ICFCrmSwingSchema argSchema) { super();/*from w ww. j a v a 2 s . c o m*/ 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; }
From source file:net.sourceforge.msscodefactory.cfinternet.v2_0.CFInternetSwing.null.java
public CFInternetSwingSecAppPickerJPanel(ICFInternetSwingSchema argSchema, ICFInternetSecAppObj argFocus, ICFInternetClusterObj argContainer, Collection<ICFInternetSecAppObj> argDataCollection, ICFInternetSwingSecAppChosen whenChosen) { super();// ww w.j a v a 2 s . co m 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 ActionChooseSelectedSecApp(); 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(); setSwingFocusAsSecApp(argFocus); }
From source file:net.sourceforge.msscodefactory.cfgcash.v2_0.CFGCashSwing.CFGCashSwingISOCountryCurrencyPickerJPanel.java
public CFGCashSwingISOCountryCurrencyPickerJPanel(ICFGCashSwingSchema argSchema, ICFGCashISOCountryCurrencyObj argFocus, ICFGCashISOCountryObj argContainer, Collection<ICFGCashISOCountryCurrencyObj> argDataCollection, ICFGCashSwingISOCountryCurrencyChosen whenChosen) { super();// ww w . jav a 2 s . c o m 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 ActionChooseSelectedISOCountryCurrency(); 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(); setSwingFocusAsISOCountryCurrency(argFocus); }
From source file:net.sourceforge.msscodefactory.cfasterisk.v2_4.CFAsteriskSwing.CFAsteriskSwingVersionPickerJPanel.java
public CFAsteriskSwingVersionPickerJPanel(ICFAsteriskSwingSchema argSchema, ICFInternetVersionObj argFocus, ICFLibAnyObj argContainer, Collection<ICFInternetVersionObj> argDataCollection, ICFAsteriskSwingVersionChosen whenChosen) { super();/* w ww . j a va 2 s . c o m*/ 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 ActionChooseSelectedVersion(); 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(); setSwingFocusAsVersion(argFocus); }
From source file:net.sourceforge.msscodefactory.cfensyntax.v2_1.CFEnSyntaxSwing.CFEnSyntaxSwingISOCountryCurrencyPickerJPanel.java
public CFEnSyntaxSwingISOCountryCurrencyPickerJPanel(ICFEnSyntaxSwingSchema argSchema, ICFEnSyntaxISOCountryCurrencyObj argFocus, ICFEnSyntaxISOCountryObj argContainer, Collection<ICFEnSyntaxISOCountryCurrencyObj> argDataCollection, ICFEnSyntaxSwingISOCountryCurrencyChosen whenChosen) { super();// ww w .j a v a 2s . co m 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 ActionChooseSelectedISOCountryCurrency(); 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(); setSwingFocusAsISOCountryCurrency(argFocus); }
From source file:net.sourceforge.msscodefactory.cfensyntax.v2_1.CFEnSyntaxSwing.CFEnSyntaxSwingISOCountryLanguagePickerJPanel.java
public CFEnSyntaxSwingISOCountryLanguagePickerJPanel(ICFEnSyntaxSwingSchema argSchema, ICFEnSyntaxISOCountryLanguageObj argFocus, ICFEnSyntaxISOCountryObj argContainer, Collection<ICFEnSyntaxISOCountryLanguageObj> argDataCollection, ICFEnSyntaxSwingISOCountryLanguageChosen whenChosen) { super();/* w w w . j a v a2 s.co m*/ 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 ActionChooseSelectedISOCountryLanguage(); 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(); setSwingFocusAsISOCountryLanguage(argFocus); }
From source file:net.sourceforge.msscodefactory.cfinternet.v2_0.CFInternetSwing.null.java
public CFInternetSwingSecFormPickerJPanel(ICFInternetSwingSchema argSchema, ICFInternetSecFormObj argFocus, ICFInternetSecAppObj argContainer, Collection<ICFInternetSecFormObj> argDataCollection, ICFInternetSwingSecFormChosen whenChosen) { super();// w ww . j a va 2 s.c o m 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 ActionChooseSelectedSecForm(); 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(); setSwingFocusAsSecForm(argFocus); }
From source file:net.sourceforge.msscodefactory.cfasterisk.v2_4.CFAsteriskSwing.CFAsteriskSwingSecGroupPickerJPanel.java
public CFAsteriskSwingSecGroupPickerJPanel(ICFAsteriskSwingSchema argSchema, ICFSecuritySecGroupObj argFocus, ICFSecurityClusterObj argContainer, Collection<ICFSecuritySecGroupObj> argDataCollection, ICFAsteriskSwingSecGroupChosen whenChosen) { super();//from w w w . jav a 2 s . c om 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 ActionChooseSelectedSecGroup(); 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(); setSwingFocusAsSecGroup(argFocus); }
From source file:net.sourceforge.msscodefactory.cfasterisk.v2_4.CFAsteriskSwing.CFAsteriskSwingDomainBasePickerJPanel.java
public CFAsteriskSwingDomainBasePickerJPanel(ICFAsteriskSwingSchema argSchema, ICFInternetDomainBaseObj argFocus, ICFLibAnyObj argContainer, Collection<ICFInternetDomainBaseObj> argDataCollection, ICFAsteriskSwingDomainBaseChosen whenChosen) { super();/*from ww w . j av a2s .c o m*/ 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 ActionChooseSelectedDomainBase(); 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(); setSwingFocusAsDomainBase(argFocus); }