Class UIAction
java.lang.Object
org.jdesktop.swingx.plaf.UIAction
- All Implemented Interfaces:
ActionListener, EventListener, Action
- Direct Known Subclasses:
BasicXListUI.Actions, JXEditorPane.Actions, JXTable.Actions, JXTree.Actions, JXTreeTable.Actions
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
- See Also:
-
Field Summary
FieldsFields inherited from interface 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidfinal StringgetName()final booleanCover method forisEnabled(null).booleanSubclasses that need to conditionalize the enabled state should override this.voidvoidvoidsetEnabled(boolean b) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ActionListener
actionPerformed
-
Field Details
-
name
-
-
Constructor Details
-
UIAction
-
-
Method Details
-
getName
-
getValue
-
putValue
-
setEnabled
public void setEnabled(boolean b) - Specified by:
setEnabledin interfaceAction
-
isEnabled
-
isEnabled
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
- Specified by:
addPropertyChangeListenerin interfaceAction
-
removePropertyChangeListener
- Specified by:
removePropertyChangeListenerin interfaceAction
-