public final class FiltersDescription extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
FiltersDescription.Provider
RefactoringPlugin s can implement this interface if they want to
supply new filters, or enable existing filters. |
Constructor and Description |
---|
FiltersDescription()
Creates a new instance of FiltersDescription
|
Modifier and Type | Method and Description |
---|---|
void |
addFilter(String key,
String tooltip,
boolean selected,
Icon icon)
Add a new filter to the FiltersDescription.
|
void |
enable(int index)
Enable the filter at the supplied index.
|
void |
enable(String key)
Enable the filter with the supplied key.
|
int |
getFilterCount()
Returns the number of filters in this description.
|
Icon |
getIcon(int index)
Returns the icon of the filter at the supplied index.
|
String |
getKey(int index)
Returns the key of the filter at the supplied index.
|
String |
getTooltip(int index)
Returns the tooltip of the filter at the supplied index.
|
boolean |
isEnabled(int index)
Returns true if the filter at the supplied index is enabled.
|
boolean |
isSelected(int index)
Returns true if the filter at the supplied index is selected.
|
void |
setSelected(int index,
boolean selected)
Change the selected value of the filter at the supplied index.
|
public FiltersDescription()
public void addFilter(@NonNull String key, @NonNull String tooltip, boolean selected, @NonNull Icon icon)
FiltersDescription.Provider
s should enable them when
used.key
- identifier for the filtertooltip
- text to display in the tooltip of the filter buttonselected
- true if the filter should be selectedicon
- icon to use for the filter buttonpublic int getFilterCount()
@NonNull public String getKey(int index)
index
- the index of the filterIndexOutOfBoundsException
- if the index is out of range
(index < 0 || index >= size()
)@NonNull public String getTooltip(int index)
index
- the index of the filterIndexOutOfBoundsException
- if the index is out of range
(index < 0 || index >= size()
)@NonNull public Icon getIcon(int index)
index
- the index of the filterIndexOutOfBoundsException
- if the index is out of range
(index < 0 || index >= size()
)public boolean isSelected(int index)
index
- the index of the filterIndexOutOfBoundsException
- if the index is out of range
(index < 0 || index >= size()
)public void setSelected(int index, boolean selected)
index
- the index of the filterselected
- true if the filter should be selectedIndexOutOfBoundsException
- if the index is out of range
(index < 0 || index >= size()
)public void enable(int index)
index
- the index of the filterIndexOutOfBoundsException
- if the index is out of range
(index < 0 || index >= size()
)public void enable(@NonNull String key)
key
- the key of a filterpublic boolean isEnabled(int index)
index
- the index of the filterIndexOutOfBoundsException
- if the index is out of range
(index < 0 || index >= size()
)