Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 348595 - Provide better support for generic properties
Summary: Provide better support for generic properties
Status: CLOSED INVALID
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: WindowBuilder (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Konstantin Scheglov CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-07 11:27 EDT by Konstantin Scheglov CLA
Modified: 2021-06-04 16:45 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Konstantin Scheglov CLA 2011-06-07 11:27:46 EDT
Probably drop using PropertyDescriptor.

See case 47955, problem with DateBox. In UiBinder we don't create property is there are more then one setX() methods with different types. However only reason why we have 2 methods setValue(Object) and setValue(Date) is because first comes from HasValue<T> where T==Date in case of DateBox. Second method is implementation of HasValue.setValue(T) method in DateBox itself.
Comment 1 Konstantin Scheglov CLA 2011-06-07 11:29:20 EDT
We should understand that these two methods are in reality single method/property with type Date.

Also would be good to make it work not only with interfaces, but with classes too. I.e. understand that in SuperClass<T> has methods get/setValue(T) then "SubClass extends SuperClass<String>" practically has methods get/setValue(String), so we should use StringPropertyEditor. Difference with interfaces is that we can not just not analyze interface because we will have implementation of method with correct types; with classes we should propagate actual type argument to methods and may be also to super-super classes. May be OpenJDK provides this for free, but not standard Oracle JDK 6.

Even trickier is support for GenericClass<String> directly in Java source which we design. It seems that we can not use single ComponentDescription in this case, because exact type of properties and instances of PropertyEditor-s depend on the exact values of type arguments. So, loading ComponentDescription should depend not only on Class itself, but also on instantiation types arguments.

And because standard PropertyDescriptor has just get/set Method-s and returns property type based on "bounds" instead of actual types, it looks that it would be easier to get all possible information from PropertyDescriptor and then never use it again anywhere outside of ReflectionUtils.

OMG
Comment 2 Wim Jongman CLA 2021-02-27 12:03:33 EST
Closing. Please reopen if this is still an issue.