Groovy Documentation

com.wordpress.tipsforjava.swing
[Java] Class WrappedAction

java.lang.Object
  com.wordpress.tipsforjava.swing.WrappedAction
All Implemented Interfaces:
Action

public abstract class WrappedAction
extends Object

The WrappedAction class is a convenience class that allows you to replace an installed Action with a custom Action of your own. There are two benefits to using this class: a) Key Bindings of the original Action are retained for the custom Action. b) the original Action is retained so your custom Action can invoke the original Action. This class is abstract so your custom Action must extend this class and implement the actionPerformed() method.

Authors:
Rob Camick
Darryl Burke


Field Summary
private Object actionKey

private JComponent component

private Action originalAction

 
Constructor Summary
WrappedAction(JComponent component, KeyStroke keyStroke)

WrappedAction(JComponent component, Object actionKey)

 
Method Summary
void addPropertyChangeListener(PropertyChangeListener listener)

private Object getKeyForActionMap(JComponent component, KeyStroke keyStroke)

Object[] getKeys()

PropertyChangeListener[] getPropertyChangeListeners()

Object getValue(String key)

void install()

void invokeOriginalAction(ActionEvent e)

boolean isEnabled()

void putValue(String key, Object newValue)

void removePropertyChangeListener(PropertyChangeListener listener)

private void setActionForKey(Object actionKey)

void setEnabled(boolean newValue)

void unInstall()

 
Methods inherited from class Object
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll
 

Field Detail

actionKey

private Object actionKey


component

private JComponent component


originalAction

private Action originalAction


 
Constructor Detail

WrappedAction

public WrappedAction(JComponent component, KeyStroke keyStroke)


WrappedAction

public WrappedAction(JComponent component, Object actionKey)


 
Method Detail

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener listener)


getKeyForActionMap

private Object getKeyForActionMap(JComponent component, KeyStroke keyStroke)


getKeys

public Object[] getKeys()


getPropertyChangeListeners

public PropertyChangeListener[] getPropertyChangeListeners()


getValue

public Object getValue(String key)


install

public void install()


invokeOriginalAction

public void invokeOriginalAction(ActionEvent e)


isEnabled

public boolean isEnabled()


putValue

public void putValue(String key, Object newValue)


removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener listener)


setActionForKey

private void setActionForKey(Object actionKey)


setEnabled

public void setEnabled(boolean newValue)


unInstall

public void unInstall()


 

Groovy Documentation