|
Re: How to Navigate Programatically [message #1822881 is a reply to message #1822736] |
Mon, 16 March 2020 10:24   |
|
Hello,
I am not sure to understand the part where you had to create a button in the odesign. If you create a navigation tool, the new action will be available in the contextual menu when you right click on the element where you want to create a sub diagram.
Anyway, if you want to create a representation programmatically, you can use the API DialectManager.INSTANCE.createRepresentation(String name, EObject semantic, RepresentationDescription description, Session session, IProgressMonitor monitor). This will create the representation in the graphical model (.aird). After that to open the representation in an editor you can use the API DialectUIManager.INSTANCE.openEditor(Session session, DRepresentation dRepresentation, IProgressMonitor monitor).
Best regards,
Steve
Steve Monnier - Obeo Canada
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
|
Re: How to Navigate Programatically [message #1822912 is a reply to message #1822891] |
Mon, 16 March 2020 16:30   |
|
Hello,
Ok, good idea.
For information, on a diagram (let's call it D1), if a displayed element is the root of another diagram (let's call it D2) then on the parent diagram (D1) the element will have a diagram decorator on the bottom right. When you right click on the element, there will be a menu "Open" with all the diagram where this semantic element is to root.
Best regards,
Steve
Steve Monnier - Obeo Canada
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
|
Re: How to Navigate Programatically [message #1828762 is a reply to message #1828718] |
Thu, 18 June 2020 08:19  |
|
Hello,
You can open a representation programmatically using the API: org.eclipse.sirius.ui.business.api.dialect.DialectUIManager.INSTANCE.openEditor(session, representation, monitor). I don't remember if it will focus on the editor if it was already opened, but this API returns an IEditorPart if you need to.
Best regards,
Steve
Steve Monnier - Obeo Canada
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
Powered by
FUDForum. Page generated in 0.01777 seconds