Class NamedAction

  • All Implemented Interfaces:
    java.awt.event.ActionListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, javax.swing.Action

    public abstract class NamedAction
    extends javax.swing.AbstractAction
    The abstract class NamedAction is derived from AbstractAction and provides an additional instance variable called name. Thus it is possible to identify an Action by its name.
    Version:
    $Revision: 1.1 $
    Author:
    Simone Leonardi
    See Also:
    Serialized Form
    • Field Summary

      • Fields inherited from class javax.swing.AbstractAction

        changeSupport, enabled
      • 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
    • Constructor Summary

      Constructors 
      Constructor Description
      NamedAction​(java.lang.String n)
      Creates a new NamedAction instance.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract void actionPerformed​(java.awt.event.ActionEvent e)
      Invoked when an action occurs.
      java.lang.String getName()
      Returns the name of the Action object.
      • Methods inherited from class javax.swing.AbstractAction

        addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
      • Methods inherited from interface javax.swing.Action

        accept
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • NamedAction

        public NamedAction​(java.lang.String n)
        Creates a new NamedAction instance.
        Parameters:
        n - the name by which the action can be identified
    • Method Detail

      • getName

        public java.lang.String getName()
        Returns the name of the Action object.
        Returns:
        the value of the variable name
      • actionPerformed

        public abstract void actionPerformed​(java.awt.event.ActionEvent e)
        Invoked when an action occurs. The method actionPerformed must be implemented by the user of NamedAction.
        Parameters:
        e - an ActionEvent