public class DefaultDropDownFilter extends AbstractDropDownFilter
DropDownFilter
. This filter uses the contents
of the selected element whenever possible. The tooltip either consists of
the drop-down-action if the selected action is not triggerable, or of
the action itself if it is triggerable.Modifier and Type | Field and Description |
---|---|
static DropDownFilterFactory |
FACTORY
A factory for this type of filter
|
enabled, icons, representative, selected, text, tooltip
Constructor and Description |
---|
DefaultDropDownFilter(DropDownAction action,
Dockable dockable,
DropDownView view)
Creates a new filter
|
Modifier and Type | Method and Description |
---|---|
ActionContentModifier[] |
getIconContexts()
Gets the
ActionContentModifier s for which DropDownView.setIcon(ActionContentModifier, Icon) was called
with a value other than null . |
void |
update(DropDownViewItem selection)
Updates all properties using the current selection of a button.
|
protected void |
updateEnabled(DropDownViewItem selection)
Updates the enabled-state of the
view . |
protected void |
updateIcon(DropDownViewItem selection)
Updates the icon of the
view . |
protected void |
updateRepresentative(DropDownViewItem selection)
|
protected void |
updateSelected(DropDownViewItem selection)
Updates the selected-state of the
view . |
protected void |
updateText(DropDownViewItem selection)
Updates the text of the
view . |
protected void |
updateTooltip(DropDownViewItem selection)
Updates the tooltip of the
view . |
clearIcons, getIcon, setDockableRepresentation, setEnabled, setIcon, setSelected, setText, setTooltip
bind, getAction, getDockable, getView, unbind
public static final DropDownFilterFactory FACTORY
public DefaultDropDownFilter(DropDownAction action, Dockable dockable, DropDownView view)
action
- the action to filterdockable
- the owner of action
view
- the view where this filter will write intopublic void update(DropDownViewItem selection)
DropDownFilter
update
in class DropDownFilter
selection
- the selectionprotected void updateEnabled(DropDownViewItem selection)
view
.selection
- the selected item, ignored by the default implementationprotected void updateRepresentative(DropDownViewItem selection)
selection
- the selected item, ignored by the default implementationprotected void updateSelected(DropDownViewItem selection)
view
.selection
- the selected item, ignored by the default implementationpublic ActionContentModifier[] getIconContexts()
DropDownView
ActionContentModifier
s for which DropDownView.setIcon(ActionContentModifier, Icon)
was called
with a value other than null
.protected void updateIcon(DropDownViewItem selection)
view
.selection
- the selected item, ignored by the default implementationprotected void updateText(DropDownViewItem selection)
view
.selection
- the selected item, ignored by the default implementationprotected void updateTooltip(DropDownViewItem selection)
view
.selection
- the selected item, ignored by the default implementation