Package com.nomagic.magicdraw.actions
Class MDStateAction
- java.lang.Object
-
- javax.swing.AbstractAction
-
- com.nomagic.actions.NMAction
-
- com.nomagic.actions.NMStateAction
-
- com.nomagic.magicdraw.actions.MDStateAction
-
- All Implemented Interfaces:
com.nomagic.magicdraw.actions.ShortcutSchemaAction
,java.awt.event.ActionListener
,java.io.Serializable
,java.lang.Cloneable
,java.lang.Comparable
,java.util.EventListener
,javax.swing.Action
- Direct Known Subclasses:
DefaultBrowserStateAction
,DefaultDiagramStateAction
@OpenApiAll public class MDStateAction extends NMStateAction implements com.nomagic.magicdraw.actions.ShortcutSchemaAction
The class describes the action for changing some boolean state. This action usesActionsGroupController
for checking enabled/disable state of assigned relative actions group(if it has some group).- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
useShortcutSchema
-
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 MDStateAction(java.lang.String id, java.lang.String name, int mnemonic, java.lang.String group)
Constructs the action with given id, name, mnemonic key and group.MDStateAction(java.lang.String id, java.lang.String name, javax.swing.KeyStroke stroke, java.lang.String group)
Creates the action with given id, name, key stroke, group.MDStateAction(java.lang.String id, java.lang.String name, javax.swing.KeyStroke stroke, java.lang.String group, boolean useShortcutSchema)
Creates the action with given id, name, key stroke, group.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
actionPerformed(java.awt.event.ActionEvent e)
Executes action.boolean
isUseShortcutSchema()
void
updateState()
If action has assigned relative group, takes enable flag value from this group and sets to itself.-
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
-
Methods inherited from class javax.swing.AbstractAction
getKeys, getValue, isEnabled, putValue, setEnabled
-
-
-
-
Constructor Detail
-
MDStateAction
public MDStateAction(@CheckForNull java.lang.String id, @CheckForNull java.lang.String name, @CheckForNull javax.swing.KeyStroke stroke, @CheckForNull java.lang.String group)
Creates the action with given id, name, key stroke, group.- Parameters:
id
- the id of the action.name
- the name of the action.stroke
- the KeyStroke of the actiongroup
- the name of the related commands group.
-
MDStateAction
public MDStateAction(@CheckForNull java.lang.String id, @CheckForNull java.lang.String name, @CheckForNull javax.swing.KeyStroke stroke, @CheckForNull java.lang.String group, boolean useShortcutSchema)
Creates the action with given id, name, key stroke, group.- Parameters:
id
- the id of the action.name
- the name of the action.stroke
- the KeyStroke of the actiongroup
- the name of the related commands group.useShortcutSchema
- use shortcuts schema
-
MDStateAction
public MDStateAction(@CheckForNull java.lang.String id, @CheckForNull java.lang.String name, int mnemonic, @CheckForNull java.lang.String group)
Constructs the action with given id, name, mnemonic key and group.- Parameters:
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.
-
-
Method Detail
-
actionPerformed
public void actionPerformed(@CheckForNull java.awt.event.ActionEvent e)
Executes action.- Specified by:
actionPerformed
in interfacejava.awt.event.ActionListener
- Overrides:
actionPerformed
in classNMStateAction
- Parameters:
e
- event caused execution.
-
updateState
public void updateState()
If action has assigned relative group, takes enable flag value from this group and sets to itself.- Overrides:
updateState
in classNMAction
-
isUseShortcutSchema
public boolean isUseShortcutSchema()
- Specified by:
isUseShortcutSchema
in interfacecom.nomagic.magicdraw.actions.ShortcutSchemaAction
-
-