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 19:48 Go to next message
Bill Brandley is currently offline Bill Brandley
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] Wed, 26 October 2011 20:06 Go to previous messageGo to next message
Eric Clayberg is currently offline Eric Clayberg
Messages: 847
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] Wed, 26 October 2011 20:11 Go to previous messageGo to next message
Bill Brandley is currently offline Bill Brandley
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] Wed, 26 October 2011 20:23 Go to previous messageGo to next message
Eric Clayberg is currently offline Eric Clayberg
Messages: 847
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] Wed, 26 October 2011 21:03 Go to previous messageGo to next message
Bill Brandley is currently offline Bill Brandley
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 00:15 Go to previous message
Eric Clayberg is currently offline Eric Clayberg
Messages: 847
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: Tue Jul 22 17:43:00 EDT 2014

Powered by FUDForum. Page generated in 0.09663 seconds