Class DefaultGTreeFilterProvider
- All Implemented Interfaces:
GTreeFilterProvider
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
activate()
Activates this filter by showing it, if not visible, and then requesting focus in the filter text field.Creates a copy of this filter with all current filter settings.void
dispose()
A method for subclasses to do any optional cleanupreturns theGTreeFilter
object to apply to the GTree whenever the filter component is manipulatedReturns the component to place at the bottom of a GTree to provider filtering capabilities.Returns the current filter text.void
loadFilterPreference
(DockingWindowManager windowManager) Loads any filter preferences that have been saved.void
setAccessibleNamePrefix
(String namePrefix) Sets an accessible name on the filter component.void
setDataTransformer
(FilterTransformer<GTreeNode> transformer) Sets aFilterTransformer
for preparing tree data to be filtered.void
setEnabled
(boolean enabled) Sets the active state for the filter component.void
setFilterOptions
(FilterOptions filterOptions) Sets the options for this filter provider.void
setFilterText
(String text) Sets the filter text for the filter.void
setPreferredFilterOptions
(FilterOptions filterOptions) A method to allow clients to change the current filter settings to something they would like for their particular use case.void
Changes the visibility of the filter, make it not visible it if showing, showing it if not visible.
-
Constructor Details
-
DefaultGTreeFilterProvider
-
-
Method Details
-
copy
Description copied from interface:GTreeFilterProvider
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.
- Specified by:
copy
in interfaceGTreeFilterProvider
- Parameters:
newTree
- the new tree for the new filter- Returns:
- the copy
-
getFilterComponent
Description copied from interface:GTreeFilterProvider
Returns the component to place at the bottom of a GTree to provider filtering capabilities.- Specified by:
getFilterComponent
in interfaceGTreeFilterProvider
- Returns:
- the filter component
-
setFilterText
Description copied from interface:GTreeFilterProvider
Sets the filter text for the filter.- Specified by:
setFilterText
in interfaceGTreeFilterProvider
- Parameters:
text
- the text to filter on
-
setEnabled
public void setEnabled(boolean enabled) Description copied from interface:GTreeFilterProvider
Sets the active state for the filter component.- Specified by:
setEnabled
in interfaceGTreeFilterProvider
- Parameters:
enabled
- true, the filter component is enabled
-
setAccessibleNamePrefix
Description copied from interface:GTreeFilterProvider
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.
- Specified by:
setAccessibleNamePrefix
in interfaceGTreeFilterProvider
- 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.
-
getFilterOptions
-
setPreferredFilterOptions
A method to allow clients to change the current filter settings to something they would like for their particular use case. This differs fromsetFilterOptions(FilterOptions)
in that this method will also disable saving any changes the user makes to the filter. If you do not need to disable preference saving, then call the other method.This method disables preference saving with the assumption that some clients always wish the filter to start in the same preferred state instead of where the user last left it. It is not clear why we do that, but it is probably based on the assumption that the API client wants the filter to always start in the preferred state. The prevents filter from being restored with a previous user filter that does not make sense for the general case.
- Parameters:
filterOptions
- the options- See Also:
-
setFilterOptions
Sets the options for this filter provider.- Parameters:
filterOptions
- the new filter options
-
activate
public void activate()Description copied from interface:GTreeFilterProvider
Activates this filter by showing it, if not visible, and then requesting focus in the filter text field.- Specified by:
activate
in interfaceGTreeFilterProvider
-
toggleVisibility
public void toggleVisibility()Description copied from interface:GTreeFilterProvider
Changes the visibility of the filter, make it not visible it if showing, showing it if not visible.- Specified by:
toggleVisibility
in interfaceGTreeFilterProvider
-
loadFilterPreference
Description copied from interface:GTreeFilterProvider
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.
- Specified by:
loadFilterPreference
in interfaceGTreeFilterProvider
- Parameters:
windowManager
- theDockingWindowManager
to load preferences from
-
getFilter
Description copied from interface:GTreeFilterProvider
returns theGTreeFilter
object to apply to the GTree whenever the filter component is manipulated- Specified by:
getFilter
in interfaceGTreeFilterProvider
- Returns:
- the GTreeFilter to apply to the tree
-
getFilterText
Description copied from interface:GTreeFilterProvider
Returns the current filter text.- Specified by:
getFilterText
in interfaceGTreeFilterProvider
- Returns:
- the current filter text
-
setDataTransformer
Description copied from interface:GTreeFilterProvider
Sets aFilterTransformer
for preparing tree data to be filtered.- Specified by:
setDataTransformer
in interfaceGTreeFilterProvider
- Parameters:
transformer
- the transform for preparing tree data to be filtered
-
dispose
public void dispose()Description copied from interface:GTreeFilterProvider
A method for subclasses to do any optional cleanup- Specified by:
dispose
in interfaceGTreeFilterProvider
-