Package com.nomagic.actions
Class SelectionItem
- java.lang.Object
-
- javax.swing.AbstractAction
-
- com.nomagic.actions.NMAction
-
- com.nomagic.actions.NMStateAction
-
- com.nomagic.actions.SelectionItem
-
- All Implemented Interfaces:
ListItem
,java.awt.event.ActionListener
,java.io.Serializable
,java.lang.Cloneable
,java.lang.Comparable
,java.util.EventListener
,javax.swing.Action
@OpenApiAll public class SelectionItem extends NMStateAction implements ListItem
Simple action which when is performed sets property to its name. This action can be used to represent lists with selected values.- See Also:
SelectItemAction
, Serialized Form
-
-
Field Summary
-
Fields inherited from class com.nomagic.actions.NMStateAction
DISTINGUISH, GROUPED, STATE
-
Fields inherited from class com.nomagic.actions.NMAction
ACTION_SHORTCUTS, BELONGS_TO_SEPARATE_GROUP_IN_UI, DO_NO_SHOW_ACTION_NAME_IN_UI, DO_NOT_REGISTER_ACTION_TO_COMPONENTS, GENERATED_ID_PREFIX, GROUP, ID, LARGE_ICON, MENU_SHORTCUT_MASK, TINY_ICON
-
-
Constructor Summary
Constructors Constructor Description SelectionItem(java.lang.String id, java.lang.Object value, java.lang.String propertyName)
Creates new action.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
actionPerformed(java.awt.event.ActionEvent e)
Fires property change event with name this.propertyName and with new value this.value, and null old value.java.lang.Object
getValue()
Returns value of this action.-
Methods inherited from class com.nomagic.actions.NMStateAction
accept, getState, isDistinguish, isGrouped, isStateEvent, setDistinguish, setGrouped, setState
-
Methods inherited from class com.nomagic.actions.NMAction
addAction, addPropertyChangeListener, addShortcut, addShotcut, addWeakPropertyChangeListener, clone, compareTo, createMenuItem, equals, firePropertyChange, forEach, forEachIncludingSelf, getActions, getCommandKey, getDescription, getGroup, getIcon, getID, getLargeIcon, getLargeOrSmallIcon, getMenuShortcutMaskAsString, getMnemonicKey, getName, getPropertyChangeListeners, getShortcuts, getSmallIcon, getSmallOrLargeIcon, getTinyIcon, hashCode, hasMenuShortcutMask, isIDGenerated, removeAction, removeIf, removePropertyChangeListener, removeShortcut, removeWeakPropertyChangeListener, setActions, setDescription, setGroup, setIcon, setLargeIcon, setMnemonicKey, setName, setShortcuts, setSmallIcon, setTinyIcon, shallowClone, toString, updateState
-
Methods inherited from class javax.swing.AbstractAction
getKeys, getValue, isEnabled, putValue, setEnabled
-
-
-
-
Constructor Detail
-
SelectionItem
public SelectionItem(java.lang.String id, java.lang.Object value, java.lang.String propertyName)
Creates new action.- Parameters:
id
- action idvalue
- action value, action name is created from value.toString method.propertyName
- Property name of event which will be fired when this action will be executed.
-
-
Method Detail
-
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent e)
Fires property change event with name this.propertyName and with new value this.value, and null old value.- Specified by:
actionPerformed
in interfacejava.awt.event.ActionListener
- Overrides:
actionPerformed
in classNMStateAction
- Parameters:
e
- event caused execution.
-
-