Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » WindowBuilder » WindowBuilder 4.7 & java.beans.BeanInfo(WindowBuilder ignores BeanInfo)
WindowBuilder 4.7 & java.beans.BeanInfo [message #1779763] Fri, 12 January 2018 10:07 Go to next message
Avi Abrami is currently offline Avi AbramiFriend
Messages: 29
Registered: December 2017
Junior 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 37 times)
Re: WindowBuilder 4.7 & java.beans.BeanInfo [message #1780796 is a reply to message #1779763] Sat, 27 January 2018 15:04 Go to previous message
Avi Abrami is currently offline Avi AbramiFriend
Messages: 29
Registered: December 2017
Junior Member
Update
I see in the WindowBuilder Pro User Guide there is a FAQ
The answer to the question Can WindowBuilder Pro use custom widgets? contains the following:
Quote:
Custom properties are derived through reflection by looking for getter/setter pairs of known types. If a matching JavaBean class is defined and available, it will be used for any custom properties.

What is meant by matching JavaBean class ?
Previous Topic:WindowBuilder Offline Install
Next Topic:WindowBuilder Mars 2 IDE for JAVA developpers
Goto Forum:
  


Current Time: Fri Sep 21 08:02:07 GMT 2018

Powered by FUDForum. Page generated in 0.04526 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top