[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
|
[news.eclipse.tools.emf] Re: use EMF model from GEF
|
Nikolaj,
You can access the model from the EditingDomain returned by
getEditingDomain() of the generated editor. The EditingDomain is the central
holder of the model for an Editor. The model objects are retrieved by
calling getResourceSet() on it. After that you can get the children,
properties, etc., by calling adapt() on the editors adapter factory, using
the appropriate adapter type.
I realize that this is a shameless plug, but if you're having trouble
getting your head around all of the framework pieces, our EMF book,
http://www.awprofessional.com/titles/0131425420 , is the best resource.
Frank.
Nikolaj Berntsen wrote:
> Howdy folks,
>
> This is a simple and somewhat stupid question, which I know I will find
> the answer for when I have looked some more (just unsure how much more).
>
> It has, however, taken me some time not to find the answer, so here
> goes, maybe someone can easily save me quite some time. All the
> Adapters, AdapterFactories, ItemProviders, ContentProviders etc. take
> some time to digest.
>
> How do I get hold of (an adapter of ) the model (which has been opened
> by the generated Multipage Editor)?
>
> I need to get the (root) of my model (if by name/type, that is OK), and
> then later on be able to call getChildren() for example.
>
> Then, when I have my hands on a piece of loaded model, it I want to get
> the properties. If it is an adapter, rather than the model, how do I get
> them?
>
> Just a quick shot to see if I am lucky today :-)
> /\/ikolaj