Class FWFormTableOption
java.lang.Object
net.simplace.pipe.formcomponents.choice.FWFormOption
net.simplace.pipe.formcomponents.choice.FWFormTableOption
Used by
FWTableChoiceSubComponent to store selectable options and their attributes
in a 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
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:
<th>..</th>children define aFWFormTableOptionrepresenting the column names in table header; the optional type-Attribute can define the (fully qualified) classname forTableModel.getColumnClass(int)<td>..</td>children define aFWFormTableOptionrepresenting the column values for a table row
- Specifying
ResultSetorResultSetMetaDatain constructor: In this case the table column values are determined from element children:ResultSetMetaDatadefines aFWFormTableOptionrepresenting the column names and types in table headerResultSetdefines aFWFormTableOptionrepresenting the column values for a table row
- Author:
- Martin Schmitz
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionFWFormTableOption(String aId, String aText, ResultSet aResultSet) Creates a table rowFWFormTableOptionfrom SQL Result.FWFormTableOption(String aId, String aText, ResultSetMetaData aResultMetaData) Creates a table headerFWFormTableOptionfrom SQL Result.FWFormTableOption(String aId, String aText, Vector<Object> aColValues) Creates a table rowFWFormTableOption"from scratch".Creates a table headerFWFormTableOption"from scratch".FWFormTableOption(String aId, String aText, org.jdom2.Element aOptionElem) Creates aFWFormTableOptionfrom XML-Element. -
Method Summary
Modifier and TypeMethodDescriptionReturns the column values or the column names (depending onisHeader().protected voidCalled by constructor to initializesFWFormTableOptionas table row fromResultSet.protected voidinit(ResultSetMetaData aResultMetaData) Called by constructor to initializesFWFormTableOptionas table header fromResultSetMetaData.protected voidCalled by constructor to initializesFWFormTableOption"from scratch".protected voidinit(org.jdom2.Element aColDef) Called by constructor to initializesFWFormTableOptionfrom XML-Element.booleanisHeader()Returns whether theFWFormTableOptionrepresents the table header (TRUE) or a table row (FALSE).voidAlways throwsUnsupportedOperationException(unlessaImageis notnull) becauseFWFormTableOptiondoes not yet support images.
-
Field Details
-
Constructor Details
-
FWFormTableOption
Creates aFWFormTableOptionfrom XML-Element. Weather it represents table header or row depends on theElement(see class documentation).- Parameters:
aId- id-attribute of the optionaText- translated display text of the option (NOT yet used byFWTableChoiceSubComponent!)aOptionElem- complete
-
FWFormTableOption
Creates a table headerFWFormTableOptionfrom SQL Result.- Parameters:
aId- id-attribute of the optionaText- translated display text of the option (NOT yet used byFWTableChoiceSubComponent!)aResultMetaData- meta data fromStatement
-
FWFormTableOption
Creates a table rowFWFormTableOptionfrom SQL Result.- Parameters:
aId- id-attribute of the optionaText- translated display text of the option (NOT yet used byFWTableChoiceSubComponent!)aResultSet- result fromStatement
-
FWFormTableOption
public FWFormTableOption(String aId, String aText, Vector<Object> aColNames, Vector<Class<?>> aColTypes) Creates a table headerFWFormTableOption"from scratch".- Parameters:
aId- id-attribute of the optionaText- translated display text of the option (NOT yet used byFWTableChoiceSubComponent!)aColNames- list of column namesaColTypes- list of column types
-
FWFormTableOption
Creates a table rowFWFormTableOption"from scratch".- Parameters:
aId- id-attribute of the optionaText- translated display text of the option (NOT yet used byFWTableChoiceSubComponent!)aColValues-aColNames- list of column values
-
-
Method Details
-
init
protected void init(org.jdom2.Element aColDef) Called by constructor to initializesFWFormTableOptionfrom XML-Element.- Parameters:
aColDef-
-
init
Called by constructor to initializesFWFormTableOptionas table header fromResultSetMetaData.- Parameters:
aResultMetaData-
-
init
Called by constructor to initializesFWFormTableOptionas table row fromResultSet.- Parameters:
aResultSet-
-
init
Called by constructor to initializesFWFormTableOption"from scratch". Whether table option represents header or row depends on parameteraColType. If it is notnulla header option is created with specified types. Otherwise a row option is created (types are determines from values).- Parameters:
aColValues-aColTypes-
-
setImage
Always throwsUnsupportedOperationException(unlessaImageis notnull) becauseFWFormTableOptiondoes not yet support images.- Overrides:
setImagein classFWFormOption
-
isHeader
public boolean isHeader()Returns whether theFWFormTableOptionrepresents the table header (TRUE) or a table row (FALSE).- Returns:
-
getColumnValues
Returns the column values or the column names (depending onisHeader().- Returns:
-
getColumnTypes
Returns the column types ifis true. For data rows it returns the specific data types of the individual data object (may differ from column class!).- Returns:
-