Bug 507026

Summary: Need synchronous support of arrange diagram API
Product: [Modeling] Sirius Reporter: Olivier Haegi <olivier.haegi>
Component: DiagramAssignee: Project Inbox <sirius.diagram-inbox>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P3 CC: laurent.redor, romain.guider, steve.monnier
Version: unspecifiedKeywords: triaged
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on: 513145    
Bug Blocks:    

Description Olivier Haegi CLA 2016-11-04 06:19:54 EDT
I need a behavior for arrange of a diagram synchronously. Today Sirius can arrange diagram asynchronously with “org.eclipse.sirius.diagram.ui.internal.refresh.layout.SiriusCanonicalLayoutHandler.launchArrangeCommand(DiagramEditPart)“ method. This method use  “Display.asyncExec” to launch arrange.

In my case, I need to refresh my diagram, arrange it like when I open the diagram but without open it and after I need do some thing else with arranged diagram. This is impossible with Sirius arrange diagram API today because arrange is done after my action because of asynchronous method.
Comment 1 Steve Monnier CLA 2016-11-04 11:04:59 EDT
Do you remember in which called method there is this Display.asyncExec as it is not directly in SiriusCanonicalLayoutHandler.launchArrangeCommand?
Comment 2 Olivier Haegi CLA 2016-11-04 11:22:05 EDT
The method contains “Display.asyncExec” is org.eclipse.sirius.diagram.ui.internal.refresh.layout.SiriusCanonicalLayoutCommand.doExecute()
Comment 3 Laurent Redor CLA 2016-11-08 04:06:11 EST
Thanks for your detailed enhancement submit.
We have currently not planned to work on it in the following releases.

For information:
* Referenced classes in your comment are currently not API.
* The asyncExec is probably here for potentiel problem with DeferredLayoutCommand (org.eclipse.gmf.runtime.diagram.ui.commands.DeferredLayoutCommand). I'm not sure we can simply call a syncExec. This needs investigation...
Comment 4 Steve Monnier CLA 2017-04-10 10:44:23 EDT
The same issue was reported (see Bugzilla 513145) with a diagram and an Xtext Editor. A fix has been pushed to gerrit. Once integrated, this bugzilla should be closed as duplicate.