As I continue to build my first SWT Designer UI, I am wondering how best to modularize the application in terms of .java files, classes, and methods.
I am starting with an SWT Application, as part of a Designer SWT/JFace Java Project. The left hand side of the app is a SWT Control Tree sitting inside a Composite. The right hand side is a Composite with a StackLayout.
There will be 20 to 30 leaf nodes in the left hand side tree. Clicking on any one of these leaf nodes will display a different "stack" in the right hand side. So, I'll have 20+ stacks that will be displayed in the right hand side. Some nodes will by dynamically added to the tree, based on the business logic.
By default, the entire UI gets dumped into the createContents() method. I have started to hand edit the main .java file that was created when I created a new SWT Application. I have started to break createContents() this into multiple private methods, many associated with each individual stack.
This would appear to work just fine, but I'm looking for any tips and advice. My .java file, and this class, is going to get huge. I don't have a major problem with this, as long as it is a sensible approach. I'm wondering if instead I should somehow be creating multiple java classes for the UI? Or should I leave the entire UI in this one .java file?
Eventually, I'll be adding business logic. I assume I'll create these in separate .java files. How does SWT Designer accomodate that?
Feel free to point me to other Instantiations or other newsgroup posts, eclipse help, or whatever else you recommend. I'm simply trying to use the "right" SWT-Designer/Eclipse/Java approach from the beginning.
Thanks