Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » WindowBuilder » Control declaration ordering
Control declaration ordering [message #753382] Wed, 26 October 2011 23:48 Go to next message
Bill Brandley is currently offline Bill BrandleyFriend
Messages: 12
Registered: October 2011
Junior Member
Hi everyone,

I program with Java but the jobs I do run in batch mode so I have not been able to get into the WindowBuilder GUI and so I decided to do so on my own. Everything is loaded and running fine; however...

To familiarize myself with a first program, I created an JFace/ApplicationWindow project with a push button and a label. I used the buttonUp event to invert the visiblity of the label with each click. In the WindowsBuilder generated code, the label is declared after the button making it necessary for me to rearrange the code for my example to work.

Is this a necessary step or am I missing something?

Thanx,
Bill
Re: Control declaration ordering [message #753383 is a reply to message #753382] Thu, 27 October 2011 00:06 Go to previous messageGo to next message
Eric Clayberg is currently offline Eric ClaybergFriend
Messages: 886
Registered: July 2009
Location: Boston, MA
Senior Member
Sounds like you should have the label defined as a field so you can refer to it from the button.
Re: Control declaration ordering [message #753384 is a reply to message #753383] Thu, 27 October 2011 00:11 Go to previous messageGo to next message
Bill Brandley is currently offline Bill BrandleyFriend
Messages: 12
Registered: October 2011
Junior Member
Thanks very much for the quick response. Would you elaborate a bit on what you mean by field? I am not a GUI type.

Thanx,
Bill
Re: Control declaration ordering [message #753385 is a reply to message #753384] Thu, 27 October 2011 00:23 Go to previous messageGo to next message
Eric Clayberg is currently offline Eric ClaybergFriend
Messages: 886
Registered: July 2009
Location: Boston, MA
Senior Member
You should have the widget assigned to a field rather than a local variable. Any widget that you want to reference programmatically should be a field.
Re: Control declaration ordering [message #753391 is a reply to message #753385] Thu, 27 October 2011 01:03 Go to previous messageGo to next message
Bill Brandley is currently offline Bill BrandleyFriend
Messages: 12
Registered: October 2011
Junior Member
I got it, thank you. I didn't know about the "convert to field" button.

Re: Control declaration ordering [message #753397 is a reply to message #753391] Thu, 27 October 2011 04:15 Go to previous message
Eric Clayberg is currently offline Eric ClaybergFriend
Messages: 886
Registered: July 2009
Location: Boston, MA
Senior Member
There are also code gen options to create all widgets as fields if you prefer.
Previous Topic:initDataBinding called at design time in nested composites
Next Topic:Adding support for Scala/Groovy/etc.
Goto Forum:
  


Current Time: Sun Dec 21 04:57:33 GMT 2014

Powered by FUDForum. Page generated in 0.01799 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software