APIdia Launch Partner
Top Description Fields Constructors Methods
sun.swing

public abstract Class UIAction

extends Object
implements Action
Class Inheritance
All Implemented Interfaces
javax.swing.Action, java.awt.event.ActionListener, java.util.EventListener
Known Direct Subclasses
javax.swing.TransferHandler.TransferAction, javax.swing.plaf.basic.BasicButtonListener.Actions, javax.swing.plaf.basic.BasicComboBoxUI.Actions, javax.swing.plaf.basic.BasicDesktopPaneUI.Actions, javax.swing.plaf.basic.BasicLabelUI.Actions, javax.swing.plaf.basic.BasicListUI.Actions, javax.swing.plaf.basic.BasicMenuBarUI.Actions, javax.swing.plaf.basic.BasicMenuItemUI.Actions, javax.swing.plaf.basic.BasicMenuUI.Actions, javax.swing.plaf.basic.BasicOptionPaneUI.Actions, javax.swing.plaf.basic.BasicPopupMenuUI.Actions, javax.swing.plaf.basic.BasicRootPaneUI.Actions, javax.swing.plaf.basic.BasicScrollBarUI.Actions, javax.swing.plaf.basic.BasicScrollPaneUI.Actions, javax.swing.plaf.basic.BasicSliderUI.Actions, javax.swing.plaf.basic.BasicSplitPaneUI.Actions, javax.swing.plaf.basic.BasicTabbedPaneUI.Actions, javax.swing.plaf.basic.BasicTableHeaderUI.Actions, javax.swing.plaf.basic.BasicTableUI.Actions, javax.swing.plaf.basic.BasicToolBarUI.Actions, javax.swing.plaf.basic.BasicTreeUI.Actions
Imports
java.beans.PropertyChangeListener, javax.swing.Action

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.

Author
Scott Violet
See Also
javax.swing.Action

Field Summary

Modifier and TypeField and Description
private String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean
accept(Object
Widget enabled state is being asked for, may be null.
sender
)

Overrides default javax.swing.Action.accept.

Subclasses that need to conditionalize the enabled state should override this.

public void
public final String
public Object
getValue(String key)

Implements javax.swing.Action.getValue.

Gets one of this object's properties using the associated key.

public final boolean
isEnabled()

Implements javax.swing.Action.isEnabled.

Cover method for isEnabled(null).

public void
putValue(String key, Object value)

Implements javax.swing.Action.putValue.

Sets one of this object's properties using the associated key.

public void
public void
setEnabled(boolean b)

Implements javax.swing.Action.setEnabled.

Sets the enabled state of the Action.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

nameback to summary
private String name

Constructor Detail

UIActionback to summary
public UIAction(String name)

Method Detail

acceptback to summary
public boolean accept(Object sender)

Overrides default javax.swing.Action.accept.

Subclasses that need to conditionalize the enabled state should override this. Be aware that sender may be null.

Parameters
sender:Object

Widget enabled state is being asked for, may be null.

Annotations
@Override
addPropertyChangeListenerback to summary
public void addPropertyChangeListener(PropertyChangeListener listener)

Implements javax.swing.Action.addPropertyChangeListener.

Doc from javax.swing.Action.addPropertyChangeListener.

Adds a PropertyChange listener. Containers and attached components use these methods to register interest in this Action object. When its enabled state or other property changes, the registered listeners are informed of the change.

getNameback to summary
public final String getName()
getValueback to summary
public Object getValue(String key)

Implements javax.swing.Action.getValue.

Doc from javax.swing.Action.getValue.

Gets one of this object's properties using the associated key.

isEnabledback to summary
public final boolean isEnabled()

Implements javax.swing.Action.isEnabled.

Cover method for isEnabled(null).

putValueback to summary
public void putValue(String key, Object value)

Implements javax.swing.Action.putValue.

Doc from javax.swing.Action.putValue.

Sets one of this object's properties using the associated key. If the value has changed, a PropertyChangeEvent is sent to listeners.

removePropertyChangeListenerback to summary
public void removePropertyChangeListener(PropertyChangeListener listener)

Implements javax.swing.Action.removePropertyChangeListener.

Doc from javax.swing.Action.removePropertyChangeListener.

Removes a PropertyChange listener.

setEnabledback to summary
public void setEnabled(boolean b)

Implements javax.swing.Action.setEnabled.

Doc from javax.swing.Action.setEnabled.

Sets the enabled state of the Action. When enabled, any component associated with this object is active and able to fire this object's actionPerformed method. If the value has changed, a PropertyChangeEvent is sent to listeners.