public abstract class ConsoleAction extends TextAction
Modifier and Type | Field and Description |
---|---|
protected Console |
console |
protected static Map<JTextPane,Console> |
mapping |
changeSupport, enabled
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON
Modifier | Constructor and Description |
---|---|
protected |
ConsoleAction(Console console,
Console.Actions type) |
Modifier and Type | Method and Description |
---|---|
abstract void |
actionPerformed(ActionEvent e) |
protected Console |
getSourceConsole(ActionEvent e)
Attempts to return the console where the
ActionEvent originated. |
augmentList, getFocusedComponent, getTextComponent
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
protected ConsoleAction(Console console, Console.Actions type)
protected Console getSourceConsole(ActionEvent e)
ActionEvent
originated.
Note: TextAction
s 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 JTextPane
s to Console
s.
e
- The action whose source Console
you want.Console
, or the Console
provided to the constructor.TextAction
public abstract void actionPerformed(ActionEvent e)