Class SpecificationDialogManager

  • All Implemented Interfaces:
    ProjectEventListener

    @OpenApi
    public final class SpecificationDialogManager
    extends ProjectEventListenerAdapter
    The manager of specification windows for all types of model elements. This manager knows exactly what specification dialog to open for every specific element.
    • Field Detail

      • valueOwnerEditors

        private java.util.List<com.nomagic.magicdraw.ui.dialogs.specifications.panels.slots.ValueOwnerEditor> valueOwnerEditors
      • valueOwnerEditorConfigurators

        private final java.util.List<com.nomagic.magicdraw.ui.dialogs.specifications.panels.slots.ValueOwnerEditorConfigurator> valueOwnerEditorConfigurators
      • dialogs

        private final java.util.Map<Project,​java.util.Map<Element,​com.nomagic.magicdraw.ui.dialogs.specifications.SpecificationDialog>> dialogs
      • modalDialogs

        private final java.util.List<com.nomagic.magicdraw.ui.dialogs.specifications.SpecificationDialog> modalDialogs
      • mComponentFactoryCreators

        private final java.util.List<com.nomagic.magicdraw.ui.dialogs.specifications.panels.SpecificationGeneralComponentFactoryCreator> mComponentFactoryCreators
        Registered specification general component factory creators
      • openModalMode

        private static volatile com.nomagic.magicdraw.ui.dialogs.specifications.SpecificationDialogManager.OpenMode openModalMode
    • Constructor Detail

      • SpecificationDialogManager

        private SpecificationDialogManager()
    • Method Detail

      • setOpenModalMode

        public static com.nomagic.magicdraw.ui.dialogs.specifications.SpecificationDialogManager.OpenMode setOpenModalMode​(com.nomagic.magicdraw.ui.dialogs.specifications.SpecificationDialogManager.OpenMode value)
      • addElementValueEditors

        private void addElementValueEditors()
      • getManager

        @OpenApi
        public static SpecificationDialogManager getManager()
        Returns shared instance of this manager.
        Returns:
        instance of this manager.
      • registeredSpecificationGeneralComponentFactoryCreators

        public java.util.Iterator<com.nomagic.magicdraw.ui.dialogs.specifications.panels.SpecificationGeneralComponentFactoryCreator> registeredSpecificationGeneralComponentFactoryCreators()
        Returns iterator of registered specification general factory creators
        Returns:
        iterator
      • addSpecificationGeneralComponentFactoryCreator

        public final void addSpecificationGeneralComponentFactoryCreator​(com.nomagic.magicdraw.ui.dialogs.specifications.panels.SpecificationGeneralComponentFactoryCreator factoryCreator)
        Adds component factory creator
        Parameters:
        factoryCreator - creator
      • editSpecification

        @OpenApi
        public void editSpecification​(Element element)
        Opens specification dialog for given ModelElement. Dialog is not modal.
        Parameters:
        element - the given Element.
      • editSpecification

        @OpenApi
        public void editSpecification​(Element element,
                                      boolean modal)
        Opens specification dialog for given ModelElement.
        Parameters:
        element - the given Element.
        modal - open modal specification window
      • editSpecification

        @OpenApi
        public void editSpecification​(SpecificationRecord record)
        Opens non-modal specification dialog activated pane specified by record.
        Parameters:
        record - specification dialog record containing a reference to element and pane to activate
      • editSpecification

        @OpenApi
        public void editSpecification​(SpecificationRecord record,
                                      boolean modal)
        Opens specification dialog and activated pane specified by record.
        Parameters:
        record - specification dialog record containing a reference to element and pane to activate
        modal - open modal specification window
      • addValueOwnerEditor

        public void addValueOwnerEditor​(com.nomagic.magicdraw.ui.dialogs.specifications.panels.slots.ValueOwnerEditor editor)
      • removeValueOwnerEditor

        public void removeValueOwnerEditor​(com.nomagic.magicdraw.ui.dialogs.specifications.panels.slots.ValueOwnerEditor editor)
      • getValueOwnerEditor

        @CheckForNull
        public com.nomagic.magicdraw.ui.dialogs.specifications.panels.slots.ValueOwnerEditor getValueOwnerEditor​(com.nomagic.magicdraw.ui.dialogs.specifications.panels.slots.ValueOwnerWrapper valueOwnerWrapper)
      • putDialog

        private void putDialog​(com.nomagic.magicdraw.ui.dialogs.specifications.SpecificationDialog dialog,
                               Element element)
      • getProjectDialogs

        public java.util.Map<Element,​com.nomagic.magicdraw.ui.dialogs.specifications.SpecificationDialog> getProjectDialogs​(Project project,
                                                                                                                                  boolean create)
      • getDialog

        @CheckForNull
        public com.nomagic.magicdraw.ui.dialogs.specifications.SpecificationDialog getDialog​(Element element)
      • getSimpleBaseDialog

        @CheckForNull
        public com.nomagic.ui.SimpleBaseDialog getSimpleBaseDialog​(Element element)
      • createDialog

        private com.nomagic.magicdraw.ui.dialogs.specifications.SpecificationDialog createDialog​(SpecificationRecord record,
                                                                                                 boolean modal)
      • reuseDialog

        public void reuseDialog​(com.nomagic.magicdraw.ui.dialogs.specifications.SpecificationDialog dialog,
                                Element element)
      • removeDialog

        private void removeDialog​(com.nomagic.magicdraw.ui.dialogs.specifications.SpecificationDialog dialog,
                                  Project project)
      • closeDialog

        public void closeDialog​(com.nomagic.magicdraw.ui.dialogs.specifications.SpecificationDialog dialog,
                                Project project)
      • addConfigurator

        @OpenApi
        public void addConfigurator​(java.lang.Class<?> elementClass,
                                    ISpecificationNodeConfigurator configurator)
        Adds specification node configurator for given Element type
        Parameters:
        elementClass - the specific class of Element(for example com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Classifier)
        configurator - the given configurator.
      • removeConfigurator

        @OpenApi
        public void removeConfigurator​(java.lang.Class<?> elementClass,
                                       ISpecificationNodeConfigurator configurator)
        Removes specification dialog node configurator for given Element type.
        Parameters:
        elementClass - the specific class of Element(for example com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Classifier)
        configurator - the given configurator.
      • configure

        public void configure​(com.nomagic.magicdraw.ui.dialogs.specifications.tree.node.SpecificationNode node,
                              Element element)
      • disposeDialogs

        public void disposeDialogs​(Project project)
        Closes all specification dialogs opened in particular project. Method is used for performance testing purposes (SpecificationDialogPerformanceTest).
        Parameters:
        project - project
      • disposeModalDialogs

        private void disposeModalDialogs()
      • updateDialogs

        public final void updateDialogs()
      • getTitleCreator

        @OpenApi
        public SpecificationTitleCreator getTitleCreator()
        Returns current specification dialog title creator.
        Returns:
        title creator
      • setTitleCreator

        @OpenApi
        public final void setTitleCreator​(SpecificationTitleCreator titleCreator)
        Sets specification dialog title creator
        Parameters:
        titleCreator - title creator.
      • getValueOwnerEditors

        private java.util.Collection<com.nomagic.magicdraw.ui.dialogs.specifications.panels.slots.ValueOwnerEditor> getValueOwnerEditors()
      • invokeOnDialogs

        private void invokeOnDialogs​(Project project,
                                     java.util.function.Consumer<com.nomagic.magicdraw.ui.dialogs.specifications.SpecificationDialog> invoker)
      • getValueOwnerEditorConfigurators

        public java.util.List<com.nomagic.magicdraw.ui.dialogs.specifications.panels.slots.ValueOwnerEditorConfigurator> getValueOwnerEditorConfigurators()
      • addValueOwnerEditorConfigurator

        public void addValueOwnerEditorConfigurator​(com.nomagic.magicdraw.ui.dialogs.specifications.panels.slots.ValueOwnerEditorConfigurator configurator)
      • removeValueOwnerEditorConfigurator

        public void removeValueOwnerEditorConfigurator​(com.nomagic.magicdraw.ui.dialogs.specifications.panels.slots.ValueOwnerEditorConfigurator configurator)