|
From: Appleton, R. <ric...@ci...> - 2003-11-03 16:42:51
|
Having built a similar utility in the past I have some comments about = this tool. In general the XML is very long winded : I prefer using attributes = rather than nested elements because for any form type GUI with a = reasonable number of fields the definition could get very, very long. The concept of a GUI builder can be taken much further. I implemented: - binding of controls to actions - formatting and parsing using logical formats - logical colour definitions - I18N support - population of combo-box lists - support for sorting tables - support for dividing GUI into separate files per business model = component To do this the build process consists of: - create business model component - register business model actions with builder - register business model and table models with builder - build GUI - post-build associate non-generic event-handlers with controls = (referenced by control id) A configuration file is used to define which tags, formats, layouts, etc = are recognized by the builder, so it is possible to add in one's own = controls and layout managers, etc. The configuration file also defines = logical formats and colours, and also combo box lookup lists (which = again can be configured to be supplied by a custom class). (Lookup = lists are associated with a combo box control via a 'lookup' attribute = on the 'combo' element). A logical format could be 'percentage' (number format with style =3D = 'percent'), 'price' (defined as pattern for decimal formatter), = 'shortdate' (date format with style =3D'short'). Binding classes are = provided by the tool to interface between a GUI control and a model's = property (for text fields performing parsing and formatting as required = by the logical format set using a 'format' attribute). Errors are = highlighted in the field using the 'error' logical colour. The point about all of this is to enable business developers to = concentrate on providing non-swing business models, not learning swing. = Things like setting default buttons on dialogs, binding buttons to model = actions, parsing and formatting values for display in a text field are = all things that such a GUI builder can do which add value over coding = swing directly. It is also much easier to change a format or colour = defined in a single configuration file! > Richard Appleton > London > Tel: 44 20 7986 4899 >=20 |