|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.levigo.util.swing.action.DelegateAction
public class DelegateAction
An Action
which delegates the actual action to a delegate Action
, but allows
other properties of the action to be overridden. This class maintains a private set of
properites. If a property has been set on this class, it will be used instead of the delegate's
property. Otherwise it will fall back to the asking the delegate.
This class currently supports static actions only: no property changes from the delegate action
or this class are propagated. Consequently, calling
addPropertyChangeListener(PropertyChangeListener)
or
removePropertyChangeListener(PropertyChangeListener)
has no effect.
Field Summary |
---|
Fields inherited from interface javax.swing.Action |
---|
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON |
Constructor Summary | |
---|---|
DelegateAction(Action delegate)
Create a new delegate action delegating to the given delegate action. |
Method Summary | |
---|---|
void |
actionPerformed(ActionEvent e)
|
void |
addPropertyChangeListener(PropertyChangeListener listener)
|
Object |
getValue(String key)
Get the value for the given property key. |
boolean |
isEnabled()
|
void |
putValue(String key,
Object value)
Override the value for the given property key. |
void |
removeOverriddenProperty(String key)
Remove the overridden property for the given key. |
void |
removePropertyChangeListener(PropertyChangeListener listener)
|
void |
reset()
Reset all properties and the enabled state to the values of the delegate action. |
void |
setEnabled(boolean b)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DelegateAction(Action delegate)
delegate
- the delegateMethod Detail |
---|
public void actionPerformed(ActionEvent e)
actionPerformed
in interface ActionListener
public Object getValue(String key)
getValue
in interface Action
Action.getValue(java.lang.String)
public void putValue(String key, Object value)
putValue
in interface Action
Action.putValue(java.lang.String, java.lang.Object)
public void setEnabled(boolean b)
setEnabled
in interface Action
public boolean isEnabled()
isEnabled
in interface Action
public void addPropertyChangeListener(PropertyChangeListener listener)
addPropertyChangeListener
in interface Action
public void removePropertyChangeListener(PropertyChangeListener listener)
removePropertyChangeListener
in interface Action
public void removeOverriddenProperty(String key)
key
- public void reset()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |