From 9400f7509c97db2706f8d36f816b7719c11fcb4d Mon Sep 17 00:00:00 2001 From: tkellner Date: Wed, 10 Apr 2013 19:29:00 +0000 Subject: Allow to set title in dialog, use it for overwrite git-svn-id: https://joinup.ec.europa.eu/svn/pdf-over/trunk@344 174cde9d-5d70-4d2a-aa98-46368bc2aaf7 --- .../src/main/java/at/asit/pdfover/gui/controls/Dialog.java | 13 ++++++------- .../main/java/at/asit/pdfover/gui/controls/ErrorDialog.java | 5 ++++- 2 files changed, 10 insertions(+), 8 deletions(-) (limited to 'pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls') diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/Dialog.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/Dialog.java index e6f62637..c86b0e31 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/Dialog.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/Dialog.java @@ -20,8 +20,6 @@ import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.MessageBox; import org.eclipse.swt.widgets.Shell; -import at.asit.pdfover.gui.utils.Messages; - /** * A Message dialog */ @@ -61,15 +59,16 @@ public class Dialog { /** * @param parent The parent shell - * @param message The error message + * @param title The dialog title + * @param message The dialog message * @param button The BUTTONS to be shown * @param icon The ICON to be displayed */ - public Dialog(Shell parent, String message, BUTTONS button, ICON icon) { - this.initialize(parent, message, button, icon); + public Dialog(Shell parent, String title, String message, BUTTONS button, ICON icon) { + this.initialize(parent, title, message, button, icon); } - private void initialize(Shell parent, String message, BUTTONS button, ICON icon) { + private void initialize(Shell parent, String title, String message, BUTTONS button, ICON icon) { int boxstyle = 0; switch (icon) { case ERROR: @@ -106,7 +105,7 @@ public class Dialog { this.box = new MessageBox(parent, boxstyle); this.box.setMessage(message); - this.box.setText(Messages.getString("error.Title")); //$NON-NLS-1$ + this.box.setText(title); } /** diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/ErrorDialog.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/ErrorDialog.java index 6ae8af0e..91100355 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/ErrorDialog.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/controls/ErrorDialog.java @@ -18,6 +18,8 @@ package at.asit.pdfover.gui.controls; // Imports import org.eclipse.swt.widgets.Shell; +import at.asit.pdfover.gui.utils.Messages; + /** * An error dialog */ @@ -28,6 +30,7 @@ public class ErrorDialog extends Dialog { * @param button The buttons to be shown */ public ErrorDialog(Shell parent, String message, BUTTONS button) { - super(parent, message, button, ICON.ERROR); + super(parent, Messages.getString("error.Title"), //$NON-NLS-1$ + message, button, ICON.ERROR); } } -- cgit v1.2.3