Package org.opencms.widgets.dataview
Class CmsDataViewFilter
java.lang.Object
org.opencms.widgets.dataview.CmsDataViewFilter
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 Summary
ConstructorsConstructorDescriptionCmsDataViewFilter
(String id, String niceName, String helpText, LinkedHashMap<String, String> options, String value) Creates a new filter. -
Method Summary
Modifier and TypeMethodDescriptioncopy()
Creates a copy of the filter.copyWithValue
(String value) Creates a copy of the filter, but uses a different filter value for the copy.boolean
Gets the help text for the filter.getId()
Gets the id of the filter.Gets the user-readable name of the filter.The map of filter options.getValue()
Gets the current value.int
hashCode()
-
Constructor Details
-
CmsDataViewFilter
public CmsDataViewFilter(String id, String niceName, String helpText, LinkedHashMap<String, String> options, String value) Creates a new filter.- Parameters:
id
- the filter idniceName
- the nice namehelpText
- the help text for the filteroptions
- the ordered map of optionsvalue
- the current value
-
-
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
-
getHelpText
Gets the help text for the filter.- Returns:
- the help text for the filter
-
getId
Gets the id of the filter.- Returns:
- the id of the filter
-
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
Gets the current value.- Returns:
- the filter value
-
hashCode
-