property type

SWT Designer allows you to create the views, editors, perspectives, pref pages, composites, etc. that comprise Eclipse SWT & RCP applications and plug-ins.

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

property type

Postby Jannikh » Wed Aug 06, 2008 5:51 am

Hi,
I've created a very simple class which contains one getter and setter pair. The setMethod looks like this: setToolkit(FormToolkit tk). I've added it to the palette to see how the property "toolkit" would be handled. It appears nicely and a dropdown is available for choosing the value, but the dropdown is empty. How can I populate this dropdown?
What I really need is to be able to choose the already instantiated FormToolkit object.
...and what I really really need is for this formtoolkit object to be be parsed as an argument in the constructor of my class.

best regards,
Jannik
Jannikh
 
Posts: 5
Joined: Wed Aug 06, 2008 5:37 am

Re: property type

Postby Eric Clayberg » Wed Aug 06, 2008 11:56 am

SWT Designer already had built-in support for FormToolkit objects which made them incompatible for use as normal bean property types.

We have tweaked things a bit, so give this a try using the very latest SWT Designer 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: property type

Postby Jannikh » Thu Aug 07, 2008 3:58 am

Ok, I updated to latest RCP Developer (same release but different release date?). That didn't solve it.
Just so I'm not going down a dead end:
1: can I instantiate an object with a constructor which takes arguments? Just like the FormToolKit automatically gets Display.getCurrent() as an argument.
2: When I have a get method which takes an arguement, can I get a dropdown in the properties view filled in with the already instantiated objects of the relevant type (in this case the FormToolkit object I've already created).

br,
Jannik
Jannikh
 
Posts: 5
Joined: Wed Aug 06, 2008 5:37 am

Re: property type

Postby Eric Clayberg » Thu Aug 07, 2008 5:17 am

Jannikh wrote:I updated to latest RCP Developer (same release but different release date?). That didn't solve it.

You need to install the latest SWT Designer build as stated above. The latest RCP Developer build won't help you.

Jannikh wrote:1: can I instantiate an object with a constructor which takes arguments? Just like the FormToolKit automatically gets Display.getCurrent() as an argument.

No. Only JavaBean compliant, non-visual objects with default constructors may be used. SWT Designer has special knowledge of FormToolkit which allows it to be instantiated properly.

Jannikh wrote:2: When I have a get method which takes an arguement, can I get a dropdown in the properties view filled in with the already instantiated objects of the relevant type (in this case the FormToolkit object I've already created).

The dropdown list will show all all relevant non-visual objects added to the design via the Choose Bean command. The latest SWT Designer build will also show any FormToolkit objects added via the palette.
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: property type

Postby Jannikh » Fri Aug 08, 2008 2:51 am

Hi again,

I've updated to the latest swt designer but the result is the same. The dropdown has a size of what looks like 5 or 6 but it is empty. I've made sure that the FormToolkit that I want to show up in the dropdown has class scope, but it doesn't make any difference. It is still empty.

Any ideas?

br,
Jannik
Jannikh
 
Posts: 5
Joined: Wed Aug 06, 2008 5:37 am

Re: property type

Postby Konstantin.Scheglov » Fri Aug 08, 2008 4:39 am

Jannikh wrote:Hi again,

I've updated to the latest swt designer but the result is the same. The dropdown has a size of what looks like 5 or 6 but it is empty. I've made sure that the FormToolkit that I want to show up in the dropdown has class scope, but it doesn't make any difference. It is still empty.

Any ideas?

br,
Jannik


Can you send test case?
Konstantin.Scheglov
Moderator
 
Posts: 186
Joined: Tue Oct 18, 2005 8:11 pm
Location: Russian Federation, Lipetsk

Re: property type

Postby Jannikh » Sun Aug 10, 2008 11:56 pm

Hi,

yes, please find attached zip file. Viewpart class is Test.java and the bean class is GUIUtil.java. I've included a screenshot of the properties view with the empty dropdown opened.

Thank you in advance,
Jannik
Attachments
instantiations_test.zip
ViewPart: Test.java
Bean class: GUIUtil.java
Screenshot of dropdown: dropdown-sshot.jpg
(75.29 KiB) Downloaded 81 times
Jannikh
 
Posts: 5
Joined: Wed Aug 06, 2008 5:37 am

Re: property type

Postby Eric Clayberg » Mon Aug 11, 2008 5:52 am

Jannikh wrote:yes, please find attached zip file. Viewpart class is Test.java and the bean class is GUIUtil.java. I've included a screenshot of the properties view with the empty dropdown opened.

Are you sure you are using the latest SWT Designer build? What version/build is shown on the main Designer preference page?

I tried your example and it worked fine. See the following screen shots...

Test1.jpg
Drop down FormToolkit property
Test1.jpg (52.88 KiB) Viewed 1308 times

Test2.jpg
After toolkit item selected
Test2.jpg (53.15 KiB) Viewed 1312 times

Test3.jpg
Newly generated code
Test3.jpg (41.4 KiB) Viewed 1313 times
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: property type

Postby Jannikh » Tue Aug 12, 2008 1:37 am

I'm using version 6.7.0.200808032103 for Eclipse 3.4
Jannikh
 
Posts: 5
Joined: Wed Aug 06, 2008 5:37 am

Re: property type

Postby Eric Clayberg » Tue Aug 12, 2008 3:49 am

Jannikh wrote:I'm using version 6.7.0.200808032103 for Eclipse 3.4

That is not the latest build. The build you are using is from August 3rd (20080803).

The fix was put in place August 6th, so you need to use a build newer than the one you are currently using.
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 SWT Designer

Who is online

Users browsing this forum: No registered users and 2 guests