Class SpecificationDialogManager
java.lang.Object
com.nomagic.magicdraw.core.project.ProjectEventListenerAdapter
com.nomagic.magicdraw.ui.dialogs.specifications.SpecificationDialogManager
- All Implemented Interfaces:
ProjectEventListener
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 Summary
Modifier and TypeMethodDescriptionvoidaddConfigurator(Class<?> elementClass, ISpecificationNodeConfigurator configurator) Adds specification node configurator for given Element typevoidaddSpecificationGeneralComponentFactoryCreator(com.nomagic.magicdraw.ui.dialogs.specifications.panels.SpecificationGeneralComponentFactoryCreator factoryCreator) Adds component factory creatorvoidaddValueOwnerEditor(com.nomagic.magicdraw.ui.dialogs.specifications.panels.slots.ValueOwnerEditor editor) voidaddValueOwnerEditorConfigurator(com.nomagic.magicdraw.ui.dialogs.specifications.panels.slots.ValueOwnerEditorConfigurator configurator) voidcloseDialog(com.nomagic.magicdraw.ui.dialogs.specifications.SpecificationDialog dialog, Project project) voidconfigure(com.nomagic.magicdraw.ui.dialogs.specifications.tree.node.SpecificationNode node, Element element) voiddisposeDialogs(Project project) Closes all specification dialogs opened in particular project.voideditSpecification(SpecificationRecord record) Opens non-modal specification dialog activated pane specified by record.voideditSpecification(SpecificationRecord record, boolean modal) Opens specification dialog and activated pane specified by record.voideditSpecification(Element element) Opens specification dialog for given ModelElement.voideditSpecification(Element element, boolean modal) Opens specification dialog for given ModelElement.com.nomagic.magicdraw.ui.dialogs.specifications.SpecificationDialogstatic SpecificationDialogManagerReturns shared instance of this manager.getProjectDialogs(Project project, boolean create) com.nomagic.ui.SimpleBaseDialoggetSimpleBaseDialog(Element element) Returns current specification dialog title creator.com.nomagic.magicdraw.ui.dialogs.specifications.panels.slots.ValueOwnerEditorgetValueOwnerEditor(com.nomagic.magicdraw.ui.dialogs.specifications.panels.slots.ValueOwnerWrapper valueOwnerWrapper) Choose editor by 3 criteria: value, type, priority.List<com.nomagic.magicdraw.ui.dialogs.specifications.panels.slots.ValueOwnerEditorConfigurator>voidprojectActivated(Project project) Method is called when inactive project became active project.voidprojectDeActivated(Project project) Method is called when active project becomes not active.voidprojectOpened(Project project) Method is called when project was opened, created or loaded from teamwork server.voidprojectPreClosed(Project project) Method is called before closing the project.Iterator<com.nomagic.magicdraw.ui.dialogs.specifications.panels.SpecificationGeneralComponentFactoryCreator>Returns iterator of registered specification general factory creatorsvoidremoveConfigurator(Class<?> elementClass, ISpecificationNodeConfigurator configurator) Removes specification dialog node configurator for given Element type.voidremoveValueOwnerEditor(com.nomagic.magicdraw.ui.dialogs.specifications.panels.slots.ValueOwnerEditor editor) voidremoveValueOwnerEditorConfigurator(com.nomagic.magicdraw.ui.dialogs.specifications.panels.slots.ValueOwnerEditorConfigurator configurator) voidreuseDialog(com.nomagic.magicdraw.ui.dialogs.specifications.SpecificationDialog dialog, Element element) static com.nomagic.magicdraw.ui.dialogs.specifications.SpecificationDialogManager.OpenModesetOpenModalMode(com.nomagic.magicdraw.ui.dialogs.specifications.SpecificationDialogManager.OpenMode value) voidsetTitleCreator(SpecificationTitleCreator titleCreator) Sets specification dialog title creatorvoidMethods inherited from class com.nomagic.magicdraw.core.project.ProjectEventListenerAdapter
projectActivatedFromGUI, projectClosed, projectCreated, projectOpenedFromGUI, projectPreActivated, projectPreClosedFinal, projectPreDeActivated, projectPreSaved, projectReplaced, projectSavedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.nomagic.magicdraw.core.project.ProjectEventListener
projectPreOpenedFromGUI, projectUsedFromGUI
-
Method Details
-
setOpenModalMode
public static com.nomagic.magicdraw.ui.dialogs.specifications.SpecificationDialogManager.OpenMode setOpenModalMode(com.nomagic.magicdraw.ui.dialogs.specifications.SpecificationDialogManager.OpenMode value) -
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
Opens specification dialog for given ModelElement. Dialog is not modal.- Parameters:
element- the given Element.
-
editSpecification
Opens specification dialog for given ModelElement.- Parameters:
element- the given Element.modal- open modal specification window
-
editSpecification
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
Opens specification dialog and activated pane specified by record.- Parameters:
record- specification dialog record containing a reference to element and pane to activatemodal- 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
-
getDialog
@CheckForNull public com.nomagic.magicdraw.ui.dialogs.specifications.SpecificationDialog getDialog(Element element) -
getSimpleBaseDialog
-
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
Closes all specification dialogs opened in particular project. Method is used for performance testing purposes (SpecificationDialogPerformanceTest).- Parameters:
project- project
-
updateDialogs
public void updateDialogs() -
getTitleCreator
Returns current specification dialog title creator.- Returns:
- title creator
-
setTitleCreator
Sets specification dialog title creator- Parameters:
titleCreator- title creator.
-
projectOpened
Description copied from interface:ProjectEventListenerMethod 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:
projectOpenedin interfaceProjectEventListener- Overrides:
projectOpenedin classProjectEventListenerAdapter- Parameters:
project- project which was opened.- See Also:
-
projectPreClosed
Description copied from interface:ProjectEventListenerMethod 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:
projectPreClosedin interfaceProjectEventListener- Overrides:
projectPreClosedin classProjectEventListenerAdapter- Parameters:
project- project which will be closed.- See Also:
-
projectActivated
Description copied from interface:ProjectEventListenerMethod is called when inactive project became active project.- Specified by:
projectActivatedin interfaceProjectEventListener- Overrides:
projectActivatedin classProjectEventListenerAdapter- Parameters:
project- new active project.- See Also:
-
projectDeActivated
Description copied from interface:ProjectEventListenerMethod is called when active project becomes not active.- Specified by:
projectDeActivatedin interfaceProjectEventListener- Overrides:
projectDeActivatedin classProjectEventListenerAdapter- 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)
-