Package docking.action
Class MultipleKeyAction
- java.lang.Object
-
- javax.swing.AbstractAction
-
- docking.DockingKeyBindingAction
-
- docking.action.MultipleKeyAction
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.io.Serializable
,java.lang.Cloneable
,java.util.EventListener
,javax.swing.Action
public class MultipleKeyAction extends DockingKeyBindingAction
Action that manages multiple PluginActions mapped to this action's key binding.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class docking.DockingKeyBindingAction
keyStroke, tool
-
-
Constructor Summary
Constructors Constructor Description MultipleKeyAction(DockingTool tool, ComponentProvider provider, DockingActionIf action, javax.swing.KeyStroke keyStroke)
Creates new MultipleKeyAction
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
actionPerformed(java.awt.event.ActionEvent event)
Invoked when an action occurs.void
addAction(ComponentProvider provider, DockingActionIf action)
java.util.List<DockingActionIf>
getActions()
KeyBindingPrecedence
getKeyBindingPrecedence()
boolean
isEmpty()
boolean
isEnabled()
Returns the enabled state of theAction
.boolean
isReservedKeybindingPrecedence()
void
removeAction(DockingActionIf action)
void
setEnabled(boolean newValue)
Enables or disables the action.java.lang.String
toString()
-
Methods inherited from class docking.DockingKeyBindingAction
getLocalContext
-
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, putValue, removePropertyChangeListener
-
-
-
-
Constructor Detail
-
MultipleKeyAction
public MultipleKeyAction(DockingTool tool, ComponentProvider provider, DockingActionIf action, javax.swing.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 Detail
-
isEmpty
public boolean isEmpty()
-
addAction
public void addAction(ComponentProvider provider, DockingActionIf action)
-
removeAction
public void removeAction(DockingActionIf action)
-
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 interfacejavax.swing.Action
- 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 interfacejavax.swing.Action
- Overrides:
setEnabled
in classjavax.swing.AbstractAction
- Parameters:
newValue
- true to enable the action, false to disable it- See Also:
Action.setEnabled(boolean)
-
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent event)
Invoked when an action occurs.- Specified by:
actionPerformed
in interfacejava.awt.event.ActionListener
- Overrides:
actionPerformed
in classDockingKeyBindingAction
-
isReservedKeybindingPrecedence
public boolean isReservedKeybindingPrecedence()
- Overrides:
isReservedKeybindingPrecedence
in classDockingKeyBindingAction
-
getKeyBindingPrecedence
public KeyBindingPrecedence getKeyBindingPrecedence()
- Specified by:
getKeyBindingPrecedence
in classDockingKeyBindingAction
-
getActions
public java.util.List<DockingActionIf> getActions()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-