Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Xcore and contains of referenced model(Xcore)
Xcore and contains of referenced model [message #1059346] Fri, 17 May 2013 15:17 Go to next message
Udo Walker is currently offline Udo Walker
Messages: 67
Registered: July 2009
Member
How can I model a containment like this with a class from a referenced model?

import a.b.c.Y

class X {
contains Y y
}

Where Y is defined in another model which is just on the classpath.

I can do this:

class X {
contains Y y
}
class Y {}

But not when Y is in a referenced model.
Re: Xcore and contains of referenced model [message #1059351 is a reply to message #1059346] Fri, 17 May 2013 15:32 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 26054
Registered: July 2009
Senior Member
Udo,

If Y is on the classpath (presumably in another project with an Xtext
nature) as soon as you hit Ctrl-Space (marked ^ below) it should show
you all the GenClasses visible on the classpath that start with Y and
should produce the correct import for you.

class X {
contains Y^
}

What does name completion show you after the "contains" keyword? Are you
using a recent build?


On 17/05/2013 5:17 PM, Udo Walker wrote:
> How can I model a containment like this with a class from a referenced
> model?
>
> import a.b.c.Y
>
> class X {
> contains Y y
> }
>
> Where Y is defined in another model which is just on the classpath.
>
> I can do this:
>
> class X {
> contains Y y
> }
> class Y {}
>
> But not when Y is in a referenced model.
Re: Xcore and contains of referenced model [message #1059354 is a reply to message #1059351] Fri, 17 May 2013 15:41 Go to previous messageGo to next message
Udo Walker is currently offline Udo Walker
Messages: 67
Registered: July 2009
Member
Hmm, the other project is not an Xtext project. It is an EMF project where I created interfaces with Javadoc annotations and then used the genmodel tools to create a genmodel file from the interfaces and an ecore file with the generator in the genmodel editor.
I put that project on the plug-in classpath of the xcore project.

If I try to use Ctrl-Space the I do get nothing to choose from.

I did myself an import of the referenced "interface" but then I have to create a type wrapper which I cannot use with the "contains" keyword.

Should I use som genmodel annotations to fix my classpath or is it a missing feature to mix "old" EMF projects with xcore?
Re: Xcore and contains of referenced model [message #1059362 is a reply to message #1059354] Fri, 17 May 2013 16:26 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 26054
Registered: July 2009
Senior Member
Udo,

Comments below.

On 17/05/2013 5:41 PM, Udo Walker wrote:
> Hmm, the other project is not an Xtext project. It is an EMF project
> where I created interfaces with Javadoc annotations and then used the
> genmodel tools to create a genmodel file from the interfaces and an
> ecore file with the generator in the genmodel editor.
> I put that project on the plug-in classpath of the xcore project.
I'm pretty sure that Xtext will index workspace projects only when they
have an Xtext nature, so you'd need to that nature with "Configure ->
Add Xtext Nature" from the context menu on that project.
>
> If I try to use Ctrl-Space the I do get nothing to choose from.
>
> I did myself an import of the referenced "interface" but then I have
> to create a type wrapper which I cannot use with the "contains" keyword.
No, you really need access to the other models GenModel for this to work
properly.
>
> Should I use som genmodel annotations to fix my classpath or is it a
> missing feature to mix "old" EMF projects with xcore?
No, adding the Xtext nature to that other project should be sufficient
to get Xtext to index it and make the stuff from the contained GenModels
available to other Xcore models.
Re: Xcore and contains of referenced model [message #1059415 is a reply to message #1059362] Sat, 18 May 2013 06:03 Go to previous messageGo to next message
Udo Walker is currently offline Udo Walker
Messages: 4
Registered: January 2013
Junior Member
That means I cannot use a binary dependency?
Re: Xcore and contains of referenced model [message #1059417 is a reply to message #1059415] Sat, 18 May 2013 06:15 Go to previous message
Ed Merks is currently offline Ed Merks
Messages: 26054
Registered: July 2009
Senior Member
Udo,

No, a binary dependency (in the target platform) should be indexed
automatically.

On 18/05/2013 8:03 AM, Udo Walker wrote:
> That means I cannot use a binary dependency?
Previous Topic:[CDO] revisions or versions list.
Next Topic:Help with Transactional Editing Domain and Modal Dialogs
Goto Forum:
  


Current Time: Fri Sep 19 20:07:06 GMT 2014

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

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