|
Groovy Documentation | |||||||
| FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.wordpress.tipsforjava.swing.WrappedAction
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.
| 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 |
|---|
private Object actionKey
private JComponent component
private Action originalAction
| Constructor Detail |
|---|
public WrappedAction(JComponent component, KeyStroke keyStroke)
public WrappedAction(JComponent component, Object actionKey)
| Method Detail |
|---|
public void addPropertyChangeListener(PropertyChangeListener listener)
private Object getKeyForActionMap(JComponent component, KeyStroke keyStroke)
public Object[] getKeys()
public PropertyChangeListener[] getPropertyChangeListeners()
public Object getValue(String key)
public void install()
public void invokeOriginalAction(ActionEvent e)
public boolean isEnabled()
public void putValue(String key, Object newValue)
public void removePropertyChangeListener(PropertyChangeListener listener)
private void setActionForKey(Object actionKey)
public void setEnabled(boolean newValue)
public void unInstall()
Groovy Documentation