Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » How do I bring editor or view on an existing model instance?
How do I bring editor or view on an existing model instance? [message #420351] Wed, 25 June 2008 20:09 Go to next message
Steven Punte is currently offline Steven PunteFriend
Messages: 34
Registered: July 2009
Member
Hi,

I've been using EMF for sometime now, and it's great. In particular, it
is very helpful to have the generated EMF editor to directly examine data
structures. However, this has always required that I first open an EMF
instance/resource with the EMF editor first.

Now I really need to have pure runtime software which simply creates and
uses EMF objects/structures. No problem: just use
XxxxxFactory.eINSTANCE.createYyyy().

HOWEVER, it would REALLY be helpful to be able to examine and possibly
modify such object structure using the generated EMF editor and/or Outline
View and properties page but without going through the steps of using the
editor UI to open a file, etc... The goal is not to have a file and
possibly not a resource involved.

Can someone suggest a, preferable simple, tactic to programmatically open
the Editor or Outline View and properties page on an existing in-memory
EMF generated object structure?

Thanks in advance.

Steve
Re: How do I bring editor or view on an existing model instance? [message #420361 is a reply to message #420351] Thu, 26 June 2008 03:30 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33141
Registered: July 2009
Senior Member
Steve,

If you look at the generated wizard, it shows how the editor opened when
the wizard completes.


Steve Punte wrote:
> Hi,
>
> I've been using EMF for sometime now, and it's great. In particular,
> it is very helpful to have the generated EMF editor to directly
> examine data structures. However, this has always required that I
> first open an EMF instance/resource with the EMF editor first.
>
> Now I really need to have pure runtime software which simply creates
> and uses EMF objects/structures. No problem: just use
> XxxxxFactory.eINSTANCE.createYyyy().
>
> HOWEVER, it would REALLY be helpful to be able to examine and possibly
> modify such object structure using the generated EMF editor and/or
> Outline View and properties page but without going through the steps
> of using the editor UI to open a file, etc... The goal is not to have
> a file and possibly not a resource involved.
>
> Can someone suggest a, preferable simple, tactic to programmatically
> open the Editor or Outline View and properties page on an existing
> in-memory EMF generated object structure?
>
> Thanks in advance.
>
> Steve
>
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: How do I bring editor or view on an existing model instance? [message #420388 is a reply to message #420361] Fri, 27 June 2008 17:04 Go to previous messageGo to next message
Steven Punte is currently offline Steven PunteFriend
Messages: 34
Registered: July 2009
Member
Ed:

Thanks for the reply.

Can you be a bit more specific. I've attempted modifying
XxxEdit.initializeEditingDomain() and creating a custom
AdapterFactoryEditingDomain class but with unsatisfactory results. Where
exactly should I look in the "generated wizard?"

Thanks

Steve


> Steve,

> If you look at the generated wizard, it shows how the editor opened when
> the wizard completes.


> Steve Punte wrote:
>> Hi,
>>
>> I've been using EMF for sometime now, and it's great. In particular,
>> it is very helpful to have the generated EMF editor to directly
>> examine data structures. However, this has always required that I
>> first open an EMF instance/resource with the EMF editor first.
>>
>> Now I really need to have pure runtime software which simply creates
>> and uses EMF objects/structures. No problem: just use
>> XxxxxFactory.eINSTANCE.createYyyy().
>>
>> HOWEVER, it would REALLY be helpful to be able to examine and possibly
>> modify such object structure using the generated EMF editor and/or
>> Outline View and properties page but without going through the steps
>> of using the editor UI to open a file, etc... The goal is not to have
>> a file and possibly not a resource involved.
>>
>> Can someone suggest a, preferable simple, tactic to programmatically
>> open the Editor or Outline View and properties page on an existing
>> in-memory EMF generated object structure?
>>
>> Thanks in advance.
>>
>> Steve
Re: How do I bring editor or view on an existing model instance? [message #420395 is a reply to message #420388] Fri, 27 June 2008 20:54 Go to previous messageGo to next message
Steven Punte is currently offline Steven PunteFriend
Messages: 34
Registered: July 2009
Member
Ed:

Oh, I see now what you are talking about: the XxxModelWizard.java file.

Very interesting. The key issue is supplying some kind of IEditorInput to
page.openEditor(). I tried used CommonSourceNotFoundEditorInput(), but it
resulted in an internal file not found exception.

I'm attempting to create my own IEditorInput class. I see
MyEditorInput.getAdpter() being called with arg classes: IFile,
IFileRevision and IResource. Hmm.

My goals are to open the editor (or possibly the outline view) on an eCore
object preferable with no reference to a file at all. Can I be successful
headed down this path?

Thanks in advance.

Steve




>> If you look at the generated wizard, it shows how the editor opened when
>> the wizard completes.
Re: How do I bring editor or view on an existing model instance? [message #420397 is a reply to message #420395] Sat, 28 June 2008 12:04 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33141
Registered: July 2009
Senior Member
Steve,

Yes, it's certainly possible, but you'll need to add special case
handing with the editor to deal with your type of editor input.


Steve Punte wrote:
> Ed:
>
> Oh, I see now what you are talking about: the XxxModelWizard.java file.
>
> Very interesting. The key issue is supplying some kind of
> IEditorInput to page.openEditor(). I tried used
> CommonSourceNotFoundEditorInput(), but it resulted in an internal file
> not found exception.
>
> I'm attempting to create my own IEditorInput class. I see
> MyEditorInput.getAdpter() being called with arg classes: IFile,
> IFileRevision and IResource. Hmm.
>
> My goals are to open the editor (or possibly the outline view) on an
> eCore object preferable with no reference to a file at all. Can I be
> successful headed down this path?
>
> Thanks in advance.
>
> Steve
>
>
>
>
>>> If you look at the generated wizard, it shows how the editor opened
>>> when the wizard completes.
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:seeking advice: making generated contentproviders filterable
Next Topic:Loading certain parts of an XML as text, not EObjects
Goto Forum:
  


Current Time: Thu Apr 25 22:30:19 GMT 2024

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

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

Back to the top