- Direct Known Subclasses:
public abstract class TextAction extends AbstractAction
Serialized objects of this class will not be compatible with
future Swing releases. The current serialization support is
appropriate for short term storage or RMI between applications running
the same version of Swing. As of 1.4, support for long term storage
of all JavaBeans™
has been added to the
Modifier and Type Method Description
augmentList(Action list1, Action list2)Takes one list of commands and augments it with another list of commands.
getFocusedComponent()Fetches the text component that currently has focus.
getTextComponent(ActionEvent e)Determines the component to use for the action.
Methods declared in class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
Methods declared in class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Determines the component to use for the action. This if fetched from the source of the ActionEvent if it's not null and can be narrowed. Otherwise, the last focused component is used.
e- the ActionEvent
- the component
Takes one list of commands and augments it with another list of commands. The second list takes precedence over the first list; that is, when both lists contain a command with the same name, the command from the second list is used.
list1- the first list, may be empty but not
list2- the second list, may be empty but not
- the augmented list
protected final JTextComponent getFocusedComponent()Fetches the text component that currently has focus. This allows actions to be shared across text components which is useful for key-bindings where a large set of actions are defined, but generally used the same way across many different components.
- the component