Class SingleModelElementAction
- java.lang.Object
-
- javax.swing.AbstractAction
-
- com.nomagic.actions.NMAction
-
- com.nomagic.magicdraw.actions.MDAction
-
- com.nomagic.magicdraw.uml.actions.SingleModelElementAction
-
- All Implemented Interfaces:
com.nomagic.magicdraw.actions.ShortcutSchemaAction
,ISingleModelElementAction
,java.awt.event.ActionListener
,java.io.Serializable
,java.lang.Cloneable
,java.lang.Comparable
,java.util.EventListener
,javax.swing.Action
- Direct Known Subclasses:
MultipleModelElementAction
@OpenApiAll public class SingleModelElementAction extends MDAction implements ISingleModelElementAction
Base class for actions to work with one model element selection.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private ModelElementProvider
mProvider
-
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 SingleModelElementAction(java.lang.String actionID, java.lang.String actionName, javax.swing.KeyStroke stroke, java.lang.String group)
Constructor for ModelElementAction.SingleModelElementAction(java.lang.String actionID, java.lang.String actionName, javax.swing.KeyStroke stroke, java.lang.String group, boolean useSchema)
Constructor for ModelElementAction.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Element
getElement()
Returns data from selected node.ModelElementProvider
getProvider()
Gets the provider.void
setProvider(ModelElementProvider provider)
Sets the provider.-
Methods inherited from class com.nomagic.magicdraw.actions.MDAction
actionPerformed, isUseShortcutSchema, updateState
-
Methods inherited from class com.nomagic.actions.NMAction
accept, 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
-
-
-
-
Field Detail
-
mProvider
private ModelElementProvider mProvider
-
-
Constructor Detail
-
SingleModelElementAction
public SingleModelElementAction(@CheckForNull java.lang.String actionID, @CheckForNull java.lang.String actionName, @CheckForNull javax.swing.KeyStroke stroke, @CheckForNull java.lang.String group)
Constructor for ModelElementAction.- Parameters:
actionID
- action idactionName
- action namestroke
- strokegroup
- group
-
SingleModelElementAction
public SingleModelElementAction(@CheckForNull java.lang.String actionID, @CheckForNull java.lang.String actionName, @CheckForNull javax.swing.KeyStroke stroke, @CheckForNull java.lang.String group, boolean useSchema)
Constructor for ModelElementAction.- Parameters:
actionID
- action idactionName
- action namestroke
- strokegroup
- groupuseSchema
- use shortcuts schema
-
-
Method Detail
-
getElement
@CheckForNull protected Element getElement()
Returns data from selected node. If there are no selected nodes, or more than one selected node returns null.- Returns:
- element or null
-
getProvider
public ModelElementProvider getProvider()
Gets the provider.- Specified by:
getProvider
in interfaceISingleModelElementAction
- Returns:
- Returns a ModelElementProvider
-
setProvider
public void setProvider(ModelElementProvider provider)
Sets the provider.- Specified by:
setProvider
in interfaceISingleModelElementAction
- Parameters:
provider
- The provider to set
-
-