The translation manager can be used to load translations using keys. Regular java property files are used as the underlying storage mechanism (see /res/Translations.properties).
The values in the property file use standard MessageFormat syntax to specify parameters.
The common case to load mnemonics and mnemonic indices is simplified by extending the syntax to use underscores:
The mnemonic will be set to 'S' and index to 0.
The values can be accessed using the TranslationManager:
The CenterPanelDialog class is an extension to the regular JDialog. The method
setCenterPanel is used to set the actual content of the dialog (without buttons).
Dialog buttons (sizing, default command, cancel command)
Buttons can be added using
The first two parameters of
setButtons are used to mark the default and cancel button. A dialog containing one close button thus leads in a possibly strange looking call like:
passing null as an argument will add a small gap between buttons e.g:
will lead to a dialog with three buttons ("OK", "Cancel", "Reset") with a small gap between the cancel and the reset button. okButton is the default, cancelButton is used when disposing the dialog.
Initially focused component
Extended modality (only effective when running on Java 6)
CenterPanelDialog#setModalitycan be used to make the dialog only modal to the parent dialog or to the whole application. http://java.sun.com/javase/6/docs/api/java/awt/Dialog.html#setModalityType(java.awt.Dialog.ModalityType)
All unexpected exceptions resulting in a possibly corrupted state of the ReportDesigner should be added to the UncaughtExcfeptionsModel. This usually leads in a red blinking warning message on the ReportDialog.
FontUtils can be used to derive fonts. StyleContext is internally used to prevent a bug where Japanese characters of a derived font didn't render anymore. Additionally StyleContext uses a simple cache that might speed up the derive operation a little bit.
IOUtil is used to close streams (always close streams accessing native resources).