Package docking.widgets.table
Class AbstractDynamicTableColumn<ROW_TYPE,COLUMN_TYPE,DATA_SOURCE>
- java.lang.Object
-
- docking.widgets.table.AbstractDynamicTableColumn<ROW_TYPE,COLUMN_TYPE,DATA_SOURCE>
-
- Type Parameters:
ROW_TYPE
- The row object class supported by this columnCOLUMN_TYPE
- The column object class supported by this columnDATA_SOURCE
- The object class type that will be passed to seegetValue(ROW_TYPE, Settings, DATA_SOURCE, ServiceProvider)
- All Implemented Interfaces:
DynamicTableColumn<ROW_TYPE,COLUMN_TYPE,DATA_SOURCE>
- Direct Known Subclasses:
AbstractDynamicTableColumnStub
,AbstractProgramBasedDynamicTableColumn
,DynamicTableColumnExtensionPoint
,MappedTableColumn
,ProjectDataColumn
public abstract class AbstractDynamicTableColumn<ROW_TYPE,COLUMN_TYPE,DATA_SOURCE> extends java.lang.Object implements DynamicTableColumn<ROW_TYPE,COLUMN_TYPE,DATA_SOURCE>
An Table Column is an interface that should be implemented by each class that provides a field (column) of an object based table (each row relates to a particular type of object). It determines the appropriate cell object for use by the table column this field represents. It can then return the appropriate object to display in the table cell for the indicated row object. Implementations of this interface must provide a public default constructor.
-
-
Field Summary
Fields Modifier and Type Field Description protected static FloatingPointPrecisionSettingsDefinition
FLOATING_POINT_PRECISION_SETTING
protected static SettingsDefinition[]
FLOATING_POINT_SETTINGS_DEFINITIONS
protected static FormatSettingsDefinition
INTEGER_RADIX_SETTING
protected static SettingsDefinition[]
INTEGER_SETTINGS_DEFINITIONS
protected static IntegerSignednessFormattingModeSettingsDefinition
INTEGER_SIGNEDNESS_MODE_SETTING
static SettingsDefinition[]
NO_SETTINGS_DEFINITIONS
-
Constructor Summary
Constructors Modifier Constructor Description AbstractDynamicTableColumn()
protected
AbstractDynamicTableColumn(java.lang.String identifier)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
java.lang.Class<COLUMN_TYPE>
getColumnClass()
Determines the class of object that is associated with this field (column).java.lang.String
getColumnDescription()
Returns a description of this column.java.lang.String
getColumnDisplayName(Settings settings)
Determines the column heading that will be displayed.abstract java.lang.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.java.util.Comparator<COLUMN_TYPE>
getComparator()
If implemented, will return a comparator that knows how to sort values for this column.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.java.lang.Class<ROW_TYPE>
getSupportedRowType()
Returns the single class type of the data that this table field can use to generate columnar data.java.lang.String
getUniqueIdentifier()
Returns a value that is unique for this table column.abstract 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.int
hashCode()
java.lang.String
toString()
-
-
-
Field Detail
-
NO_SETTINGS_DEFINITIONS
public static SettingsDefinition[] NO_SETTINGS_DEFINITIONS
-
INTEGER_RADIX_SETTING
protected static final FormatSettingsDefinition INTEGER_RADIX_SETTING
-
INTEGER_SIGNEDNESS_MODE_SETTING
protected static final IntegerSignednessFormattingModeSettingsDefinition INTEGER_SIGNEDNESS_MODE_SETTING
-
FLOATING_POINT_PRECISION_SETTING
protected static final FloatingPointPrecisionSettingsDefinition FLOATING_POINT_PRECISION_SETTING
-
INTEGER_SETTINGS_DEFINITIONS
protected static SettingsDefinition[] INTEGER_SETTINGS_DEFINITIONS
-
FLOATING_POINT_SETTINGS_DEFINITIONS
protected static SettingsDefinition[] FLOATING_POINT_SETTINGS_DEFINITIONS
-
-
Method Detail
-
getColumnName
public abstract java.lang.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 interfaceDynamicTableColumn<ROW_TYPE,COLUMN_TYPE,DATA_SOURCE>
- Returns:
- the field instance name.
-
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 interfaceDynamicTableColumn<ROW_TYPE,COLUMN_TYPE,DATA_SOURCE>
- Returns:
- the preferred width for this column.
-
getComparator
public java.util.Comparator<COLUMN_TYPE> getComparator()
Description copied from interface:DynamicTableColumn
If implemented, will return a comparator that knows how to sort values for this column. Implementors should returnnull
if they do not wish to provider a comparator- Specified by:
getComparator
in interfaceDynamicTableColumn<ROW_TYPE,COLUMN_TYPE,DATA_SOURCE>
- Returns:
- the comparator
-
getColumnClass
public java.lang.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 interfaceDynamicTableColumn<ROW_TYPE,COLUMN_TYPE,DATA_SOURCE>
- Returns:
- the column class
-
getSupportedRowType
public java.lang.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 interfaceDynamicTableColumn<ROW_TYPE,COLUMN_TYPE,DATA_SOURCE>
- Returns:
- the single class type of the data that this table field can use to generate columnar data.
-
getValue
public abstract COLUMN_TYPE getValue(ROW_TYPE rowObject, Settings settings, DATA_SOURCE data, ServiceProvider serviceProvider) throws java.lang.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 interfaceDynamicTableColumn<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
- theServiceProvider
associated with the table.- Returns:
- the object for the model to display in the table cell.
- Throws:
java.lang.IllegalArgumentException
- if the rowObject is not one supported by this class.
-
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
andEnum
s. (This is because the filtering system works naturally with these types.) SeeGColumnRenderer
.- Specified by:
getColumnRenderer
in interfaceDynamicTableColumn<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 interfaceDynamicTableColumn<ROW_TYPE,COLUMN_TYPE,DATA_SOURCE>
- Returns:
- list of settings definitions for this field.
-
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 interfaceDynamicTableColumn<ROW_TYPE,COLUMN_TYPE,DATA_SOURCE>
- Parameters:
settings
- field settings- Returns:
- maximum number of lines needed
-
getColumnDisplayName
public java.lang.String getColumnDisplayName(Settings settings)
Description copied from interface:DynamicTableColumn
Determines the column heading that will be displayed.- Specified by:
getColumnDisplayName
in interfaceDynamicTableColumn<ROW_TYPE,COLUMN_TYPE,DATA_SOURCE>
- Parameters:
settings
- the settings- Returns:
- the field name to display as the column heading.
-
getColumnDescription
public java.lang.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 interfaceDynamicTableColumn<ROW_TYPE,COLUMN_TYPE,DATA_SOURCE>
- Returns:
- a description of this column. This may be used as a tooltip for the column header.
-
equals
public final boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public final int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
getUniqueIdentifier
public final java.lang.String getUniqueIdentifier()
Description copied from interface:DynamicTableColumn
Returns a value that is unique for this table column. This is different than getting the display name, which may be shared by different columns.- Specified by:
getUniqueIdentifier
in interfaceDynamicTableColumn<ROW_TYPE,COLUMN_TYPE,DATA_SOURCE>
- Returns:
- the identifier
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-