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 TypeMethodDescriptionvoid
addConfigurator
(Class<?> elementClass, ISpecificationNodeConfigurator configurator) Adds specification node configurator for given Element typevoid
addSpecificationGeneralComponentFactoryCreator
(com.nomagic.magicdraw.ui.dialogs.specifications.panels.SpecificationGeneralComponentFactoryCreator factoryCreator) Adds component factory creatorvoid
addValueOwnerEditor
(com.nomagic.magicdraw.ui.dialogs.specifications.panels.slots.ValueOwnerEditor editor) void
addValueOwnerEditorConfigurator
(com.nomagic.magicdraw.ui.dialogs.specifications.panels.slots.ValueOwnerEditorConfigurator configurator) void
closeDialog
(com.nomagic.magicdraw.ui.dialogs.specifications.SpecificationDialog dialog, Project project) void
configure
(com.nomagic.magicdraw.ui.dialogs.specifications.tree.node.SpecificationNode node, Element element) void
disposeDialogs
(Project project) Closes all specification dialogs opened in particular project.void
editSpecification
(SpecificationRecord record) Opens non-modal specification dialog activated pane specified by record.void
editSpecification
(SpecificationRecord record, boolean modal) Opens specification dialog and activated pane specified by record.void
editSpecification
(Element element) Opens specification dialog for given ModelElement.void
editSpecification
(Element element, boolean modal) Opens specification dialog for given ModelElement.com.nomagic.magicdraw.ui.dialogs.specifications.SpecificationDialog
static SpecificationDialogManager
Returns shared instance of this manager.getProjectDialogs
(Project project, boolean create) com.nomagic.ui.SimpleBaseDialog
getSimpleBaseDialog
(Element element) Returns current specification dialog title creator.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.List<com.nomagic.magicdraw.ui.dialogs.specifications.panels.slots.ValueOwnerEditorConfigurator>
void
projectActivated
(Project project) Method is called when inactive project became active project.void
projectDeActivated
(Project project) Method is called when active project becomes not active.void
projectOpened
(Project project) Method is called when project was opened, created or loaded from teamwork server.void
projectPreClosed
(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 creatorsvoid
removeConfigurator
(Class<?> elementClass, ISpecificationNodeConfigurator configurator) Removes specification dialog node configurator for given Element type.void
removeValueOwnerEditor
(com.nomagic.magicdraw.ui.dialogs.specifications.panels.slots.ValueOwnerEditor editor) void
removeValueOwnerEditorConfigurator
(com.nomagic.magicdraw.ui.dialogs.specifications.panels.slots.ValueOwnerEditorConfigurator configurator) void
reuseDialog
(com.nomagic.magicdraw.ui.dialogs.specifications.SpecificationDialog dialog, Element element) static com.nomagic.magicdraw.ui.dialogs.specifications.SpecificationDialogManager.OpenMode
setOpenModalMode
(com.nomagic.magicdraw.ui.dialogs.specifications.SpecificationDialogManager.OpenMode value) void
setTitleCreator
(SpecificationTitleCreator titleCreator) Sets specification dialog title creatorvoid
Methods inherited from class com.nomagic.magicdraw.core.project.ProjectEventListenerAdapter
projectActivatedFromGUI, projectClosed, projectCreated, projectOpenedFromGUI, projectPreActivated, projectPreClosedFinal, projectPreDeActivated, projectPreSaved, projectReplaced, projectSaved
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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: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 interfaceProjectEventListener
- Overrides:
projectOpened
in classProjectEventListenerAdapter
- Parameters:
project
- project which was opened.- See Also:
-
projectPreClosed
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 interfaceProjectEventListener
- Overrides:
projectPreClosed
in classProjectEventListenerAdapter
- Parameters:
project
- project which will be closed.- See Also:
-
projectActivated
Description copied from interface:ProjectEventListener
Method is called when inactive project became active project.- Specified by:
projectActivated
in interfaceProjectEventListener
- Overrides:
projectActivated
in classProjectEventListenerAdapter
- Parameters:
project
- new active project.- See Also:
-
projectDeActivated
Description copied from interface:ProjectEventListener
Method is called when active project becomes not active.- Specified by:
projectDeActivated
in interfaceProjectEventListener
- Overrides:
projectDeActivated
in 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)
-