net.simplace.pipe.formcomponents.choice.FWFormTableOption
Used by FWTableChoiceSubComponent to store selectable options and their attributes
in a javax.swing.table.TableModel.
This class works different FWFormOption:
- It has no value, because table contains multiple columns (in contrast to the
other choice components); the representing selection value column is defined by
FWTableChoiceSubComponent
- It has no text, because table has not (yet) a leading column to display a row text
- It has no image, because table not (yet) supports image rendering
The reason why this class inherits FWFormOption is to maintain the instances in
FWChoiceFormComponent without any special cases.
There are two ways to construct a FWFormTableOption:
- Specifying XML-Element in constructor: In this case the table column values are
extracted from element children:
.. | children define a FWFormTableOption representing the
column names in table header; the optional type-Attribute can define the (fully qualified)
classname for javax.swing.table.TableModel.getColumnClass(int)
.. | children define a FWFormTableOption representing the
column values for a table row
- Specifying java.sql.ResultSet or java.sql.ResultSetMetaData in constructor: In this case the table
column values are determined from element children:
- java.sql.ResultSetMetaData defines a FWFormTableOption representing the
column names and types in table header
- java.sql.ResultSet defines a FWFormTableOption representing the
column values for a table row
public class FWFormTableOption extends FWFormOption {
// Public Constructors
public FWFormTableOption(String aId, String aText, Element aOptionElem);
public FWFormTableOption(String aId, String aText, ResultSetMetaData
aResultMetaData);
public FWFormTableOption(String aId, String aText, ResultSet aResultSet);
public FWFormTableOption(String aId, String aText, Vector aColNames, Vector
aColTypes);
public FWFormTableOption(String aId, String aText, Vector aColValues);
// Protected Instance Variables
protected boolean iIsHeader;
protected Vector iColValues;
protected Vector iColTypes;
// Public Instance Methods public Vector getColumnTypes();
Returns the column types if {@link #isHeader() is true. For data rows
it returns the specific data types of the individual data object (may
differ from column class!).
returns
// Protected Instance Methods protected void
init(Vector aColValues, Vector aColTypes);
Called by constructor to initializes
net.simplace.pipe.formcomponents.choice.FWFormTableOption "from scratch".
Whether table option represents header or row depends on parameter aColType.
If it is not null a header option is created with specified types. Otherwise
a row option is created (types are determines from values).
}
Hierarchy: java.lang.Object - FWFormOption - FWFormTableOption
Returned by: FWTableChoiceSubComponent.FWTableModel.getHeaderOption(), FWTableChoiceSubComponent.FWTableModel.getRowOption()
Type of: FWTableChoiceSubComponent.FWTableModel.iHeadOption