Package io.github.jonestimd.swing.action
Class LocalizedAction
- java.lang.Object
-
- javax.swing.AbstractAction
-
- io.github.jonestimd.swing.action.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.AbstractActionAn 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 classLocalizedAction.FactoryA factory class for creating multiple actions using the sameResourceBundleand a common resource prefix.
-
Constructor Summary
Constructors Constructor Description LocalizedAction(java.util.ResourceBundle bundle, java.lang.String keyPrefix)Create an action using anActionListener.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static javax.swing.Actioncreate(java.util.ResourceBundle bundle, java.lang.String keyPrefix, java.awt.event.ActionListener handler)Create an action using anActionListener.-
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
-
-
-
Constructor Detail
-
LocalizedAction
public LocalizedAction(java.util.ResourceBundle bundle, java.lang.String keyPrefix)Create an action using anActionListener.- 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 anActionListener.- 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.
-
-