Package com.nomagic.magicdraw.actions
Class ActionsProvider
java.lang.Object
com.nomagic.magicdraw.actions.ActionsProvider
The singleton class used for accessing actions in different parts (diagrams, browsers, main menu and etc.) of MagicDraw application.
-
Method Summary
Modifier and TypeMethodDescriptionReturns actions of command bar for given diagram.static ActionsManager
Returns context actions manager for containment browser.Returns actions manager for containment browser shortcuts.Creates, configures and returns diagram creation actions to display in Create Diagram dialog (action in main menu and main toolbar)Returns instance of actions creator.getDiagramCommandBarActions
(String diagramType) Returns actions of command bar for given diagram type.getDiagramContextActions
(String diagramType, DiagramPresentationElement diagram, PresentationElement[] selected, PresentationElement requester) Returns context AM for given diagram type.getDiagramContextToolbarActions
(String diagramType, PresentationElement requester) Returns context AM for given diagram type.static ActionsManager
Returns context actions manager for diagrams browser.Returns actions manager for diagrams browser shortcuts.Returns AM for given diagramgetDiagramShortcutActions
(String diagramType) Returns AM for given diagram type shortcuts.getDiagramToolbarConfiguration
(String diagramType) Returns AM for diagram toolbar.static ActionsManager
Returns context actions manager for containment browser.Returns shortcuts actions manager for inheritance browser.static ActionsManager
Returns context actions manager for inheritance browser.Returns shortcuts actions manager for inheritance browser.static ActionsProvider
Returns single instance of this class.Returns shortcuts actions manager for inheritance browser.Returns actions manager for main menu actions.Returns actions manager for main shortcuts.Returns manager with actions for main toolbar.static ActionsManager
Returns context actions manager for search browser.Returns shortcuts actions manager for search browser.getTargetElementAMActions
(String diagramType, PresentationElement requester, String pathActionID) Returns context AM for given diagram type.void
registerAction
(NMAction action) Registers the action as available in application - other components (such as Perspectives) should know what actions are available.
Action id must be stable/constant, It is not necessary to use the same action instance used when configuring appropriate menu/toolbar.void
unregisterAction
(NMAction action) Remove the action as available in application.
-
Method Details
-
getInstance
Returns single instance of this class.- Returns:
- the instance of ActionsProvider.
-
getDiagramContextActions
@OpenApi public ActionsManager getDiagramContextActions(String diagramType, DiagramPresentationElement diagram, PresentationElement[] selected, @CheckForNull PresentationElement requester) Returns context AM for given diagram type.- Parameters:
diagramType
- diagram typediagram
- the given diagram.selected
- array of selected symbols.requester
- symbol which requests actions, can be null if requester is diagram.- Returns:
- manager with actions.
-
getTargetElementAMActions
@OpenApi public ActionsManager getTargetElementAMActions(String diagramType, PresentationElement requester, String pathActionID) Returns context AM for given diagram type.- Parameters:
diagramType
- diagram typerequester
- symbol which requests actions, can be null if requester is diagram.pathActionID
- path action id- Returns:
- manager with actions.
-
getDiagramContextToolbarActions
@OpenApi public ActionsManager getDiagramContextToolbarActions(String diagramType, PresentationElement requester) Returns context AM for given diagram type.- Parameters:
diagramType
- diagram typerequester
- symbol which requests actions, can be null if requester is diagram.- Returns:
- manager with actions.
-
getDiagramToolbarConfiguration
Returns AM for diagram toolbar.- Parameters:
diagramType
- diagram type- Returns:
- DiagramToolbarConfiguration object for specified diagram type.
-
getDiagramCommandBarActions
Returns actions of command bar for given diagram type.- Parameters:
diagramType
- diagram type- Returns:
- manager with actions.
-
getCommandBarActions
Returns actions of command bar for given diagram.- Parameters:
diagram
- diagram- Returns:
- manager with actions
-
getDiagramShortcutActions
Returns AM for given diagram type shortcuts.- Parameters:
diagramType
- diagram type- Returns:
- manager with actions.
-
getDiagramShortcutActions
@OpenApi public ActionsManager getDiagramShortcutActions(AbstractDiagramPresentationElement diagram) Returns AM for given diagram- Parameters:
diagram
- diagram- Returns:
- manager with actions
-
getMainMenuActions
Returns actions manager for main menu actions.- Returns:
- manager with actions.
-
getMainToolbarActions
Returns manager with actions for main toolbar.- Returns:
- manager with main toolbar actions.
-
getMainShortcutsActions
Returns actions manager for main shortcuts.- Returns:
- manager with actions.
-
getContainmentBrowserContextActions
Returns context actions manager for containment browser.- Parameters:
tree
- instance of tree.- Returns:
- manager with actions.
-
getExtensionsBrowserContextActions
Returns context actions manager for containment browser.- Parameters:
tree
- instance of tree.- Returns:
- manager with actions.
-
getSearchBrowserContextActions
Returns context actions manager for search browser.- Parameters:
tree
- instance of tree.- Returns:
- manager with actions.
-
getDiagramsBrowserContextActions
Returns context actions manager for diagrams browser.- Parameters:
tree
- instance of tree.- Returns:
- manager with actions.
-
getInheritanceBrowserContextActions
Returns context actions manager for inheritance browser.- Parameters:
tree
- instance of tree.- Returns:
- manager with actions.
-
getContainmentBrowserShortcutsActions
Returns actions manager for containment browser shortcuts.- Returns:
- manager with actions.
-
getDiagramsBrowserShortcutsActions
Returns actions manager for diagrams browser shortcuts.- Returns:
- manager with actions.
-
getInheritanceBrowserShortcutsActions
Returns shortcuts actions manager for inheritance browser.- Returns:
- manager with actions.
-
getLockViewBrowserShortcutsActions
Returns shortcuts actions manager for inheritance browser.- Returns:
- manager with actions.
-
getExtensionsBrowserShortcutsActions
Returns shortcuts actions manager for inheritance browser.- Returns:
- manager with actions.
-
getSearchBrowserShortcutsActions
Returns shortcuts actions manager for search browser.- Returns:
- manager with actions.
-
getCreator
Returns instance of actions creator.- Returns:
- the actions creator.
-
getCreateDiagramDialogActions
Creates, configures and returns diagram creation actions to display in Create Diagram dialog (action in main menu and main toolbar)- Returns:
- manager with diagram creation actions
-
registerAction
Registers the action as available in application - other components (such as Perspectives) should know what actions are available.
- Action id must be stable/constant,
- It is not necessary to use the same action instance used when configuring appropriate menu/toolbar.
- Parameters:
action
- action to register.- See Also:
-
unregisterAction
Remove the action as available in application.- Parameters:
action
- action to remove.- See Also:
-