K - the type of key to distinguish between groups of Dockablespublic abstract class GroupedSelectableDockAction<K> extends GroupedDropDownItemAction<K,SimpleSelectableAction> implements SelectableDockAction
| Modifier and Type | Class and Description |
|---|---|
static class |
GroupedSelectableDockAction.Check<K>
An action intended to use as type
ActionType.CHECK |
static class |
GroupedSelectableDockAction.Radio<K>
An action intended to use as type
ActionType.RADIO |
BUTTON_CONTENT_FILTER| Constructor and Description |
|---|
GroupedSelectableDockAction(GroupKeyGenerator<? extends K> generator,
ActionType<SelectableDockAction> type)
Creates a new action.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addSelectableListener(SelectableDockActionListener listener)
Adds a listener to this action.
|
protected SimpleSelectableAction |
createGroup(K key)
Creates a new group.
|
protected abstract SimpleSelectableAction |
createGroup(SelectableDockActionListener listener)
Creates a new group and adds a listener to the group.
|
<V> V |
createView(ViewTarget<V> target,
ActionViewConverter converter,
Dockable dockable)
Creates a view for this action, for the platform
target and
with help of converter. |
protected void |
fireSelectedChanged(Dockable dockable)
Fires a change-event on all known listeners.
|
protected void |
fireSelectedChanged(Set<Dockable> dockables)
Fires a change-event on all known listeners.
|
Icon |
getDisabledSelectedIcon(Object key)
Gets the icon that is shown when the group
key
is selected and disabled. |
Icon |
getSelectedIcon(Object key)
Gets the icon that is shown when the group named
key
is in the selected-state. |
boolean |
isSelected(Dockable dockable)
Tells whether this DockAction is selected or not (in respect
to the given
dockable). |
boolean |
isSelected(Object key)
Gets the selected-state property of the group
key. |
void |
removeSelectableListener(SelectableDockActionListener listener)
Removes a listener from this action.
|
void |
setDisabledSelectedIcon(K key,
Icon icon)
Sets the
icon that will be shown when the group
key is disabled and selected. |
void |
setGroup(K key,
Dockable dockable)
Assigns the
dockable to the group with the given key. |
void |
setSelected(Dockable dockable,
boolean selected)
Sets the selected state for
dockable. |
void |
setSelected(K key,
boolean selected)
Sets the selected-state of the group
key. |
void |
setSelectedIcon(K key,
Icon icon)
Sets the
icon that will be shown when the group
named key is selected. |
isDropDownSelectable, isDropDownSelectable, isDropDownTriggerable, isDropDownTriggerable, setDropDownSelectable, setDropDownTriggerableNotSelected, setDropDownTriggerableSelectedbound, createGroupKey, ensureGroup, getAccelerator, getDisabledIcon, getDisabledIcon, getDockableRepresentation, getDockableRepresentation, getGenerator, getGroup, getGroup, getIcon, getIcon, getIcon, getIconContexts, getText, getText, getTooltip, getTooltipText, getTooltipText, groupExists, isEnabled, isEnabled, isKnown, isRemoveEmptyGroups, removeGroup, setAccelerator, setDisabledIcon, setDockableRepresentation, setEnabled, setGenerator, setIcon, setIcon, setRemoveEmptyGroups, setText, setTooltip, trigger, unboundaddDockActionListener, bind, fireActionEnabledChanged, fireActionIconChanged, fireActionRepresentativeChanged, fireActionTextChanged, fireActionTooltipTextChanged, getBoundDockables, isBound, removeDockActionListener, unbindclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitisDropDownSelectable, isDropDownTriggerableaddDockActionListener, getDockableRepresentation, getIcon, getIconContexts, getText, getTooltipText, isEnabled, removeDockActionListenerbind, trigger, unbindpublic GroupedSelectableDockAction(GroupKeyGenerator<? extends K> generator, ActionType<SelectableDockAction> type)
generator - a generator to create keys for Dockables which are not
yet in a group.type - the type of this actionpublic void setGroup(K key, Dockable dockable)
GroupedDockActiondockable to the group with the given key.setGroup in class GroupedDockAction<K,SimpleSelectableAction>key - The name of the new groupdockable - The Dockable whose membership will be changed.
The dockable must already be in a group of this action.GroupedDockAction.createGroupKey(Dockable)public <V> V createView(ViewTarget<V> target, ActionViewConverter converter, Dockable dockable)
DockActiontarget and
with help of converter. Clients might use their own
code to create a new view, but the preferred way is to call
ActionViewConverter.createView(ActionType, DockAction, ViewTarget, Dockable)
with an ActionType that fits to this DockAction.createView in interface DockActionV - the type of view requestedtarget - The platform on which the view will be usedconverter - A set of methods that can be used to create a viewdockable - The Dockable for which the view will be shown. Note that
this action may not yet be bound to this action.public void addSelectableListener(SelectableDockActionListener listener)
SelectableDockActionDockable changes.addSelectableListener in interface SelectableDockActionlistener - the new listenerpublic void removeSelectableListener(SelectableDockActionListener listener)
SelectableDockActionremoveSelectableListener in interface SelectableDockActionlistener - the listener to removeprotected SimpleSelectableAction createGroup(K key)
GroupedDockActioncreateGroup in class GroupedDockAction<K,SimpleSelectableAction>key - the key of the new groupprotected abstract SimpleSelectableAction createGroup(SelectableDockActionListener listener)
listener - the listener to addprotected void fireSelectedChanged(Dockable dockable)
dockable - the Dockable whose state has changedprotected void fireSelectedChanged(Set<Dockable> dockables)
dockables - the Dockables whose state has been changedpublic boolean isSelected(Dockable dockable)
SelectableDockActiondockable).isSelected in interface SelectableDockActiondockable - The Dockable for which this action may be selected
or not selectedtrue if this DockAction is selected, false
otherwisepublic void setSelected(Dockable dockable, boolean selected)
SelectableDockActiondockable.setSelected in interface SelectableDockActiondockable - the affected dockableselected - the new statepublic void setSelected(K key, boolean selected)
key.
If the group does not exist, it will be created.key - The name of the groupselected - The new state of the grouppublic boolean isSelected(Object key)
key.key - The name of the groupIllegalArgumentException - If the group does not existsetSelected(Object, boolean)public void setSelectedIcon(K key, Icon icon)
icon that will be shown when the group
named key is selected. If the group does not
exist, it will be created.key - The name of the groupicon - The selected-icon, may be nullpublic Icon getSelectedIcon(Object key)
key
is in the selected-state.key - The name of the groupnullIllegalArgumentException - if the group does not existGroupedDockAction.setDisabledIcon(Object, Icon)public void setDisabledSelectedIcon(K key, Icon icon)
icon that will be shown when the group
key is disabled and selected. If the group
does not exist, it will be created.key - The name of the groupicon - The icon to display, when the group is
selected and disabled, may be nullpublic Icon getDisabledSelectedIcon(Object key)
key
is selected and disabled.key - The name of the groupnullIllegalArgumentException - if the group does not existsetDisabledSelectedIcon(Object, Icon)Copyright © 2017 Docking Frames. All rights reserved.