WindowBuilder 4.7 & java.beans.BeanInfo [message #1779763] |
Fri, 12 January 2018 10:07 |
Avi Abrami Messages: 31 Registered: December 2017 |
Member |
|
|
Eclipse Oxygen (4.7.2) & WindowBuilder (4.7) on Windows 10 with JDK 1.8.0_151
Can someone confirm? It appears to me that WindowBuilder ignores the *BeanInfo classes, apart from custom property editors and cistomizers.
Attached is a screen capture using the java code below.
First my bean class.
public class Fu extends javax.swing.JLabel {
private String bar;
public String getBar() {
return bar;
}
public void setBar(String bar) {
this.bar = bar;
}
}
Next my BeanInfo class.
public class FuBeanInfo extends java.beans.SimpleBeanInfo {
public java.beans.BeanDescriptor getBeanDescriptor() {
return new java.beans.BeanDescriptor(Fu.class);
}
public java.beans.PropertyDescriptor[] getPropertyDescriptors() {
java.beans.PropertyDescriptor[] propertyDescriptors = new java.beans.PropertyDescriptor[1];
try {
propertyDescriptors[0] = new java.beans.PropertyDescriptor("bar", Fu.class, "getBar", "setBar");
propertyDescriptors[0].setHidden(true);
}
catch (java.beans.IntrospectionException x) {
propertyDescriptors = null;
}
return propertyDescriptors;
}
}
As you can see in the screen capture, "bar" appears in the Properties table, even though in the "FuBeanInfo" class, it is set as hidden. I repeat, it appears that anything I do in the BeanInfo class is ignored, not just the "hidden" feature. For example also the "display name" is ignored. Only the "property editor" is not ignored. Am I missing something? Am I doing something wrong? Perhaps someone can point me to the relevant WindowBuilder code so that I can investigate the cause of this behavior?
Cheers,
Avi.
-
Attachment: wndwbldr.png
(Size: 81.91KB, Downloaded 161 times)
|
|
|
|
Powered by
FUDForum. Page generated in 0.03772 seconds