@OpenApiAll public abstract class NMStateAction extends NMAction
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DISTINGUISH
Property which means that state is not strict.
|
static java.lang.String |
GROUPED
Flag indicates that in group of NMStateActions only one action can have
"state" true (its radio buttons actions).
|
static java.lang.String |
STATE
The state property.
|
ACTION_SHORTCUTS, BELONGS_TO_SEPARATE_GROUP_IN_UI, DO_NO_SHOW_ACTION_NAME_IN_UI, GENERATED_ID_PREFIX, GROUP, ID, LARGE_ICON, MENU_SHORTCUT_MASK
Constructor and Description |
---|
NMStateAction(java.lang.String id,
java.lang.String name,
int mnemonic)
Constructs the action with given id, name, mnemonic key.
|
NMStateAction(java.lang.String id,
java.lang.String name,
int mnemonic,
java.lang.String group)
Constructs the action with given id, name, mnemonic key.
|
NMStateAction(java.lang.String id,
java.lang.String name,
javax.swing.KeyStroke stroke)
Creates action with given id, name, key stroke.
|
NMStateAction(java.lang.String id,
java.lang.String name,
javax.swing.KeyStroke stroke,
java.lang.String group)
Creates action with given id, name, key stroke.
|
Modifier and Type | Method and Description |
---|---|
void |
accept(ActionsVisitor visitor)
Accepts ActionsVisitor using Visitor design pattern.
|
void |
actionPerformed(java.awt.event.ActionEvent e)
Executes given action.
|
boolean |
getState()
Returns boolean state of this action.
|
boolean |
isDistinguish()
Return distinguish property.
|
boolean |
isGrouped()
Return grouped property value.
|
void |
setDistinguish(boolean dist)
Sets new distinguish property.
|
void |
setGrouped(boolean grouped)
Sets new grouped property value.
|
void |
setState(boolean state)
Sets action boolean state.
|
addAction, addPropertyChangeListener, addShortcut, addShotcut, addWeakPropertyChangeListener, clone, compareTo, createMenuItem, equals, firePropertyChange, getActions, getCommandKey, getDescription, getGroup, getIcon, getID, getLargeIcon, getLargeOrSmallIcon, getMnemonicKey, getName, getPropertyChangeListeners, getShortcuts, getSmallIcon, getSmallOrLargeIcon, hashCode, isIDGenerated, removeAction, removePropertyChangeListener, removeShortcut, removeWeakPropertyChangeListener, setActions, setDescription, setGroup, setLargeIcon, setMnemonicKey, setName, setShortcuts, setSmallIcon, shallowClone, toString, updateState
public static final java.lang.String STATE
public static final java.lang.String GROUPED
public static final java.lang.String DISTINGUISH
public NMStateAction(@CheckForNull java.lang.String id, @CheckForNull java.lang.String name, @CheckForNull javax.swing.KeyStroke stroke, @CheckForNull java.lang.String group)
id
- the id of the action.name
- the name of the action.stroke
- the key stroke of the actiongroup
- the name of the related commands group.public NMStateAction(@CheckForNull java.lang.String id, @CheckForNull java.lang.String name, int mnemonic, @CheckForNull java.lang.String group)
id
- the id of the action.name
- the name of the action.mnemonic
- the mnemonic key of the actiongroup
- the name of the related commands group.public NMStateAction(@CheckForNull java.lang.String id, @CheckForNull java.lang.String name, @CheckForNull javax.swing.KeyStroke stroke)
id
- the id of the action.name
- the name of the action.stroke
- the key stroke of the actionpublic NMStateAction(@CheckForNull java.lang.String id, @CheckForNull java.lang.String name, int mnemonic)
id
- the id of the action.name
- the name of the action.mnemonic
- the mnemonic key of the actionpublic void setState(boolean state)
state
- new state of action.public boolean getState()
public boolean isGrouped()
public void setGrouped(boolean grouped)
grouped
- new value of grouped flag.public boolean isDistinguish()
public void setDistinguish(boolean dist)
dist
- new value which specifies if state is strict or not.public void accept(ActionsVisitor visitor)
public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed
in interface java.awt.event.ActionListener
actionPerformed
in class NMAction
e
- event caused execution.