I have an application which displays properties dialogs for various GUI-accessible objects. Because there are a huge number of different kinds objects, there are also a huge number of different properties dialogs. Because we are lazy, we didn’t want to hand-build each and every properties dialog; additionally, plugins might introduce new kinds of objects which also need properties dialogs, and it would be nice if plugin designers didn’t need to hand-code properties dialogs, either (both to save them work, and to ensure that the result is uniform). Instead, we built a framework which maps properties of these objects to GUI components (e.g., checkboxes, text fields, combo boxes) and then packs them all into a dialog. This has the advantage of requiring no work on our part for building the dialogs, but the dialogs also look like we didn’t put any work into laying them out: They look like stacks of Jenga blocks. These dialogs are embarrassing to look at.
So, my question is: Is there any way to automatically layout properties dialogs so they don’t look so utterly ugly? (I realize that the answer to this might be “No”, but it might also be the case that we just haven’t been sufficiently creative in thinking about better ways.) NB: We’re working with Java Swing, but really the problem itself is language-agnostic.
I would put my vote as “no”, at least for sufficiently discriminating definitions of “automatically” and “don’t look so utterly ugly”.
This is definitely a common problem: I think at least three of my coworkers have asked for something like this in the last year alone. Unfortunately, I’m not aware of any automated layout solution that doesn’t require significant guidance (such as specifying layouts in XUI) in order to work.
Obviously, there are simple things you can do to make your automatically-generated components more easily composable, such as standardizing widths and heights of labels and content. There are also some heuristics that you can apply that might help, such as sorting properties by control type so that all of the combo boxes go together, all of the text fields go together, etc.
However, good GUI layout is hard, and even human programmers often seem to do a pretty poor job of it. This is why I’m not surprised that no one has developed a general automated layout tool that doesn’t require specifying a lot of additional information about how the automatically-generated controls are to be presented.