Community
Participate
Working Groups
Created attachment 208242 [details] Test widget that fails because isDesignTime() == true within Windows Builder Hi guys, I am trying to upgrade Metawidget to support your excellent Windows Builder. I followed your documentation and added checks to 'Beans.isDesignTime()' to my code. However I have encountered a problem whereby Beans.setDesignTime() doesn't seem to have been set early enough? I attach some example code that demonstrates the problem. Basically, if I try and listen to 'controlMoved' or 'controlResized' then I find Beans.isDesignTime() == false. But if I remove those methods then I find during 'paintControl' that Beans.isDesignTime is true. This behaviour also seems to happen after hitting 'refresh preview'. It appears Window Builder has a custom ClassLoader or something, and this is picking up a different java.beans.Beans instance, which has not had Beans.setDesignTime() called? Regards, Richard.
Created attachment 208440 [details] Works for me in WindowBuilder
I don't see any exceptions in WindowBuilder, when I open TestWidget itself or Application class which uses TestWidget. Beans is class from JDK, so even while we are using custom ClassLoader, we use same class. I don't see any change after "preview".
I also tried your TestWidget and did not see any problems. It rendered correctly and no exceptions appeared in the log. You did not provide any info about which version/build of WB you are using, so all I can suggest is making sure that it is the latest. If you can provide a more detailed test case or set of instructions to reproduce this problem, feel free to reopen this case.
Thank you for trying to reproduce my problem. Apologies for not providing enough detail. I attach a bug report using your (quite awesome!) built-in bug reporter. I am using: * Windows 7 64-bit, version 6.1 (Build 7601: Service Pack 1) * Eclipse Indigo (Indigo Service Release 1 Build id: 20110916-0149) * WindowBuilder Core 1.2.0.r36x201109270310 Steps to reproduce: 1. Run Eclipse, open the 'designtimetest' project 2. Double click on TestForm.xwt (XML Source tab displays okay) 3. Click on the 'Design' tab WindowBuilder crashes with error (see attached)
Created attachment 208469 [details] Bug report (including example project)
Thank you for example. Fixed in trunk. Problem was that we render with "isDesignTime == true", but for XWT parsing was without this flag. Relation with "Preview" can be explained by the fact that it turns "designTime" on/off on show/hide preview window.
Brilliant. Thanks guys. I look forward to next release!