public abstract class ConsoleAction extends javax.swing.text.TextAction
Modifier and Type | Field and Description |
---|---|
protected Console |
console |
protected static java.util.Map<javax.swing.JTextPane,Console> |
mapping |
Modifier | Constructor and Description |
---|---|
protected |
ConsoleAction(Console console,
Console.Actions type) |
Modifier and Type | Method and Description |
---|---|
abstract void |
actionPerformed(java.awt.event.ActionEvent e) |
protected Console |
getSourceConsole(java.awt.event.ActionEvent e)
Attempts to return the console where the
ActionEvent originated. |
augmentList, getFocusedComponent, getTextComponent
protected ConsoleAction(Console console, Console.Actions type)
protected Console getSourceConsole(java.awt.event.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(java.awt.event.ActionEvent e)