Package docking.action
Class MultipleKeyAction
java.lang.Object
javax.swing.AbstractAction
docking.DockingKeyBindingAction
docking.action.MultipleKeyAction
- All Implemented Interfaces:
ActionListener
,Serializable
,Cloneable
,EventListener
,Action
Action that manages multiple
DockingAction
s mapped to a given key binding- See Also:
-
Field Summary
Fields inherited from class docking.DockingKeyBindingAction
dockingAction, keyStroke, tool
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON
-
Constructor Summary
ConstructorDescriptionMultipleKeyAction
(Tool tool, ComponentProvider provider, DockingActionIf action, KeyStroke keyStroke) Creates new MultipleKeyAction -
Method Summary
Modifier and TypeMethodDescriptionvoid
actionPerformed
(ActionEvent event) void
addAction
(ComponentProvider provider, DockingActionIf action) geValidKeyBindingPrecedence
(Component source) This is a special version ofgetKeyBindingPrecedence()
that allows the internal key event processing to specify the source component when determining how precedence should be established for the actions contained herein.boolean
isEmpty()
boolean
Returns the enabled state of theAction
.boolean
void
removeAction
(DockingActionIf action) void
setEnabled
(boolean newValue) Enables or disables the action.toString()
Methods inherited from class docking.DockingKeyBindingAction
getLocalContext
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, putValue, removePropertyChangeListener
-
Constructor Details
-
MultipleKeyAction
public MultipleKeyAction(Tool tool, ComponentProvider provider, DockingActionIf action, KeyStroke keyStroke) Creates new MultipleKeyAction- Parameters:
tool
- used to determine contextprovider
- the provider, if any, associated with the actionaction
- action that will be added to the list of actions bound to a keystrokekeyStroke
- the keystroke, if any, associated with the action
-
-
Method Details
-
isEmpty
public boolean isEmpty() -
addAction
-
removeAction
-
isEnabled
public boolean isEnabled()Returns the enabled state of theAction
. When enabled, any component associated with this object is active and able to fire this object'sactionPerformed
method.- Specified by:
isEnabled
in interfaceAction
- Overrides:
isEnabled
in classDockingKeyBindingAction
- Returns:
- true if this
Action
is enabled
-
setEnabled
public void setEnabled(boolean newValue) Enables or disables the action. This affects all uses of the action. Note that for popups, this affects whether or not the option is "grayed out", not whether the action is added to the popup.- Specified by:
setEnabled
in interfaceAction
- Overrides:
setEnabled
in classAbstractAction
- Parameters:
newValue
- true to enable the action, false to disable it- See Also:
-
actionPerformed
- Specified by:
actionPerformed
in interfaceActionListener
- Overrides:
actionPerformed
in classDockingKeyBindingAction
-
isSystemKeybindingPrecedence
public boolean isSystemKeybindingPrecedence()- Overrides:
isSystemKeybindingPrecedence
in classDockingKeyBindingAction
-
getKeyBindingPrecedence
- Specified by:
getKeyBindingPrecedence
in classDockingKeyBindingAction
-
geValidKeyBindingPrecedence
This is a special version ofgetKeyBindingPrecedence()
that allows the internal key event processing to specify the source component when determining how precedence should be established for the actions contained herein.- Parameters:
source
- the component; may be null- Returns:
- the precedence; may be null
-
getActions
- Overrides:
getActions
in classDockingKeyBindingAction
-
toString
-