Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 368453 - Support for mappings/data binding with java enumerations
Summary: Support for mappings/data binding with java enumerations
Status: CLOSED WORKSFORME
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: WindowBuilder (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Andrey Sablin CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-12 09:44 EST by Thomas CLA
Modified: 2021-06-04 16:45 EDT (History)
3 users (show)

See Also:


Attachments
Simplistic test case to reproduce the problem. And screenshot showing the error. (16.14 KB, application/x-zip-compressed)
2012-01-19 06:31 EST, Zoki CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas CLA 2012-01-12 09:44:46 EST
Currently WindowBuilder doesn't support binding java enumerations to controls. This leads to the situation that one cannot consistently use WindowBuilder to define all mappings in a dialog making it less usable for daily productive use.

Because the data binding properties dialog requires the selection of an element bean class, enumerations aren't listed at the moment - while the code generation part needed seems to be the same as for bean classes (bind to WritableList of enumeration type elements).

I would really appreciate if support for data binding with enumerations would be added in a future version of this great tool!

Thanks in advance ;-)
Comment 1 Zoki CLA 2012-01-19 06:31:29 EST
Created attachment 209736 [details]
Simplistic test case to reproduce the problem. And screenshot showing the error.

Just a JFrame with a JCombox, where the items are set from an enum type:

JComboBox comboBox = new JComboBox(TT.values());

This works fine with JDK 1.6, but with JDK 1.7 WB fails opening the Design view, with error: 

"Invalid source. No construcor binding.
new JComboBox(TT.values()) is not valid source for component creation, it references no existring constructor."

Problem on Windows XP, Eclipse Indigo SR1, latest WB (1.2.0.r37x20110927xxxx).

As said, the WB Design has no problem with the same line when working with JDK 1.6, but with JDK 1.7 WB fails.

Please see the attached screenshot and the simplistic java class to reproduce the problem.
Comment 2 Zoki CLA 2012-01-19 06:37:26 EST
One more observation:

The Design view shows the error, but not the "Create Report" button, which is the reason why I manually attached the screenshot and the test class for reproducing the problem here.
Comment 3 Eric Clayberg CLA 2012-01-23 13:35:03 EST
Support for this was added back in November 2011. Please make sure that you are using the latest WB build (1.2.0.r37x20111229 or newer).
Comment 4 Zoki CLA 2012-01-24 03:02:53 EST
Now I'm puzzled:

I use following update site:

WindowsBuilderPro - http://dl.google.com/eclipse/inst/d2wbpro/latest/3.7

When searching for new updates Eclipse tells me there are no updates available.

Following is the exact list of the WindowsBuilder components currently installed:


WindowBuilder Core: 1.2.0.r37x201109270310
WindowBuilder Core UI: 1.2.0.r37x201109270333
WindowBuilder CSS Support: 1.2.0.r37x201109270317
WindowBuilder GroupLayout Support: 1.2.0.r37x201109270343
WindowBuilder XML Core: 1.2.0.r37x201109270326
Comment 5 Zoki CLA 2012-01-24 03:23:28 EST
So how do get the latest version of WB if the UpdateSite doesn't provide it?
Comment 6 Eric Clayberg CLA 2012-01-24 10:28:33 EST
You aren't using the right update site to get the latest build. Use the integration update sites... http://eclipse.org/windowbuilder/download.php
Comment 7 Zoki CLA 2012-01-24 11:34:34 EST
Thanks for clarification. With the updated version the problem vanished.

The only thing that still is wrong is that the page "Installing WindowBuilder Pro" mentions only the wrong update site. See:

http://code.google.com/javadevtools/download-wbpro.html 

->

Eclipse 3.7 (Indigo)
http://dl.google.com/eclipse/inst/d2wbpro/latest/3.7


But my problem is solved.
Comment 8 Eric Clayberg CLA 2012-01-24 12:52:30 EST
There is nothing "wrong" about those update sites. In fact, those are the correct ones to list for that page as they show the update sites for the latest release. For the latest build, you want the updates sites shown here... http://code.google.com/javadevtools/download-wbpro-beta.html