|
swingx Version 2009-07-31 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jdesktop.swingx.UIAction
public abstract class UIAction
UIAction is the basis of all of basic's action classes that are used in
an ActionMap. Subclasses need to override actionPerformed
.
A typical subclass will look like:
private static class Actions extends UIAction { Actions(String name) { super(name); } public void actionPerformed(ActionEvent ae) { if (getName() == "selectAll") { selectAll(); } else if (getName() == "cancelEditing") { cancelEditing(); } } }
Subclasses that wish to conditionalize the enabled state should override
isEnabled(Component)
, and be aware that the passed in
Component
may be null.
This is based on sun.swing.UIAction in J2SE 1.5
Action
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 | |
---|---|
UIAction(String name)
|
Method Summary | |
---|---|
void |
addPropertyChangeListener(PropertyChangeListener listener)
|
String |
getName()
|
Object |
getValue(String key)
|
boolean |
isEnabled()
Cover method for isEnabled(null) . |
boolean |
isEnabled(Object sender)
Subclasses that need to conditionalize the enabled state should override this. |
void |
putValue(String key,
Object value)
|
void |
removePropertyChangeListener(PropertyChangeListener listener)
|
void |
setEnabled(boolean b)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.awt.event.ActionListener |
---|
actionPerformed |
Constructor Detail |
---|
public UIAction(String name)
Method Detail |
---|
public final String getName()
public Object getValue(String key)
getValue
in interface Action
public void putValue(String key, Object value)
putValue
in interface Action
public void setEnabled(boolean b)
setEnabled
in interface Action
public final boolean isEnabled()
isEnabled(null)
.
isEnabled
in interface Action
public boolean isEnabled(Object sender)
sender
may be null.
sender
- Widget enabled state is being asked for, may be null.public void addPropertyChangeListener(PropertyChangeListener listener)
addPropertyChangeListener
in interface Action
public void removePropertyChangeListener(PropertyChangeListener listener)
removePropertyChangeListener
in interface Action
|
swingx Version 2009-07-31 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |