Java Beans - creating an inspector window
I'm wondering whether there is an existing Java class that, given a Java bean, uses introspection to find all the publicly modifiable fields, and displays them using default PropertyEditors. I see a bunch of information about BeanInfo, PropertyEditor, Bean Customizers, but nowhere can I find ac开发者_如何学Gotual examples.
Basically I want the functionality of the Inspector window from XCode or the Properties panel in Netbeans.
Found another potential one: Java-Bean-Examiner. But I cannot log into the CVS to download the source.
Looks like L2FProd commons library has something just up my alley:
http://www.l2fprod.com/common/
Searching some more on StackOverflow turned up this answer, in which Yan Cheng Check noted that he extended the classes to be exactly what I need: ObjectInspectorJPanel EnumComboBoxPropertyEditor
NetBeans is open source; you could use that (i.e. find the relevant piece of code within the project - I think it's called the Inspector)
Sound like you want the old sun BeanEditor
精彩评论