[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Newsgroup Home]
|
[news.eclipse.tools.emf] Re: Referencing model elements (generated editor vs. editor on the fly)
|
- From: Dave Steinberg <davidms@xxxxxxxxxx>
- Date: Tue, 05 Feb 2008 13:49:44 -0500
- Newsgroups: eclipse.tools.emf
- Organization: EclipseCorner
- User-agent: Thunderbird 2.0.0.9 (Windows/20071031)
Hi Michael,
Non-containment references are realized by default as properties, and if
you look in ItemPropertyDescriptor.getReachableObjectsOfType(), you'll
see how we try to find the appropriate targets for a given object.
The first thing to point out is that it's searching for existing objects
accessible via the resource set. So, it's unlike creating a child object
under a containment reference in that an object must already exist and
be in, or referenced by, the contents of one of the resources being edited.
If that sounds obvious, apologies, and let's move on... ;)
The next thing to note is that we're searching for objects that are
type-compatible with the reference. If you look at
collectReachableObjectsOfType(), you'll see that it's simply calling
type.isInstance(object) to evaluate whether each object should be added
to the result.
I wonder if this could be an issue of having two different copies of
your package a around? If so, then this could be comparing two
different versions of the same EClass, which won't work.
Are you generating a model for package b or using the dynamic
implementation? In the latter case, perhaps the b.ecore file has
references to a of the form platform:/plugin/ABC/model/a.ecore instead
of http://www.example.com/a.ecore ? This would cause the a.ecore file
to be loaded and the dynamic implementation to be used. That would
leave you with two different versions of the package: the generated,
registered one that the editor is using and the dynamic one loaded into
the resource set.
Probably it would help if I could see your instance documents and, if
you are using dynamic EMF for package b, its Ecore file, too.
Cheers,
Dave
Michael Gebhart wrote:
Hi,
thanks for you help. Very interesting. When I use a containment reference
everything is working. But if I don't set containment to true I doesn't.
In the properties view the reference is listed, but I can't select the
element.
If I generate an editor for the second model it is working.
Any idea how I can make it working with a reference and no containment?
Greetings
Mike