Interface MTAttributeFilter

All Known Subinterfaces:
MTAttributeServerFilter

public interface MTAttributeFilter
A filter on attribute values.
  • 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

      boolean match(MTAttribute attribute, MTLanguage language)
      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

      default List<Object> getAvailableKeys()
      Returns the available keys to select from for filters with editor type "SELECTED_KEYS".
    • getTitle

      default String getTitle(Object key)
      Returns the human-readable title of a key for filters with editor type "SELECTED_KEYS".
    • getIcon

      default Icon getIcon(Object key)
      Returns a 24x24 icon for a key for filters with editor type "SELECTED_KEYS".
    • getSelectedKeys

      default List<Object> getSelectedKeys()
      Returns the currently selected keys for filters with editor type "SELECTED_KEYS".
    • setSelectedKeys

      default void setSelectedKeys(List<Object> selectedKeys)
      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.