Package com.nomagic.magicdraw.actions
Class MDMenuAction
- java.lang.Object
-
- javax.swing.AbstractAction
-
- com.nomagic.actions.NMAction
-
- com.nomagic.actions.ActionsCategory
-
- com.nomagic.actions.MenuAction
-
- com.nomagic.magicdraw.actions.MDMenuAction
-
- All Implemented Interfaces:
com.nomagic.actions.ShortcutsNotCustomizable
,java.awt.event.ActionListener
,java.io.Serializable
,java.lang.Cloneable
,java.lang.Comparable
,java.util.EventListener
,javax.swing.Action
,javax.swing.event.MenuListener
,javax.swing.event.PopupMenuListener
@OpenApiAll public class MDMenuAction extends MenuAction implements com.nomagic.actions.ShortcutsNotCustomizable
This class represents special kind of action. It can behave as normal actions category, but has methods which informs action about menu selecting or deselecting.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class com.nomagic.actions.ActionsCategory
ACTIONS_PROPERTY, ADDED_ACTION_PROPERTY, CHANGE_ACTIONS_PROPERTY, DISABLE_IF_EMPTY, MAX_CATEGORY_ACTIONS, REMOVE_IF_EMPTY, REMOVED_ACTION_PROPERTY, USE_AS_SEPARATOR_IN_UI
-
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 MDMenuAction(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.MDMenuAction(java.lang.String id, java.lang.String name, javax.swing.KeyStroke stroke, java.lang.String group)
Constructs the action with given id, name, keystroke and group.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.MenuAction
menuCanceled, menuDeselected, menuSelected, popupMenuCanceled, popupMenuWillBecomeInvisible, popupMenuWillBecomeVisible
-
Methods inherited from class com.nomagic.actions.ActionsCategory
accept, actionPerformed, addAction, addAction, addActionNearTheGiven, addActions, breakActions, breakActions, breakActions, breakeActions, clone, createSeparatorCategory, forEach, forEachIncludingSelf, getAction, getActions, getActionsRecursively, getCategories, isDisplayHeader, isEmpty, isNested, isUseActionForDisable, removeAction, removeIf, setActions, setDisplayHeader, setNested, setUseActionForDisable, shallowClone, size, sort
-
Methods inherited from class com.nomagic.actions.NMAction
addPropertyChangeListener, addShortcut, addShotcut, addWeakPropertyChangeListener, compareTo, createMenuItem, equals, firePropertyChange, getCommandKey, getDescription, getGroup, getIcon, getID, getLargeIcon, getLargeOrSmallIcon, getMenuShortcutMaskAsString, getMnemonicKey, getName, getPropertyChangeListeners, getShortcuts, getSmallIcon, getSmallOrLargeIcon, getTinyIcon, hashCode, hasMenuShortcutMask, isIDGenerated, removePropertyChangeListener, removeShortcut, removeWeakPropertyChangeListener, setDescription, setGroup, setIcon, setLargeIcon, setMnemonicKey, setName, setShortcuts, setSmallIcon, setTinyIcon, toString
-
Methods inherited from class javax.swing.AbstractAction
getKeys, getValue, isEnabled, putValue, setEnabled
-
-
-
-
Constructor Detail
-
MDMenuAction
public MDMenuAction(@CheckForNull java.lang.String id, java.lang.String name, @CheckForNull javax.swing.KeyStroke stroke, @CheckForNull java.lang.String group)
Constructs the action with given id, name, keystroke and group.- Parameters:
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.
-
MDMenuAction
public MDMenuAction(@CheckForNull 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.- 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
-
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
-
-