Interface DocumentFilter


public interface DocumentFilter
A filter on documents from a DocumentSource. Filters are used in the browser to list documents matching the filter.
  • Method Details

    • getFilterType

      DocumentFilterType getFilterType()
      Returns:
      The filter type.
    • 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.
    • isRemovable

      default boolean isRemovable()
      Returns:
      true if the filter is removable, i.e. can be added as a new filter and then removed. If false is returned the filter will always be shown and cannot be removed.
    • isQuickFilter

      default boolean isQuickFilter()
      Returns:
      true if the filter can be used as a quick filter (mainly used in side panel and in document selectors), false otherwise (only usable through the browser).
    • getEditorType

      FilterEditorType getEditorType()
      Returns:
      The editor type for editing the filter settings.
    • createCustomEditor

      default DocumentFilter.FilterEditor 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:
      defaultFont - The font.
      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.
      Returns:
      A custom editor used by filters with editor type "CUSTOM".
    • isEditorHideable

      default boolean isEditorHideable()
      Returns:
      true if the editor should hide and apply the filter when the user clicks outside the editor.
    • 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)
      Parameters:
      key - The key to get the title for.
      Returns:
      The human-readable title of a key for filters with editor type "SELECTED_KEYS".
    • getIcon

      default Icon getIcon(Object key)
      Parameters:
      key - The key to get the icon for.
      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.
      Parameters:
      selectedKeys - The currently selected keys.