|
Re: Access the model instance in the EMF generated editor [message #414597 is a reply to message #414593] |
Wed, 14 November 2007 10:57 |
Ed Merks Messages: 33136 Registered: July 2009 |
Senior Member |
|
|
Hauke,
Each generated EMF editor implements IEditingDomainProvider, which
allows you to call
<editor> .getEditingDomain().getResourceSet().getResources().get(0).g etContents().get(0)
to get at the firest root object of the first resource of the resource set.
Hauke Fuhrmann wrote:
> Hi there,
>
> I generated all code from an Ecore Metamodel, i.e. Model, Edit and
> Editor code. Running the Editor Plugin, I can use the different default
> vierwers (e.g. tree viewer to view and edit my model instance).
>
> Now I want to add a new page to this editor with a custom canvas. How
> can I actually access the model instance within the editor? I don't find
> a reference to it in the editor code. All I see is the EditorInput,
> which is simply the file of the model. Do I have to load the instance
> manually?
>
> I understand the other viewers are of type Viewer and use the Edit Code
> Adapters as Label and Content Providers. So do I need to implement a
> real Viewer with using also some kind of custom providers or can I get
> the instance of my model some other way?
>
> Cheers,
> Hauke
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.02230 seconds