Flatten xtext grammar & ui projects? [message #692744] |
Tue, 05 July 2011 03:04  |
Eclipse User |
|
|
|
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
|
|
|
|
(no subject) [message #692875 is a reply to message #692846] |
Tue, 05 July 2011 07:08  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.09767 seconds