Design Question: multiple viewers on one model [message #416137] |
Fri, 18 January 2008 10:41  |
Eclipse User |
|
|
|
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 10:47   |
Eclipse User |
|
|
|
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 13:16  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.03953 seconds