public abstract class SimpleSelectableAction extends SimpleDropDownItemAction implements SharingSelectableDockAction, SelectableDockAction
DockAction that has a state selected. That state
has always the same value for every Dockable using this action.| Modifier and Type | Class and Description |
|---|---|
static class |
SimpleSelectableAction.Check
A
SimpleSelectableAction that is visualized as
a ActionType.CHECK. |
static class |
SimpleSelectableAction.Radio
A
SimpleSelectableAction that is visualized as
a ActionType.RADIO. |
| Constructor and Description |
|---|
SimpleSelectableAction(ActionType<SelectableDockAction> type,
boolean monitorDisabling)
Creates a new action.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addSelectableListener(SelectableDockActionListener listener)
Adds a listener to this action.
|
<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()
Fires an event to all observers of type
SelectableDockActionListener. |
protected Icon |
firstNonNull(Icon... icons)
Gets the first element of
icons that is not null. |
Icon |
getDisabledSelectedIcon()
Gets the icon which is shown if this action is selected but disabled
|
Icon |
getIcon(Dockable dockable,
ActionContentModifier modifier)
Gets the Icon of this DockAction, when this DockAction is shown
together with
dockable. |
ActionContentModifier[] |
getIconContexts(Dockable dockable)
Gets all the
ActionContentModifiers for which StandardDockAction.getIcon(Dockable, ActionContentModifier) would
return a value other than null. |
Icon |
getSelectedIcon()
Gets the icon which is shown if this action is selected
|
Icon |
getSelectedIcon(ActionContentModifier modifier)
Gets the icon that is shown when this action is selected.
|
boolean |
isSelected()
Gets the selected-state of this action.
|
boolean |
isSelected(Dockable dockable)
Tells whether this DockAction is selected or not (in respect
to the given
dockable). |
void |
removeSelectableListener(SelectableDockActionListener listener)
Removes a listener from this action.
|
void |
setDisabledSelectedIcon(Icon icon)
Sets the icon which is shown if this action is selected but disabled
|
void |
setSelected(boolean selected)
Sets the state of this action.
|
void |
setSelected(Dockable dockable,
boolean selected)
Sets the selected state for
dockable. |
void |
setSelectedIcon(ActionContentModifier modifier,
Icon selectedIcon)
Sets the icon that will be shown, when this action is selected.
|
void |
setSelectedIcon(Icon icon)
Sets the icon which is shown if this action is selected
|
isDropDownSelectable, isDropDownSelectable, isDropDownTriggerable, isDropDownTriggerableNotSelected, isDropDownTriggerableSelected, setDropDownSelectable, setDropDownTriggerableNotSelected, setDropDownTriggerableSelectedbound, getAccelerator, getDisabledIcon, getDockableRepresentation, getDockableRepresentation, getIcon, getIcon, getText, getText, getTooltip, getTooltipText, getTooltipText, isAcceleratorGlobal, isEnabled, isEnabled, setAccelerator, setAcceleratorIsGlobal, setDisabledIcon, setDockableRepresentation, setEnabled, setIcon, setIcon, setText, setTooltip, trigger, unboundaddDockActionListener, bind, fireActionEnabledChanged, fireActionIconChanged, fireActionRepresentativeChanged, fireActionTextChanged, fireActionTooltipTextChanged, getBoundDockables, isBound, removeDockActionListener, unbindclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitisDropDownSelectable, isDropDownTriggerableNotSelected, isDropDownTriggerableSelected, setDropDownSelectable, setDropDownTriggerableNotSelected, setDropDownTriggerableSelectedgetAccelerator, getDisabledIcon, getDockableRepresentation, getIcon, getIcon, getText, getTooltip, getTooltipText, isAcceleratorGlobal, isEnabled, setAccelerator, setAcceleratorIsGlobal, setDisabledIcon, setDockableRepresentation, setEnabled, setIcon, setIcon, setText, setTooltipisDropDownSelectable, isDropDownTriggerablepublic SimpleSelectableAction(ActionType<SelectableDockAction> type, boolean monitorDisabling)
type - how this action is to be visualizedmonitorDisabling - whether the current DisablingStrategy should be monitoredpublic <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 void fireSelectedChanged()
SelectableDockActionListener.public 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 boolean isSelected()
SharingSelectableDockActionisSelected in interface SharingSelectableDockActionSharingSelectableDockAction.setSelected(boolean)public void setSelected(boolean selected)
SharingSelectableDockActionsetSelected in interface SharingSelectableDockActionselected - the new statepublic Icon getIcon(Dockable dockable, ActionContentModifier modifier)
StandardDockActiondockable. This method must ignore the
backup property of modifier.getIcon in interface StandardDockActiongetIcon in class SimpleDockActiondockable - The Dockable for which the action-icon
should be chosen.modifier - how the icon will be useddockable, or null.protected Icon firstNonNull(Icon... icons)
icons that is not null.icons - a list of iconspublic ActionContentModifier[] getIconContexts(Dockable dockable)
StandardDockActionActionContentModifiers for which StandardDockAction.getIcon(Dockable, ActionContentModifier) would
return a value other than null.getIconContexts in interface StandardDockActiongetIconContexts in class SimpleDockActiondockable - the Dockable for which the action-icons may be chosen.public void setSelectedIcon(Icon icon)
icon - the icon to show, or nullpublic Icon getSelectedIcon()
nullpublic void setDisabledSelectedIcon(Icon icon)
icon - the icon to show, or nullpublic Icon getDisabledSelectedIcon()
nullpublic Icon getSelectedIcon(ActionContentModifier modifier)
SharingSelectableDockActiongetSelectedIcon in interface SharingSelectableDockActionmodifier - tells in which context the icon is usednullSharingSelectableDockAction.setSelectedIcon(ActionContentModifier, Icon),
SharingSelectableDockAction.isSelected()public void setSelectedIcon(ActionContentModifier modifier, Icon selectedIcon)
SharingSelectableDockActionsetSelectedIcon in interface SharingSelectableDockActionmodifier - tells in which context icon will be usedselectedIcon - The icon, can be nullSharingSelectableDockAction.setSelected(boolean)Copyright © 2017 Docking Frames. All rights reserved.