Class 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 DockingActions mapped to a given key binding
    See Also:
    Serialized Form
    • Constructor Detail

      • MultipleKeyAction

        public MultipleKeyAction​(Tool tool,
                                 ComponentProvider provider,
                                 DockingActionIf action,
                                 javax.swing.KeyStroke keyStroke)
        Creates new MultipleKeyAction
        Parameters:
        tool - used to determine context
        provider - the provider, if any, associated with the action
        action - action that will be added to the list of actions bound to a keystroke
        keyStroke - the keystroke, if any, associated with the action
    • Method Detail

      • isEmpty

        public boolean isEmpty()
      • isEnabled

        public boolean isEnabled()
        Returns the enabled state of the Action. When enabled, any component associated with this object is active and able to fire this object's actionPerformed method.
        Specified by:
        isEnabled in interface javax.swing.Action
        Overrides:
        isEnabled in class DockingKeyBindingAction
        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 interface javax.swing.Action
        Overrides:
        setEnabled in class javax.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)
        Specified by:
        actionPerformed in interface java.awt.event.ActionListener
        Overrides:
        actionPerformed in class DockingKeyBindingAction
      • geValidKeyBindingPrecedence

        public KeyBindingPrecedence geValidKeyBindingPrecedence​(java.awt.Component source)
        This is a special version of getKeyBindingPrecedence() 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
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object