Package docking.widgets.tree
Interface GTreeFilterProvider
- All Known Implementing Classes:
DefaultGTreeFilterProvider
public interface GTreeFilterProvider
Interface for providing a filter for GTrees.
-
Method Summary
Modifier and TypeMethodDescriptiondefault GTreeFilterProvider
Creates a copy of this filter with all current filter settings.returns 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
setFilterText
(String text) Sets the filter text for the filter.
-
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 theGTreeFilter
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
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
Sets aFilterTransformer
for preparing tree data to be filtered.- Parameters:
transformer
- the transform for preparing tree data to be filtered
-
loadFilterPreference
Loads any filter preferences that have been saved.- Parameters:
windowManager
- theDockingWindowManager
to load preferences from
-
setAccessibleNamePrefix
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
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
-