Package com.nomagic.magicdraw.actions
Class ActionsProvider
- java.lang.Object
-
- com.nomagic.magicdraw.actions.ActionsProvider
-
@OpenApi public final class ActionsProvider extends java.lang.Object
The singleton class used for accessing actions in different parts (diagrams, browsers, main menu and etc.) of MagicDraw application.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ActionsManager
getCommandBarActions(AbstractDiagramPresentationElement diagram)
Returns actions of command bar for given diagram.static ActionsManager
getContainmentBrowserContextActions(BrowserTabTree tree)
Returns context actions manager for containment browser.ActionsManager
getContainmentBrowserShortcutsActions()
Returns actions manager for containment browser shortcuts.ActionsManager
getCreateDiagramDialogActions()
Creates, configures and returns diagram creation actions to display in Create Diagram dialog (action in main menu and main toolbar)ActionsCreator
getCreator()
Returns instance of actions creator.ActionsManager
getDiagramCommandBarActions(java.lang.String diagramType)
Returns actions of command bar for given diagram type.ActionsManager
getDiagramContextActions(java.lang.String diagramType, DiagramPresentationElement diagram, PresentationElement[] selected, PresentationElement requester)
Returns context AM for given diagram type.ActionsManager
getDiagramContextToolbarActions(java.lang.String diagramType, PresentationElement requester)
Returns context AM for given diagram type.static ActionsManager
getDiagramsBrowserContextActions(BrowserTabTree tree)
Returns context actions manager for diagrams browser.ActionsManager
getDiagramsBrowserShortcutsActions()
Returns actions manager for diagrams browser shortcuts.ActionsManager
getDiagramShortcutActions(AbstractDiagramPresentationElement diagram)
Returns AM for given diagramActionsManager
getDiagramShortcutActions(java.lang.String diagramType)
Returns AM for given diagram type shortcuts.DiagramToolbarConfiguration
getDiagramToolbarConfiguration(java.lang.String diagramType)
Returns AM for diagram toolbar.static ActionsManager
getExtensionsBrowserContextActions(BrowserTabTree tree)
Returns context actions manager for containment browser.ActionsManager
getExtensionsBrowserShortcutsActions()
Returns shortcuts actions manager for inheritance browser.static ActionsManager
getInheritanceBrowserContextActions(BrowserTabTree tree)
Returns context actions manager for inheritance browser.ActionsManager
getInheritanceBrowserShortcutsActions()
Returns shortcuts actions manager for inheritance browser.static ActionsProvider
getInstance()
Returns single instance of this class.ActionsManager
getLockViewBrowserShortcutsActions()
Returns shortcuts actions manager for inheritance browser.ActionsManager
getMainMenuActions()
Returns actions manager for main menu actions.ActionsManager
getMainShortcutsActions()
Returns actions manager for main shortcuts.ActionsManager
getMainToolbarActions()
Returns manager with actions for main toolbar.static ActionsManager
getSearchBrowserContextActions(BrowserTabTree tree)
Returns context actions manager for search browser.ActionsManager
getSearchBrowserShortcutsActions()
Returns shortcuts actions manager for search browser.ActionsManager
getTargetElementAMActions(java.lang.String diagramType, PresentationElement requester, java.lang.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 Detail
-
getInstance
@OpenApi public static ActionsProvider getInstance()
Returns single instance of this class.- Returns:
- the instance of ActionsProvider.
-
getDiagramContextActions
@OpenApi public ActionsManager getDiagramContextActions(java.lang.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(java.lang.String diagramType, PresentationElement requester, java.lang.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(java.lang.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
@OpenApi public DiagramToolbarConfiguration getDiagramToolbarConfiguration(java.lang.String diagramType)
Returns AM for diagram toolbar.- Parameters:
diagramType
- diagram type- Returns:
- DiagramToolbarConfiguration object for specified diagram type.
-
getDiagramCommandBarActions
@OpenApi public ActionsManager getDiagramCommandBarActions(@CheckForNull java.lang.String diagramType)
Returns actions of command bar for given diagram type.- Parameters:
diagramType
- diagram type- Returns:
- manager with actions.
-
getCommandBarActions
@OpenApi public ActionsManager getCommandBarActions(AbstractDiagramPresentationElement diagram)
Returns actions of command bar for given diagram.- Parameters:
diagram
- diagram- Returns:
- manager with actions
-
getDiagramShortcutActions
@OpenApi public ActionsManager getDiagramShortcutActions(java.lang.String diagramType)
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
@OpenApi public ActionsManager getMainMenuActions()
Returns actions manager for main menu actions.- Returns:
- manager with actions.
-
getMainToolbarActions
@OpenApi public ActionsManager getMainToolbarActions()
Returns manager with actions for main toolbar.- Returns:
- manager with main toolbar actions.
-
getMainShortcutsActions
@OpenApi public ActionsManager getMainShortcutsActions()
Returns actions manager for main shortcuts.- Returns:
- manager with actions.
-
getContainmentBrowserContextActions
@OpenApi public static ActionsManager getContainmentBrowserContextActions(BrowserTabTree tree)
Returns context actions manager for containment browser.- Parameters:
tree
- instance of tree.- Returns:
- manager with actions.
-
getExtensionsBrowserContextActions
@OpenApi public static ActionsManager getExtensionsBrowserContextActions(BrowserTabTree tree)
Returns context actions manager for containment browser.- Parameters:
tree
- instance of tree.- Returns:
- manager with actions.
-
getSearchBrowserContextActions
@OpenApi public static ActionsManager getSearchBrowserContextActions(BrowserTabTree tree)
Returns context actions manager for search browser.- Parameters:
tree
- instance of tree.- Returns:
- manager with actions.
-
getDiagramsBrowserContextActions
@OpenApi public static ActionsManager getDiagramsBrowserContextActions(BrowserTabTree tree)
Returns context actions manager for diagrams browser.- Parameters:
tree
- instance of tree.- Returns:
- manager with actions.
-
getInheritanceBrowserContextActions
@OpenApi public static ActionsManager getInheritanceBrowserContextActions(BrowserTabTree tree)
Returns context actions manager for inheritance browser.- Parameters:
tree
- instance of tree.- Returns:
- manager with actions.
-
getContainmentBrowserShortcutsActions
@OpenApi public ActionsManager getContainmentBrowserShortcutsActions()
Returns actions manager for containment browser shortcuts.- Returns:
- manager with actions.
-
getDiagramsBrowserShortcutsActions
@OpenApi public ActionsManager getDiagramsBrowserShortcutsActions()
Returns actions manager for diagrams browser shortcuts.- Returns:
- manager with actions.
-
getInheritanceBrowserShortcutsActions
@OpenApi public ActionsManager getInheritanceBrowserShortcutsActions()
Returns shortcuts actions manager for inheritance browser.- Returns:
- manager with actions.
-
getLockViewBrowserShortcutsActions
@OpenApi public ActionsManager getLockViewBrowserShortcutsActions()
Returns shortcuts actions manager for inheritance browser.- Returns:
- manager with actions.
-
getExtensionsBrowserShortcutsActions
@OpenApi public ActionsManager getExtensionsBrowserShortcutsActions()
Returns shortcuts actions manager for inheritance browser.- Returns:
- manager with actions.
-
getSearchBrowserShortcutsActions
@OpenApi public ActionsManager getSearchBrowserShortcutsActions()
Returns shortcuts actions manager for search browser.- Returns:
- manager with actions.
-
getCreator
@OpenApi public ActionsCreator getCreator()
Returns instance of actions creator.- Returns:
- the actions creator.
-
getCreateDiagramDialogActions
@OpenApi public ActionsManager 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
@OpenApi public 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.
- Parameters:
action
- action to register.- See Also:
unregisterAction(com.nomagic.actions.NMAction)
-
unregisterAction
@OpenApi public void unregisterAction(NMAction action)
Remove the action as available in application.- Parameters:
action
- action to remove.- See Also:
registerAction(com.nomagic.actions.NMAction)
-
-