Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Flatten xtext grammar & ui projects?
Flatten xtext grammar & ui projects? [message #692744] Tue, 05 July 2011 03:04 Go to next message
Eclipse UserFriend
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 06:39 Go to previous messageGo to next message
Eclipse UserFriend
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 07:08 Go to previous message
Eclipse UserFriend
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
Previous Topic:Inject a different StaticMethodsFeatureForTypeProvider
Next Topic:ExecutableExtensionFactory#getBundle()
Goto Forum:
  


Current Time: Tue Jul 01 08:26:34 EDT 2025

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

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

Back to the top