tags:

views:

122

answers:

5

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 actual examples.

Basically I want the functionality of the Inspector window from XCode or the Properties panel in Netbeans.

Netbeans properties panel

A: 

I really like a new project called NakedObjects

It isn't bean specific, but is more like JPA, with an additional front end creation mechanism. Really interesting. http://nakedobjects.org

Zak
A: 

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)

oxbow_lakes
Actually it's called the Property Editor according to http://java.sun.com/docs/books/tutorial/uiswing/learn/netbeansbasics.html . Unfortunately I've been having a really hard time getting the source to netbeans... is there some trick I'm missing?
I82Much
Downloading through mercurial now: http://wiki.netbeans.org/WorkingWithNetBeansSources
I82Much
The NetBeans stuff is VERY complicated (I have been learning it over the past month or so). Not very well documented, IMO, at least with respect to the property sheets.
I82Much
A: 

Sound like you want the old sun BeanEditor

Tim Williscroft
I cannot find a link to this; is it deprecated and dead?
I82Much
A: 

Found another potential one: Java-Bean-Examiner. But I cannot log into the CVS to download the source.

I82Much
A: 

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

I82Much