Class Dialogs
- java.lang.Object
-
- net.ssehub.easy.producer.ui.application.Dialogs
-
public class Dialogs extends java.lang.ObjectError and Info Box utility class. This class should be used to have a common look and feel for error and info dialogs.- Author:
- Holger Eichelberger
-
-
Constructor Summary
Constructors Modifier Constructor Description privateDialogs()Utility class.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.eclipse.swt.widgets.ShellgetDefaultShell()Returns the default shell of the workbench.static intshowConfirmDialog(org.eclipse.swt.widgets.Shell parent, java.lang.String title, java.lang.String message)Shows a confirmation dialog, where the user must decide between yes or no.private static intshowDialog(org.eclipse.swt.widgets.Shell parent, java.lang.String message, java.lang.String title, int style)Opens a specific dialog with the given parameters.static voidshowErrorDialog(java.lang.String title, java.lang.Class<?> caller, java.lang.Exception exception)Displays an error dialog on the default shell for the given exception on the default shell.static voidshowErrorDialog(java.lang.String title, java.lang.String message)Displays an error dialog on the default shell.static voidshowErrorDialog(org.eclipse.swt.widgets.Shell parent, java.lang.String title, java.lang.Class<?> caller, java.lang.Exception exception)Displays an error dialog for the given exception on the default shell.static voidshowErrorDialog(org.eclipse.swt.widgets.Shell parent, java.lang.String title, java.lang.String message)Shows an error dialog.static intshowInfoConfirmDialog(java.lang.String title, java.lang.String message)Shows a confirmation dialog on the default shell, where the user must decide between yes or no.static voidshowInfoDialog(java.lang.String title, java.lang.String message)Displays an error dialog on the default shell.static voidshowInfoDialog(org.eclipse.swt.widgets.Shell parent, java.lang.String title, java.lang.String message)Shows an info dialog.
-
-
-
Method Detail
-
showDialog
private static int showDialog(org.eclipse.swt.widgets.Shell parent, java.lang.String message, java.lang.String title, int style)Opens a specific dialog with the given parameters.- Parameters:
parent- The parent of this dialog (may be null)message- The message to be shown in the message box.title- The title in the top of the windowstyle- The SWT Style, which specifies the behavior of the dialog- Returns:
- The result of the dialog or
0
-
getDefaultShell
public static org.eclipse.swt.widgets.Shell getDefaultShell()
Returns the default shell of the workbench.- Returns:
- the default shell
-
showErrorDialog
public static void showErrorDialog(java.lang.String title, java.lang.Class<?> caller, java.lang.Exception exception)Displays an error dialog on the default shell for the given exception on the default shell.- Parameters:
title- the title of the error dialogcaller- the calling class (for logging)exception- the exception the message shall be displayed for
-
showErrorDialog
public static void showErrorDialog(org.eclipse.swt.widgets.Shell parent, java.lang.String title, java.lang.Class<?> caller, java.lang.Exception exception)Displays an error dialog for the given exception on the default shell.- Parameters:
parent- The parent of this dialog (may be null, then thedefault shellwill be used)title- the title of the error dialogcaller- the calling class (for logging)exception- the exception the message shall be displayed for
-
showErrorDialog
public static void showErrorDialog(java.lang.String title, java.lang.String message)Displays an error dialog on the default shell.- Parameters:
title- the title of the error dialogmessage- the error message
-
showErrorDialog
public static void showErrorDialog(org.eclipse.swt.widgets.Shell parent, java.lang.String title, java.lang.String message)Shows an error dialog.- Parameters:
parent- The parent of this dialog (may be null, then thedefault shellwill be used)title- the title of the error dialogmessage- the error massage
-
showInfoDialog
public static void showInfoDialog(java.lang.String title, java.lang.String message)Displays an error dialog on the default shell.- Parameters:
title- the title of the error dialogmessage- the error message
-
showInfoDialog
public static void showInfoDialog(org.eclipse.swt.widgets.Shell parent, java.lang.String title, java.lang.String message)Shows an info dialog.- Parameters:
parent- The parent of this dialog (may be null, then thedefault shellwill be used)title- the title of the information dialogmessage- the information massage
-
showInfoConfirmDialog
public static int showInfoConfirmDialog(java.lang.String title, java.lang.String message)Shows a confirmation dialog on the default shell, where the user must decide between yes or no.- Parameters:
title- the title of the confirmation dialogmessage- The confirmation message/question- Returns:
- SWT.YES or SWT.NO
-
showConfirmDialog
public static int showConfirmDialog(org.eclipse.swt.widgets.Shell parent, java.lang.String title, java.lang.String message)Shows a confirmation dialog, where the user must decide between yes or no.- Parameters:
parent- The parent of this dialog (may be null, then thedefault shellwill be used)title- the title of the confirmation dialogmessage- The confirmation message/question- Returns:
- SWT.YES or SWT.NO
-
-