Interface MTAttributeFilter
- All Known Subinterfaces:
MTAttributeServerFilter
public interface MTAttributeFilter
A filter on attribute values.
-
Method Summary
Modifier and TypeMethodDescriptiondefault JComponent
createCustomEditor
(Font defaultFont, Runnable onChange, Optional<Runnable> disposer) Creates the custom editor used by filters with editor type "CUSTOM".The attribute type that the filter is used on.Returns the available keys to select from for filters with editor type "SELECTED_KEYS".Returns the editor type for editing the filter settings.Returns a human-readable string representation of the filter that can be shown to the user in the UI.Returns a string representation of the filter in its current state.The filter type.default Icon
Returns a 24x24 icon for a key for filters with editor type "SELECTED_KEYS".Returns the currently selected keys for filters with editor type "SELECTED_KEYS".default String
Returns the human-readable title of a key for filters with editor type "SELECTED_KEYS".default boolean
boolean
Returns true if any filtering will be performed with the current settings.boolean
match
(MTAttribute attribute, MTLanguage language) Returns true if the filter matches the value of an attribute.default boolean
Returns true if a model/object without a value is matched by the filter.default void
setSelectedKeys
(List<Object> selectedKeys) Sets the currently selected keys for filters with editor type "SELECTED_KEYS".
-
Method Details
-
getFilterType
MTAttributeFilterType getFilterType()The filter type. -
getAttributeType
MTAttributeType getAttributeType()The attribute type that the filter is used on. -
getFilterString
String getFilterString()Returns a string representation of the filter in its current state. This can be used to re-create the filter. -
getFilterRepresentation
String getFilterRepresentation()Returns a human-readable string representation of the filter that can be shown to the user in the UI. -
isFiltering
boolean isFiltering()Returns true if any filtering will be performed with the current settings. -
match
Returns true if the filter matches the value of an attribute.- Parameters:
attribute
- The attribute to match against.language
- The language to match on.
-
matchEmpty
default boolean matchEmpty()Returns true if a model/object without a value is matched by the filter. -
getEditorType
FilterEditorType getEditorType()Returns the editor type for editing the filter settings. -
createCustomEditor
default JComponent createCustomEditor(Font defaultFont, Runnable onChange, Optional<Runnable> disposer) Creates the custom editor used by filters with editor type "CUSTOM". This will be shown to the user for editing the filter settings.- Parameters:
onChange
- Should be called when the filter settings have been updated and the result needs to be re-calculated.disposer
- Can be used to dispose the settings UI.
-
isEditorHideable
default boolean isEditorHideable() -
getAvailableKeys
Returns the available keys to select from for filters with editor type "SELECTED_KEYS". -
getTitle
Returns the human-readable title of a key for filters with editor type "SELECTED_KEYS". -
getIcon
Returns a 24x24 icon for a key for filters with editor type "SELECTED_KEYS". -
getSelectedKeys
Returns the currently selected keys for filters with editor type "SELECTED_KEYS". -
setSelectedKeys
Sets the currently selected keys for filters with editor type "SELECTED_KEYS". This will be called automatically when the user changes the selected keys in the editor. The filter implementation only needs to update its internal filter state, the list will automatically have its result updated after this method has been called.
-