Package org.jdesktop.swingx.plaf
Class UIAction
- java.lang.Object
-
- org.jdesktop.swingx.plaf.UIAction
-
- All Implemented Interfaces:
java.awt.event.ActionListener,java.util.EventListener,javax.swing.Action
- Direct Known Subclasses:
BasicXListUI.Actions,JXEditorPane.Actions,JXTable.Actions,JXTree.Actions,JXTreeTable.Actions
public abstract class UIAction extends java.lang.Object implements javax.swing.ActionUIAction 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
- See Also:
Action
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Stringname
-
Constructor Summary
Constructors Constructor Description UIAction(java.lang.String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddPropertyChangeListener(java.beans.PropertyChangeListener listener)java.lang.StringgetName()java.lang.ObjectgetValue(java.lang.String key)booleanisEnabled()Cover method forisEnabled(null).booleanisEnabled(java.lang.Object sender)Subclasses that need to conditionalize the enabled state should override this.voidputValue(java.lang.String key, java.lang.Object value)voidremovePropertyChangeListener(java.beans.PropertyChangeListener listener)voidsetEnabled(boolean b)
-
-
-
Method Detail
-
getName
public final java.lang.String getName()
-
getValue
public java.lang.Object getValue(java.lang.String key)
- Specified by:
getValuein interfacejavax.swing.Action
-
putValue
public void putValue(java.lang.String key, java.lang.Object value)- Specified by:
putValuein interfacejavax.swing.Action
-
setEnabled
public void setEnabled(boolean b)
- Specified by:
setEnabledin interfacejavax.swing.Action
-
isEnabled
public final boolean isEnabled()
Cover method forisEnabled(null).- Specified by:
isEnabledin interfacejavax.swing.Action
-
isEnabled
public boolean isEnabled(java.lang.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(java.beans.PropertyChangeListener listener)
- Specified by:
addPropertyChangeListenerin interfacejavax.swing.Action
-
removePropertyChangeListener
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
- Specified by:
removePropertyChangeListenerin interfacejavax.swing.Action
-
-