Question

Having recently heard about Windowbuilder and its excellent graphical tools, I am looking atways to integrate it into a current SWT project. I would prefer not to start from scratch, though the project has not entered into production, and theoretically has some wiggle room for integration/refactoring time.

The current project uses gridlayout, formlayout, absolutelayout and columnlayout, and uses multiple shells. Currently UI code and button code have been abstracted into separate classes, so the UI template class can be used to instantiate multiple different shells in the same program. It is in the process of being integrated with swt.paperclips. The future of this app will include serial port communication, likely through serialio's SerialPort.

What are the best tools to use to integrate existing code into Windowbuilder using SWT and Eclipse? Are there any caveats or gotchas that I need to watch out for? Are there any tools that allow for creation of reusable UI templates, or am I expected to start from scratch with every layout?

Was it helpful?

Solution

The best answer I can give is to download WindowBuilder and try it out.

In my experience, I have found it very capable of parsing my sources and just working with my current SWT code, provided I am using typical SWT, JFace or RCP idioms and not reinventing the wheel.

Aside: I'm the author of PaperClips so I hope you're having a good experience with it. :-) Be sure to send a note to our Google Groups forum if you have any questions or problems

OTHER TIPS

Just found this in the WindowBuilder FAQ:

Can WindowBuilder Pro edit windows that have been created by hand?

Yes. Most GUI builders in the world will only read and write the code that they themselves create. WindowBuilder Pro is an exception to that rule. It can read and write not only the code it creates, but also a great deal of code written by hand(>90%). If you come across a case that does not work, send it to us for analysis. The more broken examples that we can "fix", the better WindowBuilder Pro will get in the long run (and the better chance you will have of salvaging your old code as-is). Note that dynamic GUI code can not be rendered or edited. The problem with dynamic code is that it generally relies on runtime calculations that have no meaning at runtime. Widgets created in a loop (where the loop parameters are passed in externally) are a good example. Widgets created in conditionals where the value of the conditional is not known until runtime are another example. Dynamic GUI code constructed from the results of complex database queries is yet another example.

Since some of my GUIs are dynamically generated, they don't currently import correctly.

I sent a message to one of the developers on the WindowBuilder project, and they indicated that to make UI templates that can be reused for future use, I can choose to implement factories. In my project, this will require some refactoring, but since there still is more coding to do, I might still save myself time in the long run.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top