Class LocalizedAction

  • All Implemented Interfaces:
    java.awt.event.ActionListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, javax.swing.Action
    Direct Known Subclasses:
    AddRowAction, BackgroundAction, DialogAction, FrameAction

    public abstract class LocalizedAction
    extends javax.swing.AbstractAction
    An abstract class for an action that is configured using values from a resource bundle. The following values are used from the resource bundle:
    • keyPrefix + ".mnemonicAndName" (optional)
      • First character provides the mnemonic
      • Remainder provides the name
    • keyPrefix + ".iconImage" (optional, path to image resource)
    • keyPrefix + ".accelerator" (optional, keystroke string)
    See Also:
    Serialized Form
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  LocalizedAction.Factory
      A factory class for creating multiple actions using the same ResourceBundle and a common resource prefix.
    • 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
      LocalizedAction​(java.util.ResourceBundle bundle, java.lang.String keyPrefix)
      Create an action using an ActionListener.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static javax.swing.Action create​(java.util.ResourceBundle bundle, java.lang.String keyPrefix, java.awt.event.ActionListener handler)
      Create an action using an ActionListener.
      • 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
      • Methods inherited from interface javax.swing.Action

        accept
      • Methods inherited from interface java.awt.event.ActionListener

        actionPerformed
    • Constructor Detail

      • LocalizedAction

        public LocalizedAction​(java.util.ResourceBundle bundle,
                               java.lang.String keyPrefix)
        Create an action using an ActionListener.
        Parameters:
        bundle - the resource bundle containing the action's properties.
        keyPrefix - the key prefix for the action's property resources.
    • Method Detail

      • create

        public static javax.swing.Action create​(java.util.ResourceBundle bundle,
                                                java.lang.String keyPrefix,
                                                java.awt.event.ActionListener handler)
        Create an action using an ActionListener.
        Parameters:
        bundle - the resource bundle containing the action's properties.
        keyPrefix - the key prefix for the action's property resources.
        handler - the action listener to invoke when the action is performed.