Class EasyProducerDialog
- java.lang.Object
-
- net.ssehub.easy.producer.ui.productline_editor.EasyProducerDialog
-
public class EasyProducerDialog extends java.lang.ObjectError and Info Box for EASy-Producer. This class should be used to have a global look and feel for error and info dialogs.- Author:
- El-Sharkawy, Kapeluch
-
-
Constructor Summary
Constructors Constructor Description EasyProducerDialog()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intshowDialog(org.eclipse.swt.widgets.Shell parent, java.lang.String title, java.lang.String message, boolean isError)Creates a dialog box, from where the error message can be copy-pasted to somewhere.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 intshowErrorDialog(java.lang.String message)Creates an error dialog.static intshowErrorDialog(org.eclipse.swt.widgets.Shell parent, java.lang.String message)Creates an error dialog.static intshowInfoConfirmDialog(org.eclipse.swt.widgets.Shell parent, java.lang.String message)Shows an information dialog, where the user must decide between yes or no.static intshowInfoDialog(org.eclipse.swt.widgets.Shell parent, java.lang.String message)Shows an info dialog.private static intshowReasonerDialog(org.eclipse.swt.widgets.Shell parent, int messageBoxStyle, java.lang.String title, java.lang.StringBuffer msg, Message... messages)Creates a dialog displaying the result of an earlier reasoner call.static intshowReasonerErrorDialog(org.eclipse.swt.widgets.Shell parent, Message... messages)Creates an error dialog.static intshowReasonerWarningDialog(org.eclipse.swt.widgets.Shell parent, Message... messages)Creates an warning 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:
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 dialogparent- The caller of this dialog.- Returns:
- The result of the dialog or
0
-
showErrorDialog
public static int showErrorDialog(org.eclipse.swt.widgets.Shell parent, java.lang.String message)Creates an error dialog.- Parameters:
message- The error messageparent- The caller of this dialog.- Returns:
- SWT.OK after the dialog is confirmed.
-
showErrorDialog
public static int showErrorDialog(java.lang.String message)
Creates an error dialog.- Parameters:
message- The error message- Returns:
- SWT.OK after the dialog is confirmed.
-
showReasonerErrorDialog
public static int showReasonerErrorDialog(org.eclipse.swt.widgets.Shell parent, Message... messages)Creates an error dialog.- Parameters:
parent- The caller of this dialog.messages- The error messages- Returns:
- SWT.OK after the dialog is confirmed or 0.
-
showReasonerWarningDialog
public static int showReasonerWarningDialog(org.eclipse.swt.widgets.Shell parent, Message... messages)Creates an warning dialog.- Parameters:
parent- The caller of this dialog.messages- The warning messages- Returns:
- SWT.OK after the dialog is confirmed or 0.
-
showReasonerDialog
private static int showReasonerDialog(org.eclipse.swt.widgets.Shell parent, int messageBoxStyle, java.lang.String title, java.lang.StringBuffer msg, Message... messages)Creates a dialog displaying the result of an earlier reasoner call.- Parameters:
parent- The caller of this dialog.messageBoxStyle-- SWT.ICON_ERROR
- SWT.ICON_INFORMATION
- ...
title- Should match to the given icon.- EASyProducerConstants.EASY_PRODUCER_ERROR
- EASyProducerConstants.EASY_PRODUCER_INFO
- ...
msg- The beginning of the message, which shall be displayed.messages- The messages to be displayed- Returns:
- SWT.OK after the dialog is confirmed or 0.
-
showDialog
public static int showDialog(org.eclipse.swt.widgets.Shell parent, java.lang.String title, java.lang.String message, boolean isError)Creates a dialog box, from where the error message can be copy-pasted to somewhere.- Parameters:
parent- The caller of this dialog, maybe null.title- The title of the dialog, should be eitherEASyProducerConstants.EASY_PRODUCER_ERRORorEASyProducerConstants.EASY_PRODUCER_INFOmessage- The message to display on the dialog.isError- Specification whether the displayed message is an error or only an information. true a read error icon will be shown, falsean info icon will be shown- Returns:
- A window's return codes are window-specific, although two standard return codes are predefined:
Window.OKandWindow.CANCEL.
-
showInfoDialog
public static int showInfoDialog(org.eclipse.swt.widgets.Shell parent, java.lang.String message)Shows an info dialog.- Parameters:
parent- The caller of this dialog.message- The information massage- Returns:
- SWT.OK after the dialog is confirmed
-
showInfoConfirmDialog
public static int showInfoConfirmDialog(org.eclipse.swt.widgets.Shell parent, java.lang.String message)Shows an information dialog, where the user must decide between yes or no.- Parameters:
parent- The caller of this dialog.message- The information message- Returns:
- SWT.YES or SWT.NO
-
-