Package de.sciss.gui

Class KeyedAction

  • All Implemented Interfaces:
    java.awt.event.ActionListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, javax.swing.Action
    Direct Known Subclasses:
    DoClickAction

    public abstract class KeyedAction
    extends javax.swing.AbstractAction
    A special Action class whose constructor requires an accelerator key. When the action listener is invoked, the current keyboard focus component is queried. If a text editing component has the focus, the action is silently aborted. Otherwise the abstract method validActionPerformed is called. This method must be overriden by subclasses. This allows global keyboard commands without modifier keys to be installed and they won't interfer when the user edits text fields.
    See Also:
    Serialized Form
    • Field Summary

      • 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

      Constructors 
      Constructor Description
      KeyedAction​(javax.swing.KeyStroke stroke)  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      void actionPerformed​(java.awt.event.ActionEvent e)  
      boolean getIgnoreFocus()  
      javax.swing.KeyStroke getStroke()  
      void setIgnoreFocus​(boolean ignore)  
      protected abstract void validActionPerformed​(java.awt.event.ActionEvent e)  
      • Methods inherited from class javax.swing.AbstractAction

        addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface javax.swing.Action

        accept
    • Constructor Detail

      • KeyedAction

        public KeyedAction​(javax.swing.KeyStroke stroke)
    • Method Detail

      • setIgnoreFocus

        public void setIgnoreFocus​(boolean ignore)
      • getIgnoreFocus

        public boolean getIgnoreFocus()
      • getStroke

        public javax.swing.KeyStroke getStroke()
      • actionPerformed

        public final void actionPerformed​(java.awt.event.ActionEvent e)
      • validActionPerformed

        protected abstract void validActionPerformed​(java.awt.event.ActionEvent e)