Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Design Question: multiple viewers on one model
Design Question: multiple viewers on one model [message #416137] Fri, 18 January 2008 15:41 Go to next message
Stefan Winkler is currently offline Stefan WinklerFriend
Messages: 307
Registered: July 2009
Location: Germany
Senior Member
Hi,

I have an EMF model, for which I want to provide several viewers showing
different hierarchy levels of that model. I.e. I want to create
something like the viewers in the Java Browsing perspective, which
separates the Java Tree into Package, Class and Member viewers.

As far as I understand, a .genmodel can only create one Edit and Editor
for a model.

So in order to create several viewers, should I create several genmodels
from the one model and then customize the generated edit(or) code in
order to limit the items shown or would it be more efficient to
implement viewers and content providers manually?

Cheers,
Stefan
Re: Design Question: multiple viewers on one model [message #416138 is a reply to message #416137] Fri, 18 January 2008 15:47 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Stefan,

May be it's simple to have only one generated model and edit plugin and
have the filtering code somewhere near your viewers. You could wrap your
content and label providers that you pass into your viewers and let the
wrappers do the viewer specific stuff.

Regards,
Eike Stepper
----
http://wiki.eclipse.org/CDO
http://wiki.eclipse.org/Net4j



Stefan Winkler schrieb:
> Hi,
>
> I have an EMF model, for which I want to provide several viewers
> showing different hierarchy levels of that model. I.e. I want to
> create something like the viewers in the Java Browsing perspective,
> which separates the Java Tree into Package, Class and Member viewers.
>
> As far as I understand, a .genmodel can only create one Edit and
> Editor for a model.
>
> So in order to create several viewers, should I create several
> genmodels from the one model and then customize the generated edit(or)
> code in order to limit the items shown or would it be more efficient
> to implement viewers and content providers manually?
>
> Cheers,
> Stefan


Re: Design Question: multiple viewers on one model [message #416146 is a reply to message #416138] Fri, 18 January 2008 18:16 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
Eike,

Yes, I agree. I wouldn't do this as several models. Rather I'd just
specialize the item providers and a corresponding factory to alter the
default behavior, like we did for XSDSemanticItemProviderAdapterFactory
to show a logical structure as opposed to the physical structure...


Eike Stepper wrote:
> Stefan,
>
> May be it's simple to have only one generated model and edit plugin
> and have the filtering code somewhere near your viewers. You could
> wrap your content and label providers that you pass into your viewers
> and let the wrappers do the viewer specific stuff.
>
> Regards,
> Eike Stepper
> ----
> http://wiki.eclipse.org/CDO
> http://wiki.eclipse.org/Net4j
>
>
>
> Stefan Winkler schrieb:
>> Hi,
>>
>> I have an EMF model, for which I want to provide several viewers
>> showing different hierarchy levels of that model. I.e. I want to
>> create something like the viewers in the Java Browsing perspective,
>> which separates the Java Tree into Package, Class and Member viewers.
>>
>> As far as I understand, a .genmodel can only create one Edit and
>> Editor for a model.
>>
>> So in order to create several viewers, should I create several
>> genmodels from the one model and then customize the generated
>> edit(or) code in order to limit the items shown or would it be more
>> efficient to implement viewers and content providers manually?
>>
>> Cheers,
>> Stefan


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Custom code after initialization (Short question)
Next Topic:Adding Structured editor thow exception in generated editor code.
Goto Forum:
  


Current Time: Sat Apr 27 03:21:38 GMT 2024

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

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

Back to the top