diff options
author | Andreas Fitzek <andreas.fitzek@iaik.tugraz.at> | 2012-11-07 11:16:01 +0100 |
---|---|---|
committer | Andreas Fitzek <andreas.fitzek@iaik.tugraz.at> | 2012-11-07 11:16:14 +0100 |
commit | 2510d4deffa1634593600076e7d5446d2982c9bb (patch) | |
tree | 7f8eac79d8f6394f162c2ae72349b131bc838807 /trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/MainWindow.java | |
parent | f37e3df93655738dbe5e3ea77b764640f1bffbf6 (diff) | |
download | pdf-over-2510d4deffa1634593600076e7d5446d2982c9bb.tar.gz pdf-over-2510d4deffa1634593600076e7d5446d2982c9bb.tar.bz2 pdf-over-2510d4deffa1634593600076e7d5446d2982c9bb.zip |
+ implemented localization configuration and on the fly resource
reloading
Diffstat (limited to 'trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/MainWindow.java')
-rw-r--r-- | trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/MainWindow.java | 42 |
1 files changed, 37 insertions, 5 deletions
diff --git a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/MainWindow.java b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/MainWindow.java index a4798c28..8d633517 100644 --- a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/MainWindow.java +++ b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/MainWindow.java @@ -105,6 +105,8 @@ public class MainWindow { private Map<Buttons, MainBarButton> buttonMap; + private MainBarEndButton btn_end; + /** * Default constructor * @@ -143,6 +145,7 @@ public class MainWindow { if (ctrl instanceof StateComposite) { if (!ctrl.isDisposed()) { ((StateComposite) ctrl).doLayout(); + ((StateComposite) ctrl).reloadResources(); } } } @@ -166,6 +169,35 @@ public class MainWindow { } /** + * Reload the localization + */ + public void reloadLocalization() { + getShell().setText(Messages.getString("main.title")); //$NON-NLS-1$ + this.btn_config.setText(Messages.getString("main.configuration")); //$NON-NLS-1$ + this.btn_config.setToolTipText(Messages.getString("main.configuration")); //$NON-NLS-1$ + this.btn_open.setText(Messages.getString("common.open")); //$NON-NLS-1$ + this.btn_open.setToolTipText(Messages.getString("common.open")); //$NON-NLS-1$ + + this.btn_position.setText(Messages.getString("main.position")); //$NON-NLS-1$ + this.btn_position.setToolTipText(Messages.getString("main.position")); //$NON-NLS-1$ + + + this.btn_sign.setText(Messages.getString("main.signature")); //$NON-NLS-1$ + this.btn_sign.setToolTipText(Messages.getString("main.signature")); //$NON-NLS-1$ + + + this.btn_end.setText(Messages.getString("main.done")); //$NON-NLS-1$ + this.btn_end.setToolTipText(Messages.getString("main.done")); //$NON-NLS-1$ + + Control ctrl = this.stack.topControl; + if (ctrl instanceof StateComposite) { + if (!ctrl.isDisposed()) { + ((StateComposite) ctrl).reloadResources(); + } + } + } + + /** * Create contents of the window. */ protected void createContents() { @@ -293,16 +325,16 @@ public class MainWindow { }); this.buttonMap.put(Buttons.SIGN, this.btn_sign); - MainBarEndButton end = new MainBarEndButton(mainbarContainer, SWT.NONE); + this.btn_end = new MainBarEndButton(mainbarContainer, SWT.NONE); FormData fd_btn_end = new FormData(); fd_btn_end.left = new FormAttachment(81, -1 * (MainBarButton.SplitFactor / 2)); fd_btn_end.right = new FormAttachment(100); fd_btn_end.top = new FormAttachment(0); fd_btn_end.bottom = new FormAttachment(100); - end.setLayoutData(fd_btn_end); - end.setText(Messages.getString("main.done")); //$NON-NLS-1$ - end.setToolTipText(Messages.getString("main.done")); //$NON-NLS-1$ - this.buttonMap.put(Buttons.FINAL, end); + this.btn_end.setLayoutData(fd_btn_end); + this.btn_end.setText(Messages.getString("main.done")); //$NON-NLS-1$ + this.btn_end.setToolTipText(Messages.getString("main.done")); //$NON-NLS-1$ + this.buttonMap.put(Buttons.FINAL, this.btn_end); this.container = new Composite(getShell(), SWT.RESIZE); this.containerFormData = new FormData(); |