de.sciss.gui
Class KeyedAction

java.lang.Object
  extended by javax.swing.AbstractAction
      extended by de.sciss.gui.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.

Version:
0.37, 25-Feb-08
Author:
Hanns Holger Rutz
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, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SHORT_DESCRIPTION, SMALL_ICON
 
Constructor Summary
KeyedAction(javax.swing.KeyStroke stroke)
           
 
Method Summary
 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
 

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)