Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Flatten xtext grammar & ui projects?
Flatten xtext grammar & ui projects? [message #692744] Tue, 05 July 2011 07:04 Go to next message
Timotei Mising name is currently offline Timotei Mising nameFriend
Messages: 89
Registered: March 2010
Member
Hi everyone!

I have come to a point were my grammar core project, has a circular dependency with the main plugin. That is, I have the following configuration:

- org.plugin
- org.plugin.dsl
- org.plugin.dsl.ui


Is there any way to flatten those projects? That is, have just one, which contains all: my plugin, the dsl and the dsl.ui? This is because the plugins are not so big, and tbh, 3 projects doesn't yet make sense for my plugin.

Thanks,
Timo
Re: Flatten xtext grammar & ui projects? [message #692846 is a reply to message #692744] Tue, 05 July 2011 10:39 Go to previous messageGo to next message
Timotei Mising name is currently offline Timotei Mising nameFriend
Messages: 89
Registered: March 2010
Member
I have managed to flat the first: org.plugin with org.plugin.dsl. Everything works fine for now,
but one problem would be, that if I have the following code:

public class DependencyTreeBuilder
{
    @Inject
    private WMLGrammarAccess grammarAccess_;
    public DependencyTreeBuilder( ) {
        System.out.println( "lala");
    }
}

The grammarAccess_ is still null... is there anyway I can Inject or get that from the xtext framework?

Thanks,
(no subject) [message #692875 is a reply to message #692846] Tue, 05 July 2011 11:08 Go to previous message
Jan Koehnlein is currently offline Jan KoehnleinFriend
Messages: 760
Registered: July 2009
Location: Hamburg
Senior Member
It is generally a good idea to keep UI aspects separate from the plain
runtime concepts. Into the bargain, Xtext's code generator assumes them
to be different plug-ins. So I'd recommend to keep the two separate, and
keep the dependency from org.plugin.dsl.ui to org.plugin.dsl. For the
remaining classes in org.plugin, I'd try to decide if they are base
runtime or UI and move them to a src-folder of the appropriate plug-in.

If in your example the grammarAccess is null, you most likely haven't
used an Injector to instantiate the DependencyTreeBuilder. The sections
on DI in the Xtext help might give you more insights.

Am 05.07.11 12:39, schrieb forums-noreply@eclipse.org:
> I have managed to flat the first: org.plugin with org.plugin.dsl.
> Everything works fine for now,
> but one problem would be, that if I have the following code:
>
>
> public class DependencyTreeBuilder
> {
> @Inject
> private WMLGrammarAccess grammarAccess_;
> public DependencyTreeBuilder( ) {
> System.out.println( "lala");
> }
> }
>
> The grammarAccess_ is still null... is there anyway I can Inject or get
> that from the xtext framework?
>
> Thanks,


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


---
Get professional support from the Xtext committers at www.typefox.io
Previous Topic:Inject a different StaticMethodsFeatureForTypeProvider
Next Topic:ExecutableExtensionFactory#getBundle()
Goto Forum:
  


Current Time: Mon Sep 23 10:35:19 GMT 2024

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

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

Back to the top