Class EasyProducerDialog


  • public class EasyProducerDialog
    extends java.lang.Object
    Error 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
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      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.
      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.
      static int showErrorDialog​(java.lang.String message)
      Creates an error dialog.
      static int showErrorDialog​(org.eclipse.swt.widgets.Shell parent, java.lang.String message)
      Creates an error dialog.
      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.
      static int showInfoDialog​(org.eclipse.swt.widgets.Shell parent, java.lang.String message)
      Shows an info dialog.
      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.
      static int showReasonerErrorDialog​(org.eclipse.swt.widgets.Shell parent, Message... messages)
      Creates an error dialog.
      static int showReasonerWarningDialog​(org.eclipse.swt.widgets.Shell parent, Message... messages)
      Creates an warning dialog.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • EasyProducerDialog

        public EasyProducerDialog()
    • 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 window
        style - The SWT Style, which specifies the behavior of the dialog
        parent - 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 message
        parent - 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 either EASyProducerConstants.EASY_PRODUCER_ERROR or EASyProducerConstants.EASY_PRODUCER_INFO
        message - 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.OK and Window.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