Class 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 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

    Author:
    Scott Violet
    See Also:
    Action
    • Constructor Detail

      • UIAction

        public UIAction​(String name)