Interface GTreeFilterProvider

All Known Implementing Classes:
DefaultGTreeFilterProvider

public interface GTreeFilterProvider
Interface for providing a filter for GTrees.
  • Method Details

    • getFilterComponent

      JComponent getFilterComponent()
      Returns the component to place at the bottom of a GTree to provider filtering capabilities.
      Returns:
      the filter component
    • getFilter

      GTreeFilter getFilter()
      returns the GTreeFilter object to apply to the GTree whenever the filter component is manipulated
      Returns:
      the GTreeFilter to apply to the tree
    • setEnabled

      void setEnabled(boolean enabled)
      Sets the active state for the filter component.
      Parameters:
      enabled - true, the filter component is enabled
    • setFilterText

      void setFilterText(String text)
      Sets the filter text for the filter.
      Parameters:
      text - the text to filter on
    • getFilterText

      String getFilterText()
      Returns the current filter text.
      Returns:
      the current filter text
    • setDataTransformer

      void setDataTransformer(FilterTransformer<GTreeNode> transformer)
      Sets a FilterTransformer for preparing tree data to be filtered.
      Parameters:
      transformer - the transform for preparing tree data to be filtered
    • loadFilterPreference

      void loadFilterPreference(DockingWindowManager windowManager)
      Loads any filter preferences that have been saved.

      This is called when the tree is first made visible in the tool. This is the chance for the filter to load any preferences and to add a preference supplier to the window manager.

      Parameters:
      windowManager - the DockingWindowManager to load preferences from
    • setAccessibleNamePrefix

      void setAccessibleNamePrefix(String namePrefix)
      Sets an accessible name on the filter component. This prefix will be used to assign meaningful accessible names to the filter text field and the filter options button such that screen readers will properly describe them.

      This prefix should be the base name that describes the type of items in the tree. This method will then append the necessary information to name the text field and the button.

      Parameters:
      namePrefix - the accessible name prefix to assign to the filter component. For example if the tree contains fruits, then "Fruits" would be an appropriate prefix name.
    • copy

      default GTreeFilterProvider copy(GTree gTree)
      Creates a copy of this filter with all current filter settings.

      This is meant to be used for GTrees that support creating a new copy.

      Note: Filter providers that do not support copying will return null from this method.

      Parameters:
      gTree - the new tree for the new filter
      Returns:
      the copy
    • activate

      default void activate()
      Activates this filter by showing it, if not visible, and then requesting focus in the filter text field.
    • toggleVisibility

      default void toggleVisibility()
      Changes the visibility of the filter, make it not visible it if showing, showing it if not visible.
    • dispose

      default void dispose()
      A method for subclasses to do any optional cleanup