ur_rna.Utilities.swing

## Class UiAction

- java.lang.Object
- - javax.swing.AbstractAction
  - - ur_rna.Utilities.swing.UiAction

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

      public class UiAction
      extends javax.swing.AbstractAction

  Extension of the swing `AbstractAction` class that accepts various methods of handling the action.
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private static java.awt.event.ActionListener[]` | `EMPTY_LISTENERS`
    `private java.awt.event.ActionListener` | `listener`
    `private java.util.Set<java.awt.event.ActionListener>` | `listeners`
    `static java.lang.String` | `TEXT_KEY`

    - ### 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 and Description
    `UiAction(java.lang.String name, java.awt.event.ActionListener listener)`
    `UiAction(java.lang.String name, java.awt.event.ActionListener listener, javax.swing.Icon icon)`
    `UiAction(java.lang.String name, java.lang.Runnable runnable)`
    `UiAction(java.lang.String name, java.lang.Runnable runnable, javax.swing.Icon icon)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `actionPerformed(java.awt.event.ActionEvent e)`
    `void` | `addListener(java.awt.event.ActionListener newListener)` Add an ActionListener to be notified when this Action is invoked.
    `java.lang.String` | `command()`
    `java.lang.String` | `desc()`
    `static java.lang.String` | `getCommand(javax.swing.Action a)`
    `static java.lang.String` | `getDesc(javax.swing.Action a)`
    `static javax.swing.Icon` | `getIcon(javax.swing.Action a)`
    `static javax.swing.KeyStroke` | `getKeyStroke(javax.swing.Action a)`
    `java.awt.event.ActionListener` | `getListener()` Get the main listener (which is usually specified in the constructor).
    `java.awt.event.ActionListener[]` | `getListeners()` Get a list of all listeners of this action, including the main listener (which is usually specified in the constructor).
    `static int` | `getMnemonic(javax.swing.Action a)`
    `static java.lang.String` | `getName(javax.swing.Action a)`
    `javax.swing.Icon` | `icon()`
    `void` | `invoke(java.lang.Object source)`
    `void` | `invoke(java.lang.Object source, java.lang.String command)`
    `static boolean` | `isSelected(javax.swing.Action a)`
    `javax.swing.KeyStroke` | `keyStroke()`
    `int` | `mnemonic()`
    `java.lang.String` | `name()` Get the name of this Action.
    `void` | `removeListener(java.awt.event.ActionListener existingListener)` Remove an ActionListener that should no longer be notified when this Action is invoked.
    `UiAction` | `setCommand(java.lang.String actionCommand)`
    `UiAction` | `setDesc(java.lang.String desc)`
    `UiAction` | `setIcon(javax.swing.Icon value)`
    `UiAction` | `setIcon(java.awt.Image value)`
    `UiAction` | `setKeyStroke(char keyChar)`
    `UiAction` | `setKeyStroke(javax.swing.KeyStroke keyStroke)`
    `UiAction` | `setKeyStroke(java.lang.String keyString)`
    `UiAction` | `setLongDesc(java.lang.String desc)`
    `UiAction` | `setMnemonic(int value)`
    `UiAction` | `setName(java.lang.String text)`
    `static void` | `setSelected(javax.swing.Action a, boolean selected)`

    - ### Methods inherited from class javax.swing.AbstractAction

      `addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled`

    - ### Methods inherited from class java.lang.Object

      `equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### EMPTY_LISTENERS

          private static java.awt.event.ActionListener[] EMPTY_LISTENERS

    - #### listener

          private java.awt.event.ActionListener listener

    - #### listeners

          private java.util.Set<java.awt.event.ActionListener> listeners

    - #### TEXT_KEY

          public static final java.lang.String TEXT_KEY

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### UiAction

          public UiAction(@Nullable
                          java.lang.String name,
                          @Nullable
                          java.awt.event.ActionListener listener)

    - #### UiAction

          public UiAction(@Nullable
                          java.lang.String name,
                          @Nullable
                          java.awt.event.ActionListener listener,
                          @Nullable
                          javax.swing.Icon icon)

    - #### UiAction

          public UiAction(@Nullable
                          java.lang.String name,
                          @NotNull
                          java.lang.Runnable runnable)

    - #### UiAction

          public UiAction(@Nullable
                          java.lang.String name,
                          @NotNull
                          java.lang.Runnable runnable,
                          @Nullable
                          javax.swing.Icon icon)

  - ### Method Detail

    - #### actionPerformed

          public void actionPerformed(java.awt.event.ActionEvent e)

    - #### addListener

          public void addListener(java.awt.event.ActionListener newListener)

      Add an ActionListener to be notified when this Action is invoked.
      Parameters:
        `newListener` - The ActionListener to add.

    - #### command

          public java.lang.String command()

    - #### desc

          public java.lang.String desc()

    - #### getCommand

          public static java.lang.String getCommand(javax.swing.Action a)

    - #### getDesc

          public static java.lang.String getDesc(javax.swing.Action a)

    - #### getIcon

          public static javax.swing.Icon getIcon(javax.swing.Action a)

    - #### getKeyStroke

          public static javax.swing.KeyStroke getKeyStroke(javax.swing.Action a)

    - #### getListener

          public java.awt.event.ActionListener getListener()

      Get the main listener (which is usually specified in the constructor).

    - #### getListeners

          public java.awt.event.ActionListener[] getListeners()

      Get a list of all listeners of this action, including the main listener (which is usually specified in the constructor).

    - #### getMnemonic

          public static int getMnemonic(javax.swing.Action a)

    - #### getName

          public static java.lang.String getName(javax.swing.Action a)

    - #### icon

          public javax.swing.Icon icon()

    - #### invoke

          public void invoke(java.lang.Object source)

    - #### invoke

          public void invoke(java.lang.Object source,
                             java.lang.String command)

    - #### isSelected

          public static boolean isSelected(javax.swing.Action a)

    - #### keyStroke

          public javax.swing.KeyStroke keyStroke()

    - #### mnemonic

          public int mnemonic()

    - #### name

          public java.lang.String name()

      Get the name of this Action. This is the same as `getValue(Action.NAME)` if that property has been set to a String.

    - #### removeListener

          public void removeListener(java.awt.event.ActionListener existingListener)

      Remove an ActionListener that should no longer be notified when this Action is invoked.
      Parameters:
        `existingListener` - The ActionListener to remove.

    - #### setCommand

          public UiAction setCommand(java.lang.String actionCommand)

    - #### setDesc

          public UiAction setDesc(java.lang.String desc)

    - #### setIcon

          public UiAction setIcon(javax.swing.Icon value)

    - #### setIcon

          public UiAction setIcon(java.awt.Image value)

    - #### setKeyStroke

          public UiAction setKeyStroke(char keyChar)

    - #### setKeyStroke

          public UiAction setKeyStroke(javax.swing.KeyStroke keyStroke)

    - #### setKeyStroke

          public UiAction setKeyStroke(java.lang.String keyString)

    - #### setLongDesc

          public UiAction setLongDesc(java.lang.String desc)

    - #### setMnemonic

          public UiAction setMnemonic(int value)

    - #### setName

          public UiAction setName(java.lang.String text)

    - #### setSelected

          public static void setSelected(javax.swing.Action a,
                                         boolean selected)