Class MappedTableColumn<ROW_TYPE, EXPECTED_ROW_TYPE, COLUMN_TYPE, DATA_SOURCE>
- Type Parameters:
ROW_TYPE- The table's actual row typeEXPECTED_ROW_TYPE- The row type expected by the givenDynamicTableColumnCOLUMN_TYPE- The column type provided by the givenDynamicTableColumnDATA_SOURCE- the type of the data for each column; can be Object for columns that do not have a data source
- All Implemented Interfaces:
DynamicTableColumn<ROW_TYPE, COLUMN_TYPE, DATA_SOURCE>
- Direct Known Subclasses:
MappedProgramLocationTableColumn, ProgramMappedTableColumn
DynamicTableColumns
when the actual row type of the table is not the same as the row type that the
DynamicTableColumn supports.-
Field Summary
FieldsChangeModifier and TypeFieldDescriptionprotected final TableRowMapper<ROW_TYPE, EXPECTED_ROW_TYPE, DATA_SOURCE> protected final DynamicTableColumn<EXPECTED_ROW_TYPE, COLUMN_TYPE, DATA_SOURCE> -
Constructor Summary
ConstructorsChangeModifierConstructorDescriptionprotectedMappedTableColumn(TableRowMapper<ROW_TYPE, EXPECTED_ROW_TYPE, DATA_SOURCE> mapper, DynamicTableColumn<EXPECTED_ROW_TYPE, COLUMN_TYPE, DATA_SOURCE> tableColumn) protectedMappedTableColumn(TableRowMapper<ROW_TYPE, EXPECTED_ROW_TYPE, DATA_SOURCE> mapper, DynamicTableColumn<EXPECTED_ROW_TYPE, COLUMN_TYPE, DATA_SOURCE> tableColumn, String uniqueIdentifier) -
Method Summary
ChangeModifier and TypeMethodDescriptionDetermines the class of object that is associated with this field (column).Returns a description of this column. This may be used as a tooltip for the column header.getColumnDisplayName(Settings settings) Determines the column heading that will be displayed.Returns the optional cell editor for this column; null if no custom editor is used.intReturns the maximum width for this column.intReturns the minimum width for this column.Determines the unique column heading that may be used to identify a column instance.intReturns the preferred width for this column.Returns the optional cell renderer for this column; null if no renderer is used.getComparator(DynamicColumnTableModel<?> model, int columnIndex) If implemented, will return a comparator that knows how to sort values for this column.Returns the optional header renderer for this column; null if no renderer is used.Class<?> Returns the class of the column that this mapper wrapsintgetMaxLines(Settings settings) Returns the maximum number of text display lines needed for any given cell with the specified settings.Returns a list of settings definitions for this field.Returns the single class type of the data that this table field can use to generate columnar data..getValue(ROW_TYPE rowObject, Settings settings, DATA_SOURCE data, ServiceProvider serviceProvider) Creates an object that is appropriate for this field (table column) and for the object that is associated with this row of the table.map(ROW_TYPE rowObject, DATA_SOURCE data, ServiceProvider serviceProvider) toString()Methods inherited from class AbstractDynamicTableColumn
equals, getComparator, getUniqueIdentifier, hashCode
-
Field Details
-
mapper
-
tableColumn
-
-
Constructor Details
-
MappedTableColumn
protected MappedTableColumn(TableRowMapper<ROW_TYPE, EXPECTED_ROW_TYPE, DATA_SOURCE> mapper, DynamicTableColumn<EXPECTED_ROW_TYPE, COLUMN_TYPE, DATA_SOURCE> tableColumn) -
MappedTableColumn
protected MappedTableColumn(TableRowMapper<ROW_TYPE, EXPECTED_ROW_TYPE, DATA_SOURCE> mapper, DynamicTableColumn<EXPECTED_ROW_TYPE, COLUMN_TYPE, DATA_SOURCE> tableColumn, String uniqueIdentifier)
-
-
Method Details
-
getMappedColumnClass
Returns the class of the column that this mapper wraps- Returns:
- the class of the column that this mapper wraps
-
getColumnClass
Description copied from interface:DynamicTableColumnDetermines the class of object that is associated with this field (column).- Specified by:
getColumnClassin interfaceDynamicTableColumn<ROW_TYPE, EXPECTED_ROW_TYPE, COLUMN_TYPE>- Overrides:
getColumnClassin classAbstractDynamicTableColumn<ROW_TYPE, COLUMN_TYPE, DATA_SOURCE>- Returns:
- the column class
-
getSupportedRowType
Description copied from interface:DynamicTableColumnReturns the single class type of the data that this table field can use to generate columnar data..- Specified by:
getSupportedRowTypein interfaceDynamicTableColumn<ROW_TYPE, EXPECTED_ROW_TYPE, COLUMN_TYPE>- Overrides:
getSupportedRowTypein classAbstractDynamicTableColumn<ROW_TYPE, COLUMN_TYPE, DATA_SOURCE>- Returns:
- the single class type of the data that this table field can use to generate columnar data.
-
getColumnDisplayName
Description copied from interface:DynamicTableColumnDetermines the column heading that will be displayed.- Specified by:
getColumnDisplayNamein interfaceDynamicTableColumn<ROW_TYPE, EXPECTED_ROW_TYPE, COLUMN_TYPE>- Overrides:
getColumnDisplayNamein classAbstractDynamicTableColumn<ROW_TYPE, COLUMN_TYPE, DATA_SOURCE>- Parameters:
settings- the settings- Returns:
- the field name to display as the column heading.
-
getColumnDescription
Description copied from interface:DynamicTableColumnReturns a description of this column. This may be used as a tooltip for the column header.- Specified by:
getColumnDescriptionin interfaceDynamicTableColumn<ROW_TYPE, EXPECTED_ROW_TYPE, COLUMN_TYPE>- Overrides:
getColumnDescriptionin classAbstractDynamicTableColumn<ROW_TYPE, COLUMN_TYPE, DATA_SOURCE>- Returns:
- a description of this column. This may be used as a tooltip for the column header
-
getColumnName
Description copied from interface:DynamicTableColumnDetermines the unique column heading that may be used to identify a column instance.This name must be non-changing and is used to save/restore state information.
- Specified by:
getColumnNamein interfaceDynamicTableColumn<ROW_TYPE, EXPECTED_ROW_TYPE, COLUMN_TYPE>- Specified by:
getColumnNamein classAbstractDynamicTableColumn<ROW_TYPE, COLUMN_TYPE, DATA_SOURCE>- Returns:
- the field instance name.
-
getMaxLines
Description copied from interface:DynamicTableColumnReturns the maximum number of text display lines needed for any given cell with the specified settings.- Specified by:
getMaxLinesin interfaceDynamicTableColumn<ROW_TYPE, EXPECTED_ROW_TYPE, COLUMN_TYPE>- Overrides:
getMaxLinesin classAbstractDynamicTableColumn<ROW_TYPE, COLUMN_TYPE, DATA_SOURCE>- Parameters:
settings- field settings- Returns:
- the maximum number of text display lines needed for any given cell with the specified settings
-
getColumnRenderer
Description copied from interface:DynamicTableColumnReturns the optional cell renderer for this column; null if no renderer is used.This method allows columns to define custom rendering. The interface returned here ensures that the text used for filtering matches what the users sees (via the
GColumnRenderer.getFilterString(Object, Settings)method).Note: some types should not make use of the aforementioned filter string. These types include the
Numberwrapper types,DateandEnums. (This is because the filtering system works naturally with these types.) SeeGColumnRenderer.- Specified by:
getColumnRendererin interfaceDynamicTableColumn<ROW_TYPE, EXPECTED_ROW_TYPE, COLUMN_TYPE>- Overrides:
getColumnRendererin classAbstractDynamicTableColumn<ROW_TYPE, COLUMN_TYPE, DATA_SOURCE>- Returns:
- the optional cell renderer for this column; null if no renderer is used
-
getColumnEditor NEW
Description copied from interface:DynamicTableColumnReturns the optional cell editor for this column; null if no custom editor is used.- Specified by:
getColumnEditorin interfaceDynamicTableColumn<ROW_TYPE, EXPECTED_ROW_TYPE, COLUMN_TYPE>- Overrides:
getColumnEditorin classAbstractDynamicTableColumn<ROW_TYPE, COLUMN_TYPE, DATA_SOURCE>- Returns:
- the optional cell editor for this column; null if no custom editor is used
-
getHeaderRenderer
Description copied from interface:DynamicTableColumnReturns the optional header renderer for this column; null if no renderer is used.This method allows columns to define custom header rendering.
- Specified by:
getHeaderRendererin interfaceDynamicTableColumn<ROW_TYPE, EXPECTED_ROW_TYPE, COLUMN_TYPE>- Overrides:
getHeaderRendererin classAbstractDynamicTableColumn<ROW_TYPE, COLUMN_TYPE, DATA_SOURCE>- Returns:
- the optional header renderer for this column; null if no renderer is used
-
getSettingsDefinitions
Description copied from interface:DynamicTableColumnReturns a list of settings definitions for this field.- Specified by:
getSettingsDefinitionsin interfaceDynamicTableColumn<ROW_TYPE, EXPECTED_ROW_TYPE, COLUMN_TYPE>- Overrides:
getSettingsDefinitionsin classAbstractDynamicTableColumn<ROW_TYPE, COLUMN_TYPE, DATA_SOURCE>- Returns:
- a list of settings definitions for this field
-
getColumnPreferredWidth
public int getColumnPreferredWidth()Description copied from interface:DynamicTableColumnReturns the preferred width for this column.Column should either return a valid positive preferred size or -1
- Specified by:
getColumnPreferredWidthin interfaceDynamicTableColumn<ROW_TYPE, EXPECTED_ROW_TYPE, COLUMN_TYPE>- Overrides:
getColumnPreferredWidthin classAbstractDynamicTableColumn<ROW_TYPE, COLUMN_TYPE, DATA_SOURCE>- Returns:
- the preferred width for this column
-
getColumnMaxWidth NEW
public int getColumnMaxWidth()Description copied from interface:DynamicTableColumnReturns the maximum width for this column.Column should either return a valid positive maximum size or -1
- Specified by:
getColumnMaxWidthin interfaceDynamicTableColumn<ROW_TYPE, EXPECTED_ROW_TYPE, COLUMN_TYPE>- Overrides:
getColumnMaxWidthin classAbstractDynamicTableColumn<ROW_TYPE, COLUMN_TYPE, DATA_SOURCE>- Returns:
- the maximum width for this column
-
getColumnMinWidth NEW
public int getColumnMinWidth()Description copied from interface:DynamicTableColumnReturns the minimum width for this column.Column should either return a valid positive minimum size or -1
- Specified by:
getColumnMinWidthin interfaceDynamicTableColumn<ROW_TYPE, EXPECTED_ROW_TYPE, COLUMN_TYPE>- Overrides:
getColumnMinWidthin classAbstractDynamicTableColumn<ROW_TYPE, COLUMN_TYPE, DATA_SOURCE>- Returns:
- the minimum width for this column
-
getComparator
Description copied from interface:DynamicTableColumnIf implemented, will return a comparator that knows how to sort values for this column. Implementors should returnnullif they do not wish to provider a comparator- Specified by:
getComparatorin interfaceDynamicTableColumn<ROW_TYPE, EXPECTED_ROW_TYPE, COLUMN_TYPE>- Overrides:
getComparatorin classAbstractDynamicTableColumn<ROW_TYPE, COLUMN_TYPE, DATA_SOURCE>- Parameters:
model- the table modelcolumnIndex- the model column index- Returns:
- the comparator
-
getValue
public COLUMN_TYPE getValue(ROW_TYPE rowObject, Settings settings, DATA_SOURCE data, ServiceProvider serviceProvider) throws IllegalArgumentException Description copied from interface:DynamicTableColumnCreates an object that is appropriate for this field (table column) and for the object that is associated with this row of the table.- Specified by:
getValuein interfaceDynamicTableColumn<ROW_TYPE, EXPECTED_ROW_TYPE, COLUMN_TYPE>- Specified by:
getValuein classAbstractDynamicTableColumn<ROW_TYPE, COLUMN_TYPE, DATA_SOURCE>- Parameters:
rowObject- the object associated with the row in the table.settings- field settingsdata- the expected data object, as defined by the DATA_SOURCE typeserviceProvider- theServiceProviderassociated with the table.- Returns:
- the object for the model to display in the table cell.
- Throws:
IllegalArgumentException- if the rowObject is not one supported by this class.
-
map
-
toString
- Overrides:
toStringin classAbstractDynamicTableColumn<ROW_TYPE, COLUMN_TYPE, DATA_SOURCE>
-