javax.swing.text

Class TextAction

public abstract class TextAction extends AbstractAction

TextAction
Constructor Summary
TextAction(String name)
Constructor TextAction
Method Summary
static Action[]augmentList(Action[] list1, Action[] list2)
Creates a new array of Action containing both given arrays.
protected JTextComponentgetFocusedComponent()
Returns the current focused JTextComponent object.
protected JTextComponentgetTextComponent(ActionEvent event)
Returns the JTextComponent object associated with the given ActionEvent.

Constructor Detail

TextAction

public TextAction(String name)
Constructor TextAction

Parameters: name TODO

Method Detail

augmentList

public static final Action[] augmentList(Action[] list1, Action[] list2)
Creates a new array of Action containing both given arrays.

Parameters: list1 the first action array list2 the second action array

Returns: the augmented array of actions

getFocusedComponent

protected final JTextComponent getFocusedComponent()
Returns the current focused JTextComponent object.

Returns: the JTextComponent

getTextComponent

protected final JTextComponent getTextComponent(ActionEvent event)
Returns the JTextComponent object associated with the given ActionEvent. If the source of the event is not a JTextComponent the currently focused text component is returned.

Parameters: event the action event

Returns: the JTextComponent