Home » Modeling » TMF (Xtext) » XtextEditor based on a string
| |
Re: XtextEditor based on a string [message #671548 is a reply to message #669968] |
Wed, 18 May 2011 09:23 |
|
On 05/12/2011 10:39 AM, Ed Willink wrote:
> Hi Lorenzo
>
Hi Ed
> Using Xtext for a string is easy; you just open a stream on a string
> rather than a file.
>
actually that was my first try, using a StringEditorInput... but it
looks like xtext refuses an editor input if it's not an instance of a
IFileEditorInput... I'll try to reproduce the code as soon as
possible... also... it looks like the file must be in the workspace...
> It's the integration that is tricky.
> - an Xtext editor in an editor is comparatively straightforward - there
> are good 2-year old blogs
> - an Xtext editor in a pop-up is a bit harder, also blogged, or you
> could try to understand how Papyrus does
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=34533
are you sure this bug is the one you meant? it looks like it refers to
different bug
> - an Xtext editor in a view is harder still (there is no IEditorSite),
> you could look at the original XTFO
XTFO?
> or its adaptation for Indigo in org.eclipse.ocl.examples.xtext.console
>
> If you've not previously programmed with IEditorPart then you may have a
> bit to learn.
>
> Hopefully the itemis guys are busy writing last minute documentation on
> all this for the Indigo release.
>
OK, let's see if any of them enters the discussion :)
> Regards
>
> Ed Willink
>
> On 12/05/2011 08:44, Lorenzo Bettini wrote:
>> Hi
>>
>> can I open an Xtext editor not based on a file, but on a string? The
>> string represents the whole program I'd like to edit (thus I do not
>> need to open the editor on a part of a file, like in the integration
>> with GMF).
>>
>> I'd like to embed it into another editor; I saw that there's a form
>> integration example, but it looks like one needs to write a lot of
>> code; is that lot of code required by the integration in a form, or is
>> it required anyway?
>>
>> thanks in advance
>> Lore
>>
>
--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
ICQ# lbetto, 16080134 (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
http://www.myspace.com/supertrouperabba
BLOGS: http://tronprog.blogspot.com http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net
HOME: http://www.lorenzobettini.it
TDD Book: https://leanpub.com/tdd-buildautomation-ci
Xtext Book: https://www.packtpub.com/application-development/implementing-domain-specific-languages-xtext-and-xtend-second-edition
|
|
| |
Goto Forum:
Current Time: Mon May 06 05:59:43 GMT 2024
Powered by FUDForum. Page generated in 0.03844 seconds
|