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 aFWFormTableOption
representing the column names in table header; the optional type-Attribute can define the (fully qualified) classname forTableModel.getColumnClass(int)
<td>..</td>
children define aFWFormTableOption
representing the column values for a table row
- Specifying
ResultSet
orResultSetMetaData
in constructor: In this case the table column values are determined from element children:ResultSetMetaData
defines aFWFormTableOption
representing the column names and types in table headerResultSet
defines aFWFormTableOption
representing the column values for a table row
- Author:
- Martin Schmitz
-
Field Summary
-
Constructor Summary
ConstructorDescriptionFWFormTableOption
(String aId, String aText, ResultSet aResultSet) Creates a table rowFWFormTableOption
from SQL Result.FWFormTableOption
(String aId, String aText, ResultSetMetaData aResultMetaData) Creates a table headerFWFormTableOption
from 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 aFWFormTableOption
from XML-Element. -
Method Summary
Modifier and TypeMethodDescriptionReturns the column values or the column names (depending onisHeader()
.protected void
Called by constructor to initializesFWFormTableOption
as table row fromResultSet
.protected void
init
(ResultSetMetaData aResultMetaData) Called by constructor to initializesFWFormTableOption
as table header fromResultSetMetaData
.protected void
Called by constructor to initializesFWFormTableOption
"from scratch".protected void
init
(org.jdom2.Element aColDef) Called by constructor to initializesFWFormTableOption
from XML-Element.boolean
isHeader()
Returns whether theFWFormTableOption
represents the table header (TRUE) or a table row (FALSE).void
Always throwsUnsupportedOperationException
(unlessaImage
is notnull
) becauseFWFormTableOption
does not yet support images.
-
Field Details
-
Constructor Details
-
FWFormTableOption
Creates aFWFormTableOption
from 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 headerFWFormTableOption
from 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 rowFWFormTableOption
from 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 initializesFWFormTableOption
from XML-Element.- Parameters:
aColDef
-
-
init
Called by constructor to initializesFWFormTableOption
as table header fromResultSetMetaData
.- Parameters:
aResultMetaData
-
-
init
Called by constructor to initializesFWFormTableOption
as 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 notnull
a header option is created with specified types. Otherwise a row option is created (types are determines from values).- Parameters:
aColValues
-aColTypes
-
-
setImage
Always throwsUnsupportedOperationException
(unlessaImage
is notnull
) becauseFWFormTableOption
does not yet support images.- Overrides:
setImage
in classFWFormOption
-
isHeader
public boolean isHeader()Returns whether theFWFormTableOption
represents 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:
-