Interface ListColumnAction<I,​V>

All Superinterfaces:
Action
All Known Implementing Classes:
AbstractListColumnBean, AnyLinkColumn, PropertyPathActionFactory.PropertyPathAction, RelatedItemAnnotationColumn, RelatedItemColumn, RelatedItemListColumn, RelatedItemPropertyColumn

public interface ListColumnAction<I,​V>
extends Action
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 Type Method Description
    default String getCellClass()
    Optional extra classes to add to table cell (td) tags for this column.
    default String getCellStyle()
    Optional extra style definition to add to table cell (td) tags for this column.
    String getClazz()
    Optional HTML class attribute that is used to style the column through CSS.
    default boolean getDisableOverflowCheck()
    If set, text overflow check is disabled for this column.
    Enumeration<String,​String> getEnumeration()
    Get an enumeration of possible values that can be found in the column.
    Formatter getExportFormatter()
    Get a formatter that converts the exported value to a string that is written to the file.
    String getExportProperty()
    Override the default property when this column is used for exporting.
    Object getExportValue​(DbControl dc, I item)
    Get the value that should be used when exporting to a file.
    String getFilterProperty()
    Override the default property when this column is used for filtering.
    Formatter<? super V> getFormatter()
    Get a formatter that converts the current value to a string that is displayed in the column.
    String getId()
    ID attribute of the column.
    String getProperty()
    The property name for referencing data in the column.
    String getSortProperty()
    Override the default property when this column is used for sorting.
    String getStyle()
    Optional HTML style attribute that is used to style the column through CSS.
    default String getSubtitle()
    An optional subtitle.
    String getTitle()
    The column title.
    String getTooltip()
    An optional tooltip that is displayed when the mouse is over the column header.
    V getValue​(DbControl dc, I item)
    Get the value that should be displayed in the column.
    Type getValueType()
    The data type of the values that are referenced by the property.
    boolean isExportable()
    A flag to indicate if it is possible to export this column with the generic table exporter or not.
    boolean isFilterable()
    A flag to indicate if filtering on this column is enabled or not.
    boolean isSortable()
    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

      default String getSubtitle()
      An optional subtitle.
      Since:
      3.18
    • getCellClass

      default String getCellClass()
      Optional extra classes to add to table cell (td) tags for this column.
      Since:
      3.18
    • getCellStyle

      default String 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 by getSortProperty().
      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 by getFilterProperty().
      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
    • 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 by getExportProperty().
      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. The Formatter.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

      Object getExportValue​(DbControl dc, I item)
      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 from getExportFormatter().
      Parameters:
      dc - An open DbControl than can be used to query the database
      item - 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

      Formatter<? super V> 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. The Formatter.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()
    • getValue

      V getValue​(DbControl dc, I item)
      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 from getFormatter().
      Parameters:
      dc - An open DbControl than can be used to query the database
      item - The current item
      Returns:
      The value that should be displayed