Package org.jdesktop.swingx
Class UIAction
- java.lang.Object
-
- org.jdesktop.swingx.UIAction
-
- All Implemented Interfaces:
ActionListener,EventListener,Action
public abstract class UIAction extends Object implements Action
UIAction is the basis of all of basic's action classes that are used in an ActionMap. Subclasses need to overrideactionPerformed.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 inComponentmay be null.This is based on sun.swing.UIAction in J2SE 1.5
- Author:
- Scott Violet
- See Also:
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
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddPropertyChangeListener(PropertyChangeListener listener)StringgetName()ObjectgetValue(String key)booleanisEnabled()Cover method forisEnabled(null).booleanisEnabled(Object sender)Subclasses that need to conditionalize the enabled state should override this.voidputValue(String key, Object value)voidremovePropertyChangeListener(PropertyChangeListener listener)voidsetEnabled(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
-
UIAction
public UIAction(String name)
-
-
Method Detail
-
getName
public final String getName()
-
setEnabled
public void setEnabled(boolean b)
- Specified by:
setEnabledin interfaceAction
-
isEnabled
public final boolean isEnabled()
Cover method forisEnabled(null).
-
isEnabled
public boolean isEnabled(Object sender)
Subclasses that need to conditionalize the enabled state should override this. Be aware thatsendermay be null.- Parameters:
sender- Widget enabled state is being asked for, may be null.
-
addPropertyChangeListener
public void addPropertyChangeListener(PropertyChangeListener listener)
- Specified by:
addPropertyChangeListenerin interfaceAction
-
removePropertyChangeListener
public void removePropertyChangeListener(PropertyChangeListener listener)
- Specified by:
removePropertyChangeListenerin interfaceAction
-
-