Interface ListColumnAction<I,V>
- All Superinterfaces:
Action
,DynamicActionAttributes
- All Known Implementing Classes:
AbstractListColumnBean
,AnyLinkColumn
,PropertyPathActionFactory.PropertyPathAction
,RelatedItemAnnotationColumn
,RelatedItemColumn
,RelatedItemErrorColumn
,RelatedItemExtensionColumn
,RelatedItemListColumn
,RelatedItemMultiHopColumn
,RelatedItemPropertyColumn
Action that inserts a new column into a table listing. The action is used multiple
times while generating the table. The first use is creating a column definition.
This uses the id, title, value type, properties, sortable and filterable flags,
formatter, etc. Then, for each row in the table, the
getValue(DbControl, Object)
is used to get the actual value that should be displayed in the table. If
a formatter has been defined, it is used to format the value, otherwise
the Object.toString()
method is used.- Since:
- 3.2
- Author:
- Nicklas
- Last modified
- $Date$
-
Method Summary
Modifier and TypeMethodDescriptiondefault String
Optional extra classes to add to table cell (td) tags for this column.default String
Optional extra style definition to add to table cell (td) tags for this column.getClazz()
Optional HTML class attribute that is used to style the column through CSS.default Formatter<Collection<? super V>>
Get a formatter that is intended to format a collection of values that have been retrieved from this action.default boolean
If set, text overflow check is disabled for this column.default Iterator<DynamicActionAttribute>
Get extra attributes that will be outputted in the HTML for the list column.Get an enumeration of possible values that can be found in the column.Get a formatter that converts the exported value to a string that is written to the file.Override the default property when this column is used for exporting.default String
Alternative column title that should be used when exporting data from a table.getExportValue
(DbControl dc, I item) Get the value that should be used when exporting to a file.default String
Extra CSS class to add to the filter table cell.Override the default property when this column is used for filtering.default String
A text to display in the filter cell when the column is not filterable.Get a formatter that converts the current value to a string that is displayed in the column.getId()
ID attribute of the column.The property name for referencing data in the column.Override the default property when this column is used for sorting.getStyle()
Optional HTML style attribute that is used to style the column through CSS.default String
An optional subtitle.getTitle()
The column title.An optional tooltip that is displayed when the mouse is over the column header.Get the value that should be displayed in the column.The data type of the values that are referenced by the property.boolean
A flag to indicate if it is possible to export this column with the generic table exporter or not.boolean
A flag to indicate if filtering on this column is enabled or not.boolean
A flag to indicate if sorting by this column is enabled for not.
-
Method Details
-
getId
String getId()ID attribute of the column. This is requried and must be a unique id among all columns in the list. -
getClazz
String getClazz()Optional HTML class attribute that is used to style the column through CSS. -
getStyle
String getStyle()Optional HTML style attribute that is used to style the column through CSS. -
getTitle
String getTitle()The column title. Required. -
getSubtitle
An optional subtitle.- Since:
- 3.18
-
getExportTitle
Alternative column title that should be used when exporting data from a table. The default implementation return the regular column title without any HTML markup.- Since:
- 3.19.12
-
getCellClass
Optional extra classes to add to table cell (td) tags for this column.- Since:
- 3.18
-
getCellStyle
Optional extra style definition to add to table cell (td) tags for this column.- Since:
- 3.18
-
getDisableOverflowCheck
default boolean getDisableOverflowCheck()If set, text overflow check is disabled for this column. If not set, the global settings for the logged in user is used.- Since:
- 3.18
-
getTooltip
String getTooltip()An optional tooltip that is displayed when the mouse is over the column header. -
getProperty
String getProperty()The property name for referencing data in the column. This is optional but is needed to enable filtering, sorting and/or exporting.- Returns:
- The property or null
-
getValueType
Type getValueType()The data type of the values that are referenced by the property. Required if a property has been set.- Returns:
- The data type of the values
-
isSortable
boolean isSortable()A flag to indicate if sorting by this column is enabled for not. The sort uses the default property unless it has been overridden bygetSortProperty()
.- Returns:
- TRUE to enable sorting, FALSE to disable
-
getSortProperty
String getSortProperty()Override the default property when this column is used for sorting.- Returns:
- NULL if the default property should be used for sorting
-
isFilterable
boolean isFilterable()A flag to indicate if filtering on this column is enabled or not. The filter uses the default property unless it has been overridden bygetFilterProperty()
.- Returns:
- TRUE to enable filtering, FALSE to disable
-
getFilterProperty
String getFilterProperty()Override the default property when this column is used for filtering.- Returns:
- NULL if the default property should be used for filtering
-
getFilterText
A text to display in the filter cell when the column is not filterable.- Since:
- 3.20
-
getFilterClass
Extra CSS class to add to the filter table cell.- Since:
- 3.20
-
isExportable
boolean isExportable()A flag to indicate if it is possible to export this column with the generic table exporter or not. The export uses the default property unless it has been overridden bygetExportProperty()
.- Returns:
- TRUE to enable exporting, FALSE to disable
-
getExportProperty
String getExportProperty()Override the default property when this column is used for exporting.- Returns:
- NULL if the default property should be used for exporting
-
getExportFormatter
Formatter getExportFormatter()Get a formatter that converts the exported value to a string that is written to the file. TheFormatter.format(Object)
method is called once for every item that is listed in the table.- Returns:
- A formatter, or null to simply use
Object.toString()
-
getExportValue
Get the value that should be used when exporting to a file. This method is called once for every item that is listed in the table. The returned value is then passed to the formatter (if any) that is retrieved fromgetExportFormatter()
.- Parameters:
dc
- An open DbControl than can be used to query the databaseitem
- The current item- Returns:
- The value that should be exported
-
getEnumeration
Enumeration<String,String> getEnumeration()Get an enumeration of possible values that can be found in the column. This is used to generate a filter with a drop-down containing checkboxes for each option. If no enumeration is specified, a default filter input field is used. -
getFormatter
Get a formatter that converts the current value to a string that is displayed in the column. The string may include HTML that is required for proper display. TheFormatter.format(Object)
method is called once for every item that is listed in the table.- Returns:
- A formatter, or null to simply use
Object.toString()
-
getCollectionFormatter
Get a formatter that is intended to format a collection of values that have been retrieved from this action. The default implementation will return a formatter that creates a comma-separated string of the individual values where each value is formatted with the formatter fromgetFormatter()
.- Since:
- 3.19.4
-
getValue
Get the value that should be displayed in the column. This method is called once for every item that is listed in the table. The returned value is then passed to the formatter (if any) that is retrieved fromgetFormatter()
.- Parameters:
dc
- An open DbControl than can be used to query the databaseitem
- The current item- Returns:
- The value that should be displayed
-
getDynamicActionAttributes
Get extra attributes that will be outputted in the HTML for the list column.- Specified by:
getDynamicActionAttributes
in interfaceDynamicActionAttributes
- Returns:
- An iterator or null
- Since:
- 3.20
-