Behavior of BeanDescriptor isContainer not clear

Swing Designer allows you to quickly create the frames, panels, dialogs, applets and other UI elements that comprise Java Swing applications.

Moderators: Konstantin.Scheglov, gnebling, Alexander.Mitin, jwren, Eric Clayberg

Behavior of BeanDescriptor isContainer not clear

Postby schreuerp » Wed Oct 22, 2008 4:28 am

Swing Designer does not prevent adding a component as a child into a self written swing component which is not allowed to have children (like JLabel).
Neither annotations nor the isContainer-Property in the bean descriptor is considered. What else can I do? Actually, does Swing Designer support this feature?

Code: Select all
public BeanDescriptor getBeanDescriptor()
  {
    BeanDescriptor descriptor = new BeanDescriptor(beanClass);
    descriptor.setValue("isContainer", Boolean.FALSE);
    return descriptor;
  }

Code: Select all
  @beaninfo
      attribute: isContainer false




Version: 6.8.0 in RAD 7.0.0.7, Windows XP
schreuerp
 
Posts: 3
Joined: Wed Oct 22, 2008 4:01 am

Re: Behavior of BeanDescriptor isContainer not clear

Postby Eric Clayberg » Wed Oct 22, 2008 2:14 pm

Try this again using the latest build.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Re: Behavior of BeanDescriptor isContainer not clear

Postby schreuerp » Thu Oct 23, 2008 4:26 am

Thanks! "isContainer" in the BeanDescriptor of the BeanInfo-class now works as supposed (since Dev Build 2008.10.22).
However, the property is not considered in subclasses. Therefore, one has to write B_BeanInfo and A_BeanInfo while B extends A.
schreuerp
 
Posts: 3
Joined: Wed Oct 22, 2008 4:01 am

Re: Behavior of BeanDescriptor isContainer not clear

Postby Eric Clayberg » Thu Oct 23, 2008 11:28 am

schreuerp wrote:However, the property is not considered in subclasses. Therefore, one has to write B_BeanInfo and A_BeanInfo while B extends A.

My understanding is that is the expected JavaBean behavior unless you explicitly inherit the attributes as shown here in the section titled "BeanInfo and inherent attributes"...

http://publib.boulder.ibm.com/infocente ... eaninf.htm
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Re: Behavior of BeanDescriptor isContainer not clear

Postby schreuerp » Fri Oct 24, 2008 4:03 am

I dare say you're right.
schreuerp
 
Posts: 3
Joined: Wed Oct 22, 2008 4:01 am

Re: Behavior of BeanDescriptor isContainer not clear

Postby Eric Clayberg » Fri Oct 24, 2008 5:51 am

I hope it works with the suggestion at the above link.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA


Return to Swing Designer

Who is online

Users browsing this forum: Google [Bot] and 1 guest