Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » How to Navigate Programatically
How to Navigate Programatically [message #1822736] Thu, 12 March 2020 13:51 Go to next message
Mohit Advani is currently offline Mohit AdvaniFriend
Messages: 28
Registered: May 2019
Junior Member
Hi,

I am providing user option to create subprocess in my Sirius digram, so subprocess will be another diagram so for Navigation , i am using Navigation tool from configuration so i had to create button in .odesign file only, can someone explain how can we do same thing pro-grammatically. so that we can provide a better UI to create and Navigate on subprocess. {PFA: Navigation Tool }

Re: How to Navigate Programatically [message #1822881 is a reply to message #1822736] Mon, 16 March 2020 10:24 Go to previous messageGo to next message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 492
Registered: May 2011
Senior Member
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
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: How to Navigate Programatically [message #1822891 is a reply to message #1822881] Mon, 16 March 2020 12:33 Go to previous messageGo to next message
Mohit Advani is currently offline Mohit AdvaniFriend
Messages: 28
Registered: May 2019
Junior Member
Hi Steve,
I want to give user a option to navigate to already existing diagram, that 's why i created a button to view and navigate to subprocess {i.e. diagram}.
I am attaching another snap which might clear my requirement.

Thanks and Regards
Mohit Advani
Re: How to Navigate Programatically [message #1822912 is a reply to message #1822891] Mon, 16 March 2020 16:30 Go to previous messageGo to next message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 492
Registered: May 2011
Senior Member
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
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: How to Navigate Programatically [message #1828718 is a reply to message #1822912] Wed, 17 June 2020 14:01 Go to previous messageGo to next message
Mohit Advani is currently offline Mohit AdvaniFriend
Messages: 28
Registered: May 2019
Junior Member
Hi Steve,
Can we do same thing pragmatically which Navigation tool is doing, because navigation tool is not opening subprocess which resides in different diagram.
I want generic code which takes Diagram Object and open it is different editor and if it is already open then just navigate to that editor.

Thanks and Regards
Mohit Advani
Re: How to Navigate Programatically [message #1828762 is a reply to message #1828718] Thu, 18 June 2020 08:19 Go to previous message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 492
Registered: May 2011
Senior Member
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
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Previous Topic:Is it possible to create note attachments in Sirius specification editor ?
Next Topic: how to add notes when creating diagram programmatically
Goto Forum:
  


Current Time: Wed Oct 28 21:09:58 GMT 2020

Powered by FUDForum. Page generated in 0.02509 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top