edu.wisc.ssec.mcidasv.jython
Class ConsoleAction

java.lang.Object
  extended by javax.swing.AbstractAction
      extended by javax.swing.text.TextAction
          extended by edu.wisc.ssec.mcidasv.jython.ConsoleAction
All Implemented Interfaces:
ActionListener, Serializable, Cloneable, EventListener, Action
Direct Known Subclasses:
DeleteAction, DownAction, EndAction, EnterAction, HomeAction, PasteAction, TabAction, UpAction

public abstract class ConsoleAction
extends TextAction

See Also:
Serialized Form

Field Summary
protected  Console console
           
protected static Map<JTextPane,Console> mapping
           
 
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
protected ConsoleAction(Console console, Console.Actions type)
           
 
Method Summary
abstract  void actionPerformed(ActionEvent e)
           
protected  Console getSourceConsole(ActionEvent e)
          Attempts to return the console where the ActionEvent originated.
 
Methods inherited from class javax.swing.text.TextAction
augmentList, getFocusedComponent, getTextComponent
 
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
 

Field Detail

mapping

protected static final Map<JTextPane,Console> mapping

console

protected Console console
Constructor Detail

ConsoleAction

protected ConsoleAction(Console console,
                        Console.Actions type)
Method Detail

getSourceConsole

protected Console getSourceConsole(ActionEvent e)
Attempts to return the console where the ActionEvent originated.

Note: TextActions are weird. The only somewhat-accurate way to determine where the action occurred is to check EventObject.getSource(). Since that will be a JTextPane, you have to keep an updated mapping of JTextPanes to Consoles.

Parameters:
e - The action whose source Console you want.
Returns:
Either the actual source Console, or the Console provided to the constructor.
See Also:
TextAction

actionPerformed

public abstract void actionPerformed(ActionEvent e)