Class 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 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 type
        diagram - 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 type
        requester - 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 type
        requester - 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.
      • getDiagramShortcutActions

        @OpenApi
        public ActionsManager getDiagramShortcutActions​(java.lang.String diagramType)
        Returns AM for given diagram type shortcuts.
        Parameters:
        diagramType - diagram type
        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)