Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Integrate content assistance in properties view of GMF editor (XtextSourceViewer)
Integrate content assistance in properties view of GMF editor (XtextSourceViewer) [message #529242] Fri, 23 April 2010 10:37 Go to next message
Eclipse UserFriend
Hi

I managed to integrate the Xtext parser and serializer for my DSL into an XtextSourceViewer I use within the Properties view of my GMF editor. My attempts to integrate content assistance failed so far:

org.eclipse.xtext.common.TerminalsStandaloneSetup.doSetup();
Injector injector = Guice.createInjector(new MyDslUiModule());

XtextSourceViewerConfiguration config = new XtextSourceViewerConfiguration();
injector.injectMembers(config);

XtextSourceViewer sourceViewer = new XtextSourceViewer(...);
sourceViewer.configure(conf);


Guice.createInjector(new MyDslUiModule()) produces a com.google.inject.CreationException:
Guice configuration errors:
org.eclipse.xtext.ui.common.editor.templates.XtextTemplateSt ore. <init>(XtextTemplateStore.java:41):
Binding to org.eclipse.jface.preference.IPreferenceStore not found. No bindings to that type were found.


Does anybody have an idea how to integrate Xtext content assistance in (Xtext)SourceViewers?


Thanks in advance and best regards,
Matt
Re: Integrate content assistance in properties view of GMF editor (XtextSourceViewer) [message #529257 is a reply to message #529242] Fri, 23 April 2010 11:38 Go to previous messageGo to next message
Eclipse UserFriend
Hi Matt,

you should never call the standalone setup in an OSGI environment.
That's why it's called StandaloneSetup. The setup is likely to corrupt
your EPackage.Registry.eINSTANCE and many other EMF singletons that are
initialized from extension points.
Use Activator.getInjector(languageName) instead.

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

Am 23.04.10 16:37, schrieb matt:
> Hi
>
> I managed to integrate the Xtext parser and serializer for my DSL into
> an XtextSourceViewer I use within the Properties view of my GMF editor.
> My attempts to integrate content assistance failed so far:
>
> org.eclipse.xtext.common.TerminalsStandaloneSetup.doSetup();
> Injector injector = Guice.createInjector(new MyDslUiModule());
>
> XtextSourceViewerConfiguration config = new
> XtextSourceViewerConfiguration();
> injector.injectMembers(config);
>
> XtextSourceViewer sourceViewer = new XtextSourceViewer(...);
> sourceViewer.configure(conf);
>
>
> Guice.createInjector(new MyDslUiModule()) produces a
> com.google.inject.CreationException:
> Guice configuration errors:
> org.eclipse.xtext.ui.common.editor.templates.XtextTemplateSt ore.
> <init>(XtextTemplateStore.java:41):
> Binding to org.eclipse.jface.preference.IPreferenceStore not found. No
> bindings to that type were found.
>
>
> Does anybody have an idea how to integrate Xtext content assistance in
> (Xtext)SourceViewers?
>
>
> Thanks in advance and best regards,
> Matt
Re: Integrate content assistance in properties view of GMF editor (XtextSourceViewer) [message #530141 is a reply to message #529257] Wed, 28 April 2010 12:00 Go to previous messageGo to next message
Eclipse UserFriend
Thanks for your help. I got it up running.
Re: Integrate content assistance in properties view of GMF editor (XtextSourceViewer) [message #985908 is a reply to message #529242] Fri, 16 November 2012 11:02 Go to previous message
Eclipse UserFriend
Hi,

i'm currently trying to integrate xtext in my properties view too, but i don't know how. could you please provide me with some imformation where to start and what to do?

regards,
gideon
Previous Topic:EclipseCon Boston - Submission Deadline is Monday!
Next Topic:importing native java source code
Goto Forum:
  


Current Time: Tue Jul 08 01:28:03 EDT 2025

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

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

Back to the top