Class SpecificationDialogManager

java.lang.Object
com.nomagic.magicdraw.core.project.ProjectEventListenerAdapter
com.nomagic.magicdraw.ui.dialogs.specifications.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.
  • Method Details

    • setOpenModalMode

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

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

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

      public 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)
      Choose editor by 3 criteria: value, type, priority. Most important - value, least important priority.
      Returns:
      most suitable editor for given value owner
    • getProjectDialogs

      public 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)
    • reuseDialog

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

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

      @OpenApi public void addConfigurator(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(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
    • updateDialogs

      public void updateDialogs()
    • getTitleCreator

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

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

      public void projectOpened(Project project)
      Description copied from interface: ProjectEventListener
      Method is called when project was opened, created or loaded from teamwork server. Opened project is active project and no projectActivated(Project) is called for this project.
      Specified by:
      projectOpened in interface ProjectEventListener
      Overrides:
      projectOpened in class ProjectEventListenerAdapter
      Parameters:
      project - project which was opened.
      See Also:
    • projectPreClosed

      public void projectPreClosed(Project project)
      Description copied from interface: ProjectEventListener
      Method is called before closing the project. Close operation has three steps - preClose, preCloseFinal and projectClosed. Project is not marked as "closing" in this step.
      Specified by:
      projectPreClosed in interface ProjectEventListener
      Overrides:
      projectPreClosed in class ProjectEventListenerAdapter
      Parameters:
      project - project which will be closed.
      See Also:
    • projectActivated

      public void projectActivated(Project project)
      Description copied from interface: ProjectEventListener
      Method is called when inactive project became active project.
      Specified by:
      projectActivated in interface ProjectEventListener
      Overrides:
      projectActivated in class ProjectEventListenerAdapter
      Parameters:
      project - new active project.
      See Also:
    • projectDeActivated

      public void projectDeActivated(Project project)
      Description copied from interface: ProjectEventListener
      Method is called when active project becomes not active.
      Specified by:
      projectDeActivated in interface ProjectEventListener
      Overrides:
      projectDeActivated in class ProjectEventListenerAdapter
      Parameters:
      project - inactive project.
      See Also:
    • getValueOwnerEditorConfigurators

      public 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)