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,ActionListener,Serializable,Cloneable,Comparable,EventListener,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:
 
- 
Field Summary
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_ICONFields inherited from class javax.swing.AbstractAction
changeSupport, enabledFields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON - 
Constructor Summary
ConstructorsConstructorDescriptionSingleModelElementAction(String actionID, String actionName, KeyStroke stroke, String group) Constructor for ModelElementAction.SingleModelElementAction(String actionID, String actionName, KeyStroke stroke, String group, boolean useSchema) Constructor for ModelElementAction. - 
Method Summary
Modifier and TypeMethodDescriptionprotected ElementReturns data from selected node.Gets the provider.voidsetProvider(ModelElementProvider provider) Sets the provider.Methods inherited from class com.nomagic.magicdraw.actions.MDAction
actionPerformed, isUseShortcutSchema, updateStateMethods 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, toStringMethods inherited from class javax.swing.AbstractAction
getKeys, getValue, isEnabled, putValue, setEnabled 
- 
Constructor Details
- 
SingleModelElementAction
public SingleModelElementAction(@CheckForNull String actionID, @CheckForNull String actionName, @CheckForNull KeyStroke stroke, @CheckForNull String group) Constructor for ModelElementAction.- Parameters:
 actionID- action idactionName- action namestroke- strokegroup- group
 - 
SingleModelElementAction
public SingleModelElementAction(@CheckForNull String actionID, @CheckForNull String actionName, @CheckForNull KeyStroke stroke, @CheckForNull String group, boolean useSchema) Constructor for ModelElementAction.- Parameters:
 actionID- action idactionName- action namestroke- strokegroup- groupuseSchema- use shortcuts schema
 
 - 
 - 
Method Details
- 
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
Gets the provider.- Specified by:
 getProviderin interfaceISingleModelElementAction- Returns:
 - Returns a ModelElementProvider
 
 - 
setProvider
Sets the provider.- Specified by:
 setProviderin interfaceISingleModelElementAction- Parameters:
 provider- The provider to set
 
 -