javax.swing.text
Class TextAction

java.lang.Object
  extended by javax.swing.AbstractAction
      extended by javax.swing.text.TextAction
All Implemented Interfaces:
ActionListener, Serializable, Cloneable, EventListener, Action
Direct Known Subclasses:
DefaultEditorKit.BeepAction, DefaultEditorKit.CopyAction, DefaultEditorKit.CutAction, DefaultEditorKit.DefaultKeyTypedAction, DefaultEditorKit.InsertBreakAction, DefaultEditorKit.InsertContentAction, DefaultEditorKit.InsertTabAction, DefaultEditorKit.PasteAction, StyledEditorKit.StyledTextAction

public abstract class TextAction
extends AbstractAction

TextAction

See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
 
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SHORT_DESCRIPTION, SMALL_ICON
 
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  JTextComponent getFocusedComponent()
          Returns the current focused JTextComponent object.
protected  JTextComponent getTextComponent(ActionEvent event)
          Returns the JTextComponent object associated with the given ActionEvent.
 
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.awt.event.ActionListener
actionPerformed
 

Constructor Detail

TextAction

public TextAction(String name)
Constructor TextAction

Parameters:
name - TODO
Method Detail

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

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