Package docking.widgets.table

# Class MappedTableColumn<ROW_TYPE,EXPECTED_ROW_TYPE,COLUMN_TYPE,DATA_SOURCE>

java.lang.Object
docking.widgets.table.AbstractDynamicTableColumn<ROW_TYPE,COLUMN_TYPE,DATA_SOURCE>
docking.widgets.table.MappedTableColumn<ROW_TYPE,EXPECTED_ROW_TYPE,COLUMN_TYPE,DATA_SOURCE>

Type Parameters:
  `ROW_TYPE` - The table's actual row type
  `EXPECTED_ROW_TYPE` - The row type expected by the given `DynamicTableColumn`
  `COLUMN_TYPE` - The column type provided by the given `DynamicTableColumn`
  `DATA_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`

public class MappedTableColumn<ROW_TYPE,EXPECTED_ROW_TYPE,COLUMN_TYPE,DATA_SOURCE> extends AbstractDynamicTableColumn<ROW_TYPE,COLUMN_TYPE,DATA_SOURCE>
A class that is an Adapter in order to allow for the use of existing `DynamicTableColumn`s when the actual row type of the table is not the same as the row type that the `DynamicTableColumn` supports.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected final TableRowMapper<ROW_TYPE,EXPECTED_ROW_TYPE,DATA_SOURCE>`
  `mapper`
  `protected final DynamicTableColumn<EXPECTED_ROW_TYPE,COLUMN_TYPE,DATA_SOURCE>`
  `tableColumn`

  ### Fields inherited from class docking.widgets.table.AbstractDynamicTableColumn

  `FLOATING_POINT_PRECISION_SETTING, FLOATING_POINT_SETTINGS_DEFINITIONS, INTEGER_RADIX_SETTING, INTEGER_SETTINGS_DEFINITIONS, INTEGER_SIGNEDNESS_MODE_SETTING, NO_SETTINGS_DEFINITIONS`

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `MappedTableColumn(TableRowMapper<ROW_TYPE,EXPECTED_ROW_TYPE,DATA_SOURCE> mapper, DynamicTableColumn<EXPECTED_ROW_TYPE,COLUMN_TYPE,DATA_SOURCE> tableColumn)`
  `protected`
  `MappedTableColumn(TableRowMapper<ROW_TYPE,EXPECTED_ROW_TYPE,DATA_SOURCE> mapper, DynamicTableColumn<EXPECTED_ROW_TYPE,COLUMN_TYPE,DATA_SOURCE> tableColumn, String uniqueIdentifier)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Class<COLUMN_TYPE>`
  `getColumnClass()`
  Determines the class of object that is associated with this field (column).
  `String`
  `getColumnDescription()`
  Returns a description of this column.
  `String`
  `getColumnDisplayName(Settings settings)`
  Determines the column heading that will be displayed.
  `String`
  `getColumnName()`
  Determines the unique column heading that may be used to identify a column instance.
  `int`
  `getColumnPreferredWidth()`
  Returns the preferred width for this column.
  `GColumnRenderer<COLUMN_TYPE>`
  `getColumnRenderer()`
  Returns the optional cell renderer for this column; null if no renderer is used.
  `Comparator<COLUMN_TYPE>`
  `getComparator(DynamicColumnTableModel<?> model, int columnIndex)`
  If implemented, will return a comparator that knows how to sort values for this column.
  `GTableHeaderRenderer`
  `getHeaderRenderer()`
  Returns the optional header renderer for this column; null if no renderer is used.
  `Class<?>`
  `getMappedColumnClass()`
  Returns the class of the column that this mapper wraps
  `int`
  `getMaxLines(Settings settings)`
  Gets the maximum number of text display lines needed for any given cell with the specified settings.
  `SettingsDefinition[]`
  `getSettingsDefinitions()`
  Returns a list of settings definitions for this field.
  `Class<ROW_TYPE>`
  `getSupportedRowType()`
  Returns the single class type of the data that this table field can use to generate columnar data.
  `COLUMN_TYPE`
  `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.
  `String`
  `toString()`

  ### Methods inherited from class docking.widgets.table.AbstractDynamicTableColumn

  `equals, getComparator, getUniqueIdentifier, hashCode`

  ### Methods inherited from class java.lang.Object

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## Field Details

  - ### mapper

    protected final TableRowMapper<ROW_TYPE,EXPECTED_ROW_TYPE,DATA_SOURCE> mapper

  - ### tableColumn

    protected final DynamicTableColumn<EXPECTED_ROW_TYPE,COLUMN_TYPE,DATA_SOURCE> 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

    public Class<?> getMappedColumnClass()
    Returns the class of the column that this mapper wraps
    Returns:
      the class of the column that this mapper wraps

  - ### getColumnClass

    public Class<COLUMN_TYPE> getColumnClass()
    Description copied from interface: `DynamicTableColumn`
    Determines the class of object that is associated with this field (column).
    Specified by:
      `getColumnClass` in interface `DynamicTableColumn<ROW_TYPE,EXPECTED_ROW_TYPE,COLUMN_TYPE>`
    Overrides:
      `getColumnClass` in class `AbstractDynamicTableColumn<ROW_TYPE,COLUMN_TYPE,DATA_SOURCE>`
    Returns:
      the column class

  - ### getSupportedRowType

    public Class<ROW_TYPE> getSupportedRowType()
    Description copied from interface: `DynamicTableColumn`
    Returns the single class type of the data that this table field can use to generate columnar data.
    Specified by:
      `getSupportedRowType` in interface `DynamicTableColumn<ROW_TYPE,EXPECTED_ROW_TYPE,COLUMN_TYPE>`
    Overrides:
      `getSupportedRowType` in class `AbstractDynamicTableColumn<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

    public String getColumnDisplayName(Settings settings)
    Description copied from interface: `DynamicTableColumn`
    Determines the column heading that will be displayed.
    Specified by:
      `getColumnDisplayName` in interface `DynamicTableColumn<ROW_TYPE,EXPECTED_ROW_TYPE,COLUMN_TYPE>`
    Overrides:
      `getColumnDisplayName` in class `AbstractDynamicTableColumn<ROW_TYPE,COLUMN_TYPE,DATA_SOURCE>`
    Parameters:
      `settings` - the settings
    Returns:
      the field name to display as the column heading.

  - ### getColumnDescription

    public String getColumnDescription()
    Description copied from interface: `DynamicTableColumn`
    Returns a description of this column. This may be used as a tooltip for the column header
    Specified by:
      `getColumnDescription` in interface `DynamicTableColumn<ROW_TYPE,EXPECTED_ROW_TYPE,COLUMN_TYPE>`
    Overrides:
      `getColumnDescription` in class `AbstractDynamicTableColumn<ROW_TYPE,COLUMN_TYPE,DATA_SOURCE>`
    Returns:
      a description of this column. This may be used as a tooltip for the column header.

  - ### getColumnName

    public String getColumnName()
    Description copied from interface: `DynamicTableColumn`
    Determines 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:
      `getColumnName` in interface `DynamicTableColumn<ROW_TYPE,EXPECTED_ROW_TYPE,COLUMN_TYPE>`
    Specified by:
      `getColumnName` in class `AbstractDynamicTableColumn<ROW_TYPE,COLUMN_TYPE,DATA_SOURCE>`
    Returns:
      the field instance name.

  - ### getMaxLines

    public int getMaxLines(Settings settings)
    Description copied from interface: `DynamicTableColumn`
    Gets the maximum number of text display lines needed for any given cell with the specified settings.
    Specified by:
      `getMaxLines` in interface `DynamicTableColumn<ROW_TYPE,EXPECTED_ROW_TYPE,COLUMN_TYPE>`
    Overrides:
      `getMaxLines` in class `AbstractDynamicTableColumn<ROW_TYPE,COLUMN_TYPE,DATA_SOURCE>`
    Parameters:
      `settings` - field settings
    Returns:
      maximum number of lines needed

  - ### getColumnRenderer

    public GColumnRenderer<COLUMN_TYPE> getColumnRenderer()
    Description copied from interface: `DynamicTableColumn`
    Returns 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 `Number` wrapper types, `Date` and `Enum`s. (This is because the filtering system works naturally with these types.) See `GColumnRenderer`.

    Specified by:
      `getColumnRenderer` in interface `DynamicTableColumn<ROW_TYPE,EXPECTED_ROW_TYPE,COLUMN_TYPE>`
    Overrides:
      `getColumnRenderer` in class `AbstractDynamicTableColumn<ROW_TYPE,COLUMN_TYPE,DATA_SOURCE>`
    Returns:
      the renderer

  - ### getHeaderRenderer

    public GTableHeaderRenderer getHeaderRenderer()
    Description copied from interface: `DynamicTableColumn`
    Returns the optional header renderer for this column; null if no renderer is used.

    This method allows columns to define custom header rendering.

    Specified by:
      `getHeaderRenderer` in interface `DynamicTableColumn<ROW_TYPE,EXPECTED_ROW_TYPE,COLUMN_TYPE>`
    Overrides:
      `getHeaderRenderer` in class `AbstractDynamicTableColumn<ROW_TYPE,COLUMN_TYPE,DATA_SOURCE>`
    Returns:
      the renderer

  - ### getSettingsDefinitions

    public SettingsDefinition[] getSettingsDefinitions()
    Description copied from interface: `DynamicTableColumn`
    Returns a list of settings definitions for this field.
    Specified by:
      `getSettingsDefinitions` in interface `DynamicTableColumn<ROW_TYPE,EXPECTED_ROW_TYPE,COLUMN_TYPE>`
    Overrides:
      `getSettingsDefinitions` in class `AbstractDynamicTableColumn<ROW_TYPE,COLUMN_TYPE,DATA_SOURCE>`
    Returns:
      list of settings definitions for this field.

  - ### getColumnPreferredWidth

    public int getColumnPreferredWidth()
    Description copied from interface: `DynamicTableColumn`
    Returns the preferred width for this column. Column should either return a valid positive preferred size or -1.
    Specified by:
      `getColumnPreferredWidth` in interface `DynamicTableColumn<ROW_TYPE,EXPECTED_ROW_TYPE,COLUMN_TYPE>`
    Overrides:
      `getColumnPreferredWidth` in class `AbstractDynamicTableColumn<ROW_TYPE,COLUMN_TYPE,DATA_SOURCE>`
    Returns:
      the preferred width for this column.

  - ### getComparator

    public Comparator<COLUMN_TYPE> getComparator(DynamicColumnTableModel<?> model, int columnIndex)
    Description copied from interface: `DynamicTableColumn`
    If implemented, will return a comparator that knows how to sort values for this column. Implementors should return `null` if they do not wish to provider a comparator
    Specified by:
      `getComparator` in interface `DynamicTableColumn<ROW_TYPE,EXPECTED_ROW_TYPE,COLUMN_TYPE>`
    Overrides:
      `getComparator` in class `AbstractDynamicTableColumn<ROW_TYPE,COLUMN_TYPE,DATA_SOURCE>`
    Returns:
      the comparator

  - ### getValue

    public COLUMN_TYPE getValue(ROW_TYPE rowObject, Settings settings, DATA_SOURCE data, ServiceProvider serviceProvider) throws IllegalArgumentException
    Description copied from interface: `DynamicTableColumn`
    Creates 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:
      `getValue` in interface `DynamicTableColumn<ROW_TYPE,EXPECTED_ROW_TYPE,COLUMN_TYPE>`
    Specified by:
      `getValue` in class `AbstractDynamicTableColumn<ROW_TYPE,COLUMN_TYPE,DATA_SOURCE>`
    Parameters:
      `rowObject` - the object associated with the row in the table.
      `settings` - field settings
      `data` - the expected data object, as defined by the DATA_SOURCE type
      `serviceProvider` - the `ServiceProvider` associated 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.

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `AbstractDynamicTableColumn<ROW_TYPE,COLUMN_TYPE,DATA_SOURCE>`