Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [gef-dev] showing properties in the property view


This is a common problem.  You just need a metamodel similar to BeanDescriptors in the bean specification, perhaps using EMF with metamodel annotations for indicating things like CellEditors, etc. Google introspection and metamodels.

--randy



Andreas Heinecke <heinecke@xxxxxxxxxxxxx>
Sent by: gef-dev-admin@xxxxxxxxxxx

03/10/2005 12:14 PM

Please respond to
gef-dev

To
gef-dev@xxxxxxxxxxx
cc
Subject
Re: [gef-dev] showing properties in the property view





Hi,

in my oppinion ... this is quite difficult. The problem is that you need to
know how each property will be represented by a certain PropertyDescriptor.
If all properties will be represented by a TextPropertyDescriptor it would be
easier to solve your problem. But thats not the fact now.
Try making a getProperty() call enumerate over this collection and generate a
TextPropertyDescriptor for each property contained. Save your generated
PropertyDescriptors in a Hashtable with unique identifiers.
Implement the methods your class inherits from IPropertySource. The parameter
"id" each method gets must now be mapped to the corresponding property.
Assuming all methods from IPropertySource are implemented now and your
editor-class is prepared for using the propertysheet, everything will work.

Please tell me if this works ...

regards

Andreas

Am Donnerstag, 10. März 2005 16:24 schrieb GUNJAN SINGH:
> HI! All
> Im making a application based on GEF framework and im relatively new to
> this design. Im facing a situation wherein i have to show the properties
> (at the property view of eclipse )which are known at the runtime i.e im
> making a api call getProperties() to know about the properties. This method
> returns me  a collection of properties which needs to be shown at the
> Property View. My understanding of gef says that every attributes of a
> model will be shown in the Property View .for example suppose we have
> Person model and its attributes are name,age,sex,surname.
> So we have the getter/setter methods for these attributes....where these
> values are set. and in the Property View we can then show
> name,age,sex,surname and its corrosponding values. Here we know the
> attributes at the compile time only.
>
> But in my case i dont know wht are the attributes which i have to show , at
> the compile time. as i come to know about the attributes only when i make a
> api cal to getProperties(). so i cant have the corrosponding get/set for
> these attributes.
> Even the values are taken by making a call to database.
>
> So wht should i do?????
> can any one tell me wht is the solution for this
>
> thanking in advance
>  cheers
>
>
>
> can
>
>
>
> Ved Gunjan
> SCJP1.4
>
>
>
> ---------------------------------
> Do you Yahoo!?
>  Make Yahoo! your home page


Attachment: atte4rgs.dat
Description: Binary data


Back to the top