Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » part of model als content of xtext editor
part of model als content of xtext editor [message #731058] Thu, 29 September 2011 19:30 Go to next message
Markus Oley is currently offline Markus OleyFriend
Messages: 304
Registered: July 2009
Location: Germany
Senior Member
Hi to all,

I have a ecore-model and want to load a part of this (a subtree) as xtext-dsl.
Is it possible to assign not a resource but a special ecore-element and all it's childnotes to a editor-instance?

Thank you in advance

Best regards
Markus

Re: part of model als content of xtext editor [message #731061 is a reply to message #731058] Thu, 29 September 2011 20:05 Go to previous messageGo to next message
Michael Ernst is currently offline Michael ErnstFriend
Messages: 49
Registered: July 2010
Member
I think that it is only possible if you override the XtextResource class so that only this special element is returned to the editor.
I think the better way would to slice the model into two seperate resource files and do some linking.

Kind regards
Michael
Re: part of model als content of xtext editor [message #731066 is a reply to message #731061] Thu, 29 September 2011 20:17 Go to previous messageGo to next message
Markus Oley is currently offline Markus OleyFriend
Messages: 304
Registered: July 2009
Location: Germany
Senior Member
Hi Michael,

ok, thanks for your hint.
Yes, I guess I'll implement it this way.
I only have to implement a kind of navigator to have all the resources in scope (and only this files), with special features.
What's the best way to implement this view, which tree includes any of these resources?


Regards
Markus
Re: part of model als content of xtext editor [message #731077 is a reply to message #731066] Thu, 29 September 2011 21:19 Go to previous messageGo to next message
Markus Oley is currently offline Markus OleyFriend
Messages: 304
Registered: July 2009
Location: Germany
Senior Member
Excuse me,
me again....

I don't know if this is the preferred solution either,
because further thinking I guess, I want my complete model to be saved as one ecore-model to have the possibility to use CDO in the future. And the xtext-editor should be only one of three editor types choosable. One editor is a preview-like editor, which should use parts of the ecore-model as well

Any hints?
Thanks for your help

Markus

Re: part of model als content of xtext editor [message #731193 is a reply to message #731058] Fri, 30 September 2011 08:27 Go to previous messageGo to next message
Jan Koehnlein is currently offline Jan KoehnleinFriend
Messages: 760
Registered: July 2009
Location: Hamburg
Senior Member
I heard that there is some kind of mixed resource implementation in the
YAKINDU project. You may have a look at that.

Am 29.09.11 21:30, schrieb Markus Oley:
> Hi to all,
> I have a ecore-model and want to load a part of this (a subtree) as
> xtext-dsl. Is it possible to assign not a resource but a special
> ecore-element and all it's childnotes to a editor-instance?
> Thank you in advance
>
> Best regards
> Markus
>
>


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


---
Get professional support from the Xtext committers at www.typefox.io
Re: part of model als content of xtext editor [message #731194 is a reply to message #731077] Fri, 30 September 2011 08:38 Go to previous messageGo to next message
Michael Ernst is currently offline Michael ErnstFriend
Messages: 49
Registered: July 2010
Member
Ok, then I would start with overriding the XtextResource class. Be aware that custom formatting is lost when you only save the created elements in the ecore model. How to serialize and deserialize is described in the FAQ: http://wiki.eclipse.org/Xtext/FAQ#How_do_I_load_my_model_in_a_standalone_Java_application.C2.A0.3F

Kind regards
Michael
Re: part of model als content of xtext editor [message #731198 is a reply to message #731077] Fri, 30 September 2011 08:34 Go to previous messageGo to next message
Jan Koehnlein is currently offline Jan KoehnleinFriend
Messages: 760
Registered: July 2009
Location: Hamburg
Senior Member
Combining CDO and Xtext directly is considered task because they have
different ways to handle object identities.

Am 29.09.11 23:19, schrieb Markus Oley:
> Excuse me, me again....
> I don't know if this is the preferred solution either, because further
> thinking I guess, I want my complete model to be saved as one
> ecore-model to have the possibility to use CDO in the future. And the
> xtext-editor should be only one of three editor types choosable. One
> editor is a preview-like editor, which should use parts of the
> ecore-model as well
>
> Any hints? Thanks for your help
>
> Markus
>
>


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


---
Get professional support from the Xtext committers at www.typefox.io
Re: part of model als content of xtext editor [message #731209 is a reply to message #731194] Fri, 30 September 2011 09:17 Go to previous message
Markus Oley is currently offline Markus OleyFriend
Messages: 304
Registered: July 2009
Location: Germany
Senior Member
Thank you,
I'll give it a try
Previous Topic:unit tests in the presence of imported packages
Next Topic:Content assist context ignores terminating whitespace
Goto Forum:
  


Current Time: Fri Apr 26 20:56:09 GMT 2024

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

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

Back to the top