Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 366355 - WindowBuilder does not call Beans.setDesignTime() early enough
Summary: WindowBuilder does not call Beans.setDesignTime() early enough
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: WindowBuilder (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Konstantin Scheglov CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-12 02:01 EST by Richard Kennard CLA
Modified: 2021-06-04 16:44 EDT (History)
3 users (show)

See Also:


Attachments
Test widget that fails because isDesignTime() == true within Windows Builder (1.96 KB, text/plain)
2011-12-12 02:01 EST, Richard Kennard CLA
no flags Details
Works for me in WindowBuilder (78.00 KB, image/png)
2011-12-15 09:33 EST, Konstantin Scheglov CLA
no flags Details
Bug report (including example project) (102.38 KB, application/x-zip-compressed)
2011-12-15 15:31 EST, Richard Kennard CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Kennard CLA 2011-12-12 02:01:21 EST
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.
Comment 1 Konstantin Scheglov CLA 2011-12-15 09:33:20 EST
Created attachment 208440 [details]
Works for me in WindowBuilder
Comment 2 Konstantin Scheglov CLA 2011-12-15 09:37:06 EST
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".
Comment 3 Eric Clayberg CLA 2011-12-15 10:09:43 EST
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.
Comment 4 Richard Kennard CLA 2011-12-15 15:30:21 EST
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)
Comment 5 Richard Kennard CLA 2011-12-15 15:31:16 EST
Created attachment 208469 [details]
Bug report (including example project)
Comment 6 Konstantin Scheglov CLA 2011-12-15 16:17:49 EST
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.
Comment 7 Richard Kennard CLA 2011-12-15 16:24:34 EST
Brilliant. Thanks guys. I look forward to next release!