All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.sun.java.swing.text.TextAction

java.lang.Object
   |
   +----com.sun.java.swing.AbstractAction
           |
           +----com.sun.java.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.


Constructor Index

 o TextAction(String)
Creates a new JTextAction object.

Method Index

 o augmentList(Action[], Action[])
Takes one list of commands and augments it with another list of commands.
 o getFocusedComponent()
Fetches the text component that currently has focus.
 o getKeySequence()
Fetches the string that represents the key-sequence that was typed to cause the action to be invoked.

Constructors

 o TextAction
 public TextAction(String name)
Creates a new JTextAction object.

Parameters:
name - the name of the action

Methods

 o 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
 o 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
 o 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