To show how to use the the JFace builder I converted a couple of applications from the standard SWT example set:
- TextEditor: A simple application showing how to use menubar, toolbar and a StyledText.
- AddressBook: A more complete application with a simple addressbook. Shows how to use toolbars, tables, sorting, Search dialogs, editing, copy/paste
I have on purpose changed the application code as little as possible (only to make work in Groovy), and with the main focus to change the creation of the GUI to show how to use the JFace builder. But it also shows how much easier it is to use the JFace builder.
Here is the extract from the groovy code (63 lines):
And here is the extract from the java code (175 lines)
So basically the groovy code is about 1/3 of the java code and a lot more readable.
For the complete code see the attachment or subversion.
|
|