Class AppsAction

  • All Implemented Interfaces:
    ActionListener, Serializable, Cloneable, EventListener, Action

    public final class AppsAction
    extends AbstractAction
    Application Action. Creates Action with MenuItem and Button, delegate execution of action to an attached ActionListener instance The ActionCommand is translated for display If translated text contains &, the next character is the Mnemonic
    Version:
    $Id: AppsAction.java,v 1.2 2006/07/30 00:51:27 jjanke Exp $
    Author:
    Jorg Janke
    See Also:
    Serialized Form
    • Field Detail

      • BUTTON_SIZE

        public static final Dimension BUTTON_SIZE
        Button Size
      • BUTTON_INSETS

        public static final Insets BUTTON_INSETS
        Button Insets
    • Constructor Detail

      • AppsAction

        public AppsAction​(String action,
                          KeyStroke accelerator,
                          boolean toggle)
        Application Action
        Parameters:
        action - base action command - used as AD_Message for Text and Icon name
        accelerator - optional keystroke for accelerator
        toggle - is toggle action (maintains state)
      • AppsAction

        public AppsAction​(String action,
                          KeyStroke accelerator,
                          String text)
        Application Action
        Parameters:
        action - base action command - used as AD_Message for Text and Icon name
        accelerator - optional keystroke for accelerator
        text - text, if null defered from action
      • AppsAction

        public AppsAction​(String action,
                          KeyStroke accelerator,
                          String toolTipText,
                          boolean toggle)
        Application Action
        Parameters:
        action - base action command - used as AD_Message for Text and Icon name
        accelerator - optional keystroke for accelerator
        toolTipText - text, if null defered from action
        toggle - is toggle action (maintains state)
    • Method Detail

      • getName

        public String getName()
        Get Name/ActionCommand
        Returns:
        ActionName
      • getButton

        public AbstractButton getButton()
        Return Button
        Returns:
        Button
      • getMenuItem

        public JMenuItem getMenuItem()
        Return MenuItem
        Returns:
        MenuItem
      • setDelegate

        public void setDelegate​(ActionListener al)
        Set Delegate to receive the actionPerformed calls
        Parameters:
        al - listener
      • setPressed

        public void setPressed​(boolean pressed)
        Toggle
        Parameters:
        pressed - pressed
      • isPressed

        public boolean isPressed()
        IsPressed
        Returns:
        true if pressed
      • getMnemonic

        public Character getMnemonic()
        Get Mnemonic character
        Returns:
        character
      • actionPerformed

        public void actionPerformed​(ActionEvent e)
        ActionListener
        Parameters:
        e - Event
      • dispose

        public void dispose()
        Dispose
      • toString

        public String toString()
        String Info
        Overrides:
        toString in class Object
        Returns:
        String Representation