Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » [XText] Edit model fragment
[XText] Edit model fragment [message #63258] Mon, 27 July 2009 17:54 Go to next message
Maurice O'Connor is currently offline Maurice O'ConnorFriend
Messages: 86
Registered: July 2009
Member
Hi,

I'm using a GMF Editor to display a part of my model, but when the user
clicks a particular node, I'd like more complexity to be revealed in an
XTextEditor type view, allowing the user fine-grained control. My question
is:

How do I go from the selected node in GMF, to loading it in the XText
view? I gather there is some addressing mechanism I should look at for
this? Any help would be appreciated.

Thanks!

Maurice
Re: [XText] Edit model fragment [message #99724 is a reply to message #63258] Mon, 27 July 2009 18:44 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3118
Registered: July 2009
Senior Member
Hi Maurice,

actually Jan is going to publish the code for the example that he
developed in his blog.
I currently do not have access to the source but you may try to reuse
the
org.eclipse.xtext.ui.common.editor.hyperlinking.OpenDeclarat ionAction.
It takes the uri of the EObject and a LocationInFileProvider as
argument. The latter can be retrieved via google guice.

Regards,
Sebastian

--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com

Am 27.07.2009 19:54 Uhr, schrieb Maurice:
> Hi,
>
> I'm using a GMF Editor to display a part of my model, but when the user
> clicks a particular node, I'd like more complexity to be revealed in an
> XTextEditor type view, allowing the user fine-grained control. My
> question is:
>
> How do I go from the selected node in GMF, to loading it in the XText
> view? I gather there is some addressing mechanism I should look at for
> this? Any help would be appreciated.
>
> Thanks!
>
> Maurice
>
Re: [XText] Edit model fragment [message #145372 is a reply to message #99724] Mon, 27 July 2009 19:31 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ogucuk.gmail.com

Hi Sebastian,

sorry to popup in every discussion but what Maurice describes is very
similar to what I am trying to do.

I have been waiting for Jan publishing his code for a long time now and
I am running of time for my project.

Is there somewhere more documentation to this issue?
Currently I have a grammar, and an Xtext parser, generated from it. I
have written a tiny class which
takes the Xtext parser(via an injector),
my model file as an InputStream,
and parses the input stream.

I have difficulties with understanding the archictecture behind the
Xtext parser (the structure of the AST) and I am failing to see the
bridge to the GMF editor.

More documentation on this would be a great help. I would be happy to
provide you with my information, also.

Thanks

myName

Sebastian Zarnekow schrieb:
> Hi Maurice,
>
> actually Jan is going to publish the code for the example that he
> developed in his blog.
> I currently do not have access to the source but you may try to reuse
> the
> org.eclipse.xtext.ui.common.editor.hyperlinking.OpenDeclarat ionAction.
> It takes the uri of the EObject and a LocationInFileProvider as
> argument. The latter can be retrieved via google guice.
>
> Regards,
> Sebastian
>
Re: [XText] Edit model fragment [message #146906 is a reply to message #145372] Mon, 27 July 2009 19:33 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ogucuk.gmail.com

I mean "with _more_ information", of course.
> More documentation on this would be a great help. I would be happy to
> provide you with my information, also.
Re: [XText] Edit model fragment [message #277008 is a reply to message #145372] Mon, 27 July 2009 22:20 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3118
Registered: July 2009
Senior Member
Hi myName,

please find my comments below.


Am 27.07.2009 21:31 Uhr, schrieb myName:
> Hi Sebastian,
>
> sorry to popup in every discussion but what Maurice describes is very
> similar to what I am trying to do.
>
> I have been waiting for Jan publishing his code for a long time now and
> I am running of time for my project.
>
I think Jan will publish the example as soon as he finds the time.

> Is there somewhere more documentation to this issue?

It is a very specific problem. I'm afraid there is not much
documentation available for navigating to an EObject that has been
instantiated by an Xtext parser.

> Currently I have a grammar, and an Xtext parser, generated from it. I
> have written a tiny class which
> takes the Xtext parser(via an injector),
> my model file as an InputStream,
> and parses the input stream.

Sounds reasonable.
>
> I have difficulties with understanding the archictecture behind the
> Xtext parser (the structure of the AST) and I am failing to see the
> bridge to the GMF editor.

The GMF editor simply visualizes the contents of the resource which has
been created by an xtext parser. This objects are refered to as semantic
objects. They are linked to the AST via an EAdapter. That's basically
the structure that the parser produces.

>
> More documentation on this would be a great help. I would be happy to
> provide you with my information, also.
>

Hope that helps,
Sebastian

--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com

> Thanks
>
> myName
>
> Sebastian Zarnekow schrieb:
>> Hi Maurice,
>>
>> actually Jan is going to publish the code for the example that he
>> developed in his blog.
>> I currently do not have access to the source but you may try to reuse
>> the
>> org.eclipse.xtext.ui.common.editor.hyperlinking.OpenDeclarat ionAction.
>> It takes the uri of the EObject and a LocationInFileProvider as
>> argument. The latter can be retrieved via google guice.
>>
>> Regards,
>> Sebastian
>>
Re: [XText] Edit model fragment [message #362115 is a reply to message #277008] Tue, 28 July 2009 13:56 Go to previous message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3118
Registered: July 2009
Senior Member
Hi myName,

have a look at Jan's blog to find the sources:
http://koehnlein.blogspot.com/2009/07/source-code-for-screen cast-of-xtext-and.html

Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com

Am 28.07.2009 0:20 Uhr, schrieb Sebastian Zarnekow:
> Hi myName,
>
> please find my comments below.
>
>
> Am 27.07.2009 21:31 Uhr, schrieb myName:
>> Hi Sebastian,
>>
>> sorry to popup in every discussion but what Maurice describes is very
>> similar to what I am trying to do.
>>
>> I have been waiting for Jan publishing his code for a long time now and
>> I am running of time for my project.
>>
> I think Jan will publish the example as soon as he finds the time.
>
>> Is there somewhere more documentation to this issue?
>
> It is a very specific problem. I'm afraid there is not much
> documentation available for navigating to an EObject that has been
> instantiated by an Xtext parser.
>
>> Currently I have a grammar, and an Xtext parser, generated from it. I
>> have written a tiny class which
>> takes the Xtext parser(via an injector),
>> my model file as an InputStream,
>> and parses the input stream.
>
> Sounds reasonable.
>>
>> I have difficulties with understanding the archictecture behind the
>> Xtext parser (the structure of the AST) and I am failing to see the
>> bridge to the GMF editor.
>
> The GMF editor simply visualizes the contents of the resource which has
> been created by an xtext parser. This objects are refered to as semantic
> objects. They are linked to the AST via an EAdapter. That's basically
> the structure that the parser produces.
>
>>
>> More documentation on this would be a great help. I would be happy to
>> provide you with my information, also.
>>
>
> Hope that helps,
> Sebastian
>
Previous Topic:Xtext replace internal model instance
Next Topic:Hidden Terminals
Goto Forum:
  


Current Time: Sat Aug 10 07:39:34 GMT 2024

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

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

Back to the top