Skip to main content



      Home
Home » Eclipse Projects » Sirius » Navigate from Diagram to DSL(Navigation by double clicking on diagram element It will directly open DSL Editor instance)
Navigate from Diagram to DSL [message #1729365] Wed, 13 April 2016 08:37 Go to next message
Eclipse UserFriend
Hello guys,

I suppose this is very interesting if you could help to solve this query.
I'm trying to open DSL Editor by double clicking on generated diagram element .
Suppose, If I have State Machine Diagram and by double clicking on any state my DSL Editor should be opened along with that specific path where I mentioned my states.
For hint : If we Right click on diagram element It gives us option called Open Definition and by clicking on it we're navigated to Sirius Specification Editor
Like wise by double clicking on element it should open DSL Editor.
I would be very grateful if you could solve my query and this will bring me a new revolution in my project.

Thanks and Regards
Rahul B.
Re: Navigate from Diagram to DSL [message #1729473 is a reply to message #1729365] Thu, 14 April 2016 08:21 Go to previous messageGo to next message
Eclipse UserFriend
Le 13/04/2016 21:18, Rahul Bhogavkar a écrit :
> Hello guys,
Hi
>
> I suppose this is very interesting if you could help to solve this query.
> I'm trying to open DSL Editor by double clicking on generated diagram element .
> Suppose, If I have State Machine Diagram and by double clicking on any state my DSL Editor should be opened along with that specific path where I mentioned my states.
> For hint : If we Right click on diagram element It gives us option called Open Definition and by clicking on it we're navigated to Sirius Specification Editor
> Like wise by double clicking on element it should open DSL Editor.
> I would be very grateful if you could solve my query and this will bring me a new revolution in my project.
Your need is specific. So it up to you to implement the behavior when
double clicking.
To do so, define a double-click tool[1] and then call a java service[2]
to do what you want (open the editor, etc)
>
> Thanks and Regards
> Rahul B.
>

[1]
http://help.eclipse.org/mars/topic/org.eclipse.sirius.doc/doc/specifier/diagrams/Diagrams.html?cp=69_2_1_4#tools
[2]
http://help.eclipse.org/mars/topic/org.eclipse.sirius.doc/doc/specifier/general/Writing_Queries.html?cp=69_2_8_7#service_methods
Re: Navigate from Diagram to DSL [message #1729781 is a reply to message #1729473] Tue, 19 April 2016 01:08 Go to previous messageGo to next message
Eclipse UserFriend
Yeah, It is specific need but I'm not getting from which point I have to start up.
and If you could help me by sending relevant code for the same then it is making sense to me ..
Thank You.
Re: Navigate from Diagram to DSL [message #1729852 is a reply to message #1729781] Tue, 19 April 2016 10:04 Go to previous messageGo to next message
Eclipse UserFriend
Le 19/04/2016 07:08, Rahul Bhogavkar a écrit :
> Yeah, It is specific need but I'm not getting from which point I have to
> start up.
> and If you could help me by sending relevant code for the same then it
> is making sense to me ..
> Thank You.

In your VSM you need to specify a "Double Click Tool" associated to the
mapping of the source element on you Sirius diagram (see the
documentation referenced by Laurent for details). There is no predefined
"open my DSL editor for the element I clicked on" operation defined in
Sirius, so you'll need to create a Java method to do that, and invoke it
from inside the tool's definition (see the documentation for "Java
service" referenced by Laurent).

When your Java method will be invoked by Sirius, it will be passed the
semantic model element you double-clicked on. After that it's up to you
to know how to open your editor, but basically you can use all the
normal Eclipse APIs like IWorkbenchPage.openEditor().

Regards,
Pierre-Charles

--
Pierre-Charles David - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Navigate from Diagram to DSL [message #1730028 is a reply to message #1729852] Thu, 21 April 2016 01:21 Go to previous messageGo to next message
Eclipse UserFriend
Thank You. I will work on it
Re: Navigate from Diagram to DSL [message #1730118 is a reply to message #1730028] Thu, 21 April 2016 09:11 Go to previous messageGo to next message
Eclipse UserFriend
Hi Rahul,

Not sure if you're using XText or not, but you can get ideas from this link:
https://github.com/ObeoNetwork/Xtext-Sirius-integration

This is a Sirius Xtext integration. It has a double click action that gets you to the part of the text in your DSL file that is related to the double clicked item on the diagram.

It also shows how to use embedded editor (right click -> open embedded editor) which shows you the part of the text in the diagram (not opening the whole file).

hope it helps,
Parsa
Re: Navigate from Diagram to DSL [message #1730167 is a reply to message #1730118] Fri, 22 April 2016 00:52 Go to previous messageGo to next message
Eclipse UserFriend
You can directly find code for navigation on following link
https://github.com/ObeoNetwork/Xtext-Sirius-integration/blob/master/xtext-support-parent/examples/org.eclipse.sirius.example.fowlerdsl.design/src/org/eclipse/sirius/example/fowlerdsl/design/service/StatemachineServices.java
Re: Navigate from Diagram to DSL [message #1730168 is a reply to message #1730167] Fri, 22 April 2016 01:28 Go to previous message
Eclipse UserFriend
Yeah.... Thank You...
Previous Topic:ConcurrentModificationException in Container Drop
Next Topic:Bread Crumb For Diagram Editor
Goto Forum:
  


Current Time: Fri Mar 21 11:07:39 EDT 2025

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

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

Back to the top