Bug 438833

Summary: Show on startup diagram
Product: [Modeling] Sirius Reporter: Melanie Bats <melanie.bats>
Component: DiagramAssignee: Project Inbox <sirius.diagram-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3 CC: maxime.porhel
Version: 1.0.0Keywords: triaged
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Melanie Bats CLA 2014-07-03 09:03:13 EDT
When I create a diagram with the "Init" and "Show on startup" options checked. Then if I create a new project, the diagram is well created but it does not open automatically. But when I close and reopen the project the diagram opens automatically.
Comment 1 Maxime Porhel CLA 2014-07-07 11:12:11 EDT
org.eclipse.sirius.ui.business.api.session.SessionHelper.openStartupRepresentations(Session, IProgressMonitor) is called from the NewSessionWizard (new representtion file) and OpenRepresentationsFileJob. 

The issue here is that it is not called from org.eclipse.sirius.ui.tools.internal.wizards.ModelingProjectWizard because we do propose to select some Viewpoint because the wizard does not add any smeantic resources. 

I am wondering if we should not open the startup representations when the user select a new Viewpoint too. (Note that rep descriptions with init=true are created when the suer selet a new viewpoint)
Comment 2 Maxime Porhel CLA 2014-07-07 11:13:55 EDT
Mélanie, it seems you activate several Viewpoint in your wizard, you might reuse Viewpoitn selection page as EcoreTools does. 

I think you should call org.eclipse.sirius.ui.business.api.session.SessionHelper.openStartupRepresentations(Session, IProgressMonitor) from your new UML Project wizard.
Comment 3 Maxime Porhel CLA 2014-07-07 11:17:30 EDT
Mélanie org.obeonetwork.dsl.uml2.design.InitUmlModel.execute() l79 seems a good candidate in your case, just after your Viewpoint activation.
Comment 4 Maxime Porhel CLA 2014-07-07 11:27:49 EDT
For my question on the 'startup' representation on Viewpoint activation, note thaht this could have impacts on performances. 

Please read the corresponding documentation and warning in the documentation [1]. 

[1] https://www.eclipse.org/sirius/doc/specifier/diagrams/Diagrams.html#diagram_description)
Comment 5 Maxime Porhel CLA 2014-07-07 11:36:27 EDT
We have to check how Ecore Tools use our wizard. Eventually we will need to add the openStartupCall.