net.simplace.pipe.formcomponents.choice.FWTableChoiceSubComponent
This class is used to visualize a FWChoiceFormComponent of type "table".
Each table row represents a choice value. The parameter "selectionColIdx" determines
from which table column the choice value is taken (Default: 0 = first column).
Like for FWListChoiceSubComponent multi selection is possible. In this case
- An extra checkbox column is added to the table (using de.schmitzm.swing.table.SelectionTableModel),
so that it is not necessary to hold Strg-Key to select individual table rows.
- The choice return value holds a separated concatenation of the selection column
value of each row. The separator can be specified in the "multiselect_seperator"
parameter (Default: comma).
An apostrophe can be places additionally to the parameter "multiselect_seperator"
to indicate that the concatenated values are masked with apostrophe.
- If "sql_where_param" parameter is set, the choice return value is constructed
as an SQL condition with OR-concatenation.
Restrictions:
- The attribute "showAll" is not yet supported. The table is always placed
in javax.swing.JScrollPane.
public class FWTableChoiceSubComponent extends
net.simplace.pipe.formcomponents.FWAbstractFormSubComponent implements
javax.swing.event.ListSelectionListener {
// Public Constructors
public FWTableChoiceSubComponent(Vector aOptions, boolean aMultiSelect,
boolean aRequired, boolean aIsEnabled, boolean aShowAll, FWObservable
aObservable, Map aFormComponentParameterMap, String aDefaultValueID,
String aChoiceFieldId);
// Protected Instance Variables
protected SortableJTable iTable;
protected FWTableChoiceSubComponent.FWTableModel iTableModel;
protected boolean iIsMultiSelect;
protected boolean iIsRequired;
protected boolean iShowAll;
protected int iSelectionColIdx;
protected String iWhereFormParam;
protected String iMultiselectSeperatorParam;
protected boolean iUseApostroph;
protected String iChoiceFieldId;
// Public Instance Methods public Dimension getPreferredSize(); // Defines javax.swing.JComponent
Returns the preferred size for the sub component. If the table is smaller than the
preferred scroll pane size, then the table's size is returned (+ table header size).
public void
setValue(String aValues);
// Defines
net.simplace.pipe.formcomponents.FWAbstractFormSubComponent
Sets the table selection by value. Multiple values can be specified
as comma-separated list of values.
If no table row with a value to select (in selection column) can
be identified, the specified value(s) are used as option ids to
define a selection.
Note: If multiple table rows contain the same value in the selection
column, only the FIRST row is selected (even in multi selection mode!)
public void setSelectedIDs(String aIds);
Sets the table selection by option id. Multiple option ids can be
specified as comma-separated list.
public void
updateTable(Vector aFormOptionVector);
Updates the choice list
- aFormOptionVector Vector of niew FormOptions
public void valueChanged(ListSelectionEvent e);
// From javax.swing.event.ListSelectionListener
Notifies the parent component whenever the value (selection) of this component changes
// Inner Classes
protected class FWTableChoiceSubComponent.FWTableModel extends
javax.swing.table.AbstractTableModel
}
Hierarchy: java.lang.Object - java.awt.Component (java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable) - java.awt.Container - javax.swing.JComponent (java.io.Serializable, javax.swing.TransferHandler.HasGetTransferHandler) - javax.swing.JPanel (javax.accessibility.Accessible) - net.simplace.pipe.formcomponents.FWAbstractFormSubComponent - FWTableChoiceSubComponent (javax.swing.event.ListSelectionListener)