|
|
|
Re: Question to:Recipe:_Create_an_Eclipse_Forms_editor_with_widgets_for_your_pro [message #418866 is a reply to message #418863] |
Wed, 30 April 2008 11:38 |
Ed Merks Messages: 33141 Registered: July 2009 |
Senior Member |
|
|
Jan,
The property ID is kind of unfortunately just a string, and worse than
that, it's the translated string. :-( I did looked at changing the
getPropertyDescriptor method so it could use either the feature instance
or the string value (returned by
IItemPropertyDescriptor.getId(Object)). That worked nicely, but the
folks asking about it never responded to my proposal, probably because
since IPropertySource itself only has a getDescriptors method, it
doesn't completely eliminate the need to know the ID used for a given
feature (such as when using JFace's new PropertyColumnLabelProvider to
show a table column based on a property descriptor). Maybe what we
ought to provide is a utility that given a feature and a resource
locator, returns the display name and hence the ID for that feature.
I'll talk to Dave about that later today... For now, you could write
your own utility that iterates over all the descriptors and calls
getFeature for each one to match the feature you want...
Jan Kohnert wrote:
> Thank you Ed!
>
> When calling 'getPropertyDescriptor()' I've to pass a pbject and a
> propertyId. Since the API documentation keeps shtum about what a
> propertyId exactly has to be I'd to try around a bit. I've tried
> 'ObjectsPackage.Literals.SAMPLE__VOLUME' ,
> 'ObjectsPackage.Literals.SAMPLE__VOLUME.getFeatureID()' and
> 'ObjectsPackage.SAMPLE__VOLUME', but each of that solutions always
> made getPropertyDescriptor return 'null' :(
>
> What do I have to pass as propertyId?
>
> Thanks!
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.02703 seconds