Class DefaultGTreeFilterProvider
- All Implemented Interfaces:
GTreeFilterProvider
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate()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.voiddispose()A method for subclasses to do any optional cleanupreturns theGTreeFilterobject 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.voidloadFilterPreference(DockingWindowManager windowManager) Loads any filter preferences that have been saved.voidsetAccessibleNamePrefix(String namePrefix) Sets an accessible name on the filter component.voidsetDataTransformer(FilterTransformer<GTreeNode> transformer) Sets aFilterTransformerfor preparing tree data to be filtered.voidsetEnabled(boolean enabled) Sets the active state for the filter component.voidsetFilterOptions(FilterOptions filterOptions) Sets the options for this filter provider.voidsetFilterText(String text) Sets the filter text for the filter.voidsetPreferredFilterOptions(FilterOptions filterOptions) A method to allow clients to change the current filter settings to something they would like for their particular use case.voidChanges 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:GTreeFilterProviderCreates 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:
copyin interfaceGTreeFilterProvider- Parameters:
newTree- the new tree for the new filter- Returns:
- the copy
-
getFilterComponent
Description copied from interface:GTreeFilterProviderReturns the component to place at the bottom of a GTree to provider filtering capabilities.- Specified by:
getFilterComponentin interfaceGTreeFilterProvider- Returns:
- the filter component
-
setFilterText
Description copied from interface:GTreeFilterProviderSets the filter text for the filter.- Specified by:
setFilterTextin interfaceGTreeFilterProvider- Parameters:
text- the text to filter on
-
setEnabled
public void setEnabled(boolean enabled) Description copied from interface:GTreeFilterProviderSets the active state for the filter component.- Specified by:
setEnabledin interfaceGTreeFilterProvider- Parameters:
enabled- true, the filter component is enabled
-
setAccessibleNamePrefix
Description copied from interface:GTreeFilterProviderSets 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:
setAccessibleNamePrefixin 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:GTreeFilterProviderActivates this filter by showing it, if not visible, and then requesting focus in the filter text field.- Specified by:
activatein interfaceGTreeFilterProvider
-
toggleVisibility
public void toggleVisibility()Description copied from interface:GTreeFilterProviderChanges the visibility of the filter, make it not visible it if showing, showing it if not visible.- Specified by:
toggleVisibilityin interfaceGTreeFilterProvider
-
loadFilterPreference
Description copied from interface:GTreeFilterProviderLoads 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:
loadFilterPreferencein interfaceGTreeFilterProvider- Parameters:
windowManager- theDockingWindowManagerto load preferences from
-
getFilter
Description copied from interface:GTreeFilterProviderreturns theGTreeFilterobject to apply to the GTree whenever the filter component is manipulated- Specified by:
getFilterin interfaceGTreeFilterProvider- Returns:
- the GTreeFilter to apply to the tree
-
getFilterText
Description copied from interface:GTreeFilterProviderReturns the current filter text.- Specified by:
getFilterTextin interfaceGTreeFilterProvider- Returns:
- the current filter text
-
setDataTransformer
Description copied from interface:GTreeFilterProviderSets aFilterTransformerfor preparing tree data to be filtered.- Specified by:
setDataTransformerin interfaceGTreeFilterProvider- Parameters:
transformer- the transform for preparing tree data to be filtered
-
dispose
public void dispose()Description copied from interface:GTreeFilterProviderA method for subclasses to do any optional cleanup- Specified by:
disposein interfaceGTreeFilterProvider
-