Interface ListColumnAction<I,V>

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

public interface ListColumnAction<I,V> extends Action, DynamicActionAttributes
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 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
    • getExportTitle

      default String 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

      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
    • getFilterText

      default String getFilterText()
      A text to display in the filter cell when the column is not filterable.
      Since:
      3.20
    • getFilterClass

      default String 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 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()
    • getCollectionFormatter

      default Formatter<Collection<? super V>> 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 from getFormatter().
      Since:
      3.19.4
    • 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
    • getDynamicActionAttributes

      default Iterator<DynamicActionAttribute> getDynamicActionAttributes()
      Get extra attributes that will be outputted in the HTML for the list column.
      Specified by:
      getDynamicActionAttributes in interface DynamicActionAttributes
      Returns:
      An iterator or null
      Since:
      3.20