Class CmsDataViewFilter

java.lang.Object
org.opencms.widgets.dataview.CmsDataViewFilter

public class CmsDataViewFilter extends Object
Represents a filter to narrow down the list of displayed results.

A filter has a unique id, a set of options (consisting of a map whose keys are internal identifiers of the options and whose values are the texts to display to the user), a current value and a 'nice name' to display as caption for the filter. Filter options don't by default have a "null" (=neutral, i.e. filter is not applied) option; if you need this, add a corresponding option in your implementation of I_CmsDataView.

  • Constructor Details

  • Method Details

    • copy

      Creates a copy of the filter.

      Returns:
      the copied filter
    • copyWithValue

      Creates a copy of the filter, but uses a different filter value for the copy.

      Parameters:
      value - the filter value for the copy
      Returns:
      the copied filter
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object
      See Also:
    • getHelpText

      public String getHelpText()
      Gets the help text for the filter.

      Returns:
      the help text for the filter
    • getId

      public String getId()
      Gets the id of the filter.

      Returns:
      the id of the filter
    • getNiceName

      public String getNiceName()
      Gets the user-readable name of the filter.

      Returns:
      the user-readable name
    • getOptions

      The map of filter options.

      Internally, this is stored as a LinkedHashMap, so the order of options is preserved. The keys of the map are internal identifiers for the options, while the values are the texts displayed in the GUI for the options.

      Returns:
      the map of filter options
    • getValue

      public String getValue()
      Gets the current value.

      Returns:
      the filter value
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
      See Also: