All Packages Class Hierarchy This Package Previous Next Index
Class java.awt.swing.text.TextAction
java.lang.Object
|
+----java.awt.swing.AbstractAction
|
+----java.awt.swing.text.TextAction
- public abstract class TextAction
- extends AbstractAction
An Action implementation useful for key bindings that are
shared across a number of different text components. These
must be used in conjunction with a JTextController which
arranges to share information with JTextAction's such as
which JTextComponent currently has focus.
TextAction(String)
- Creates a new JTextAction object.
augmentList(Action[], Action[])
- Takes one list of
commands and augments it with another list
of commands.
getFocusedComponent()
- Fetches the text component that currently has focus.
getKeySequence()
- Fetches the string that represents the key-sequence
that was typed to cause the action to be invoked.
TextAction
public TextAction(String name)
- Creates a new JTextAction object.
- Parameters:
- name - the name of the action
augmentList
public static final Action[] augmentList(Action[] list1,
Action[] list2)
- Takes one list of
commands and augments it with another list
of commands. The second list is considered
to be higher priority than the first list
and commands with the same name will both lists
will only have the dominate command found in the
second list in the returned list.
- Parameters:
- list1 - the first list
- list2 - the second list
- Returns:
- the augmented list
getFocusedComponent
protected 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.
- Returns:
- the component
getKeySequence
protected KeyStroke[] getKeySequence()
- Fetches the string that represents the key-sequence
that was typed to cause the action to be invoked.
This is useful for things like text insertion
commands where one Action can serve a large number
of key-bindings.
- Returns:
- the key sequence
All Packages Class Hierarchy This Package Previous Next Index
Submit a bug or feature