de.cau.cs.kieler.core.ui.errorhandler
Class InternalErrorDialog

java.lang.Object
  extended by org.eclipse.jface.window.Window
      extended by org.eclipse.jface.dialogs.Dialog
          extended by org.eclipse.jface.dialogs.IconAndMessageDialog
              extended by org.eclipse.jface.dialogs.MessageDialog
                  extended by de.cau.cs.kieler.core.ui.errorhandler.InternalErrorDialog
All Implemented Interfaces:
IShellProvider

public class InternalErrorDialog
extends MessageDialog

Added a Details button to the MessageDialog to show the exception stack trace.

Rating red

Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.jface.window.Window
Window.IExceptionHandler
 
Field Summary
 
Fields inherited from class org.eclipse.jface.dialogs.MessageDialog
CONFIRM, ERROR, INFORMATION, NONE, QUESTION, QUESTION_WITH_CANCEL, WARNING
 
Fields inherited from class org.eclipse.jface.dialogs.IconAndMessageDialog
imageLabel, message, messageLabel
 
Fields inherited from class org.eclipse.jface.dialogs.Dialog
blockedHandler, buttonBar, DIALOG_DEFAULT_BOUNDS, DIALOG_PERSISTLOCATION, DIALOG_PERSISTSIZE, dialogArea, DLG_IMG_ERROR, DLG_IMG_HELP, DLG_IMG_INFO, DLG_IMG_MESSAGE_ERROR, DLG_IMG_MESSAGE_INFO, DLG_IMG_MESSAGE_WARNING, DLG_IMG_QUESTION, DLG_IMG_WARNING, ELLIPSIS
 
Fields inherited from class org.eclipse.jface.window.Window
CANCEL, OK
 
Constructor Summary
InternalErrorDialog(Shell parentShell, String dialogTitle, Image dialogTitleImage, String dialogMessage, Throwable detailParam, int dialogImageType, String[] dialogButtonLabels, int defaultIndex)
          Create a new dialog.
 
Method Summary
protected  void buttonPressed(int buttonId)
           
protected  void createDropDownText(Composite parent)
          Create this dialog's drop-down list component.
 int open()
           
static boolean openQuestion(Shell parent, String title, String message, Throwable detail, int defaultIndex)
          Convenience method to open a simple Yes/No question dialog.
 void setDetailButton(int index)
          Set the detail button.
 
Methods inherited from class org.eclipse.jface.dialogs.MessageDialog
configureShell, createButton, createButtonsForButtonBar, createCustomArea, createDialogArea, customShouldTakeFocus, getButton, getButtonLabels, getDefaultButtonIndex, getImage, getMinimumMessageWidth, handleShellCloseEvent, open, openConfirm, openError, openInformation, openQuestion, openWarning, setButtonLabels, setButtons
 
Methods inherited from class org.eclipse.jface.dialogs.IconAndMessageDialog
createButtonBar, createContents, createDialogAndButtonArea, createMessageArea, getErrorImage, getInfoImage, getMessageLabelStyle, getQuestionImage, getWarningImage
 
Methods inherited from class org.eclipse.jface.dialogs.Dialog
applyDialogFont, cancelPressed, close, convertHeightInCharsToPixels, convertHeightInCharsToPixels, convertHorizontalDLUsToPixels, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, convertVerticalDLUsToPixels, convertWidthInCharsToPixels, convertWidthInCharsToPixels, create, dialogFontIsDefault, getBlockedHandler, getButtonBar, getCancelButton, getDialogArea, getDialogBoundsSettings, getDialogBoundsStrategy, getImage, getInitialLocation, getInitialSize, getOKButton, initializeBounds, initializeDialogUnits, isResizable, okPressed, setBlockedHandler, setButtonLayoutData, setButtonLayoutFormData, shortenText
 
Methods inherited from class org.eclipse.jface.window.Window
canHandleShellCloseEvent, constrainShellSize, createShell, getConstrainedShellBounds, getContents, getDefaultImage, getDefaultImages, getDefaultOrientation, getLayout, getParentShell, getReturnCode, getShell, getShellListener, getShellStyle, getWindowManager, handleFontChange, setBlockOnOpen, setDefaultImage, setDefaultImages, setDefaultModalParent, setDefaultOrientation, setExceptionHandler, setParentShell, setReturnCode, setShellStyle, setWindowManager
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InternalErrorDialog

public InternalErrorDialog(Shell parentShell,
                           String dialogTitle,
                           Image dialogTitleImage,
                           String dialogMessage,
                           Throwable detailParam,
                           int dialogImageType,
                           String[] dialogButtonLabels,
                           int defaultIndex)
Create a new dialog.

Parameters:
parentShell - the parent shell
dialogTitle - the title
dialogTitleImage - the title image
dialogMessage - the message
detailParam - the error to display
dialogImageType - the type of image
dialogButtonLabels - the button labels
defaultIndex - the default selected button index
Method Detail

open

public int open()
Overrides:
open in class MessageDialog

setDetailButton

public void setDetailButton(int index)
Set the detail button.

Parameters:
index - the detail button index

buttonPressed

protected void buttonPressed(int buttonId)
Overrides:
buttonPressed in class MessageDialog

createDropDownText

protected void createDropDownText(Composite parent)
Create this dialog's drop-down list component.

Parameters:
parent - the parent composite

openQuestion

public static boolean openQuestion(Shell parent,
                                   String title,
                                   String message,
                                   Throwable detail,
                                   int defaultIndex)
Convenience method to open a simple Yes/No question dialog.

Parameters:
parent - the parent shell of the dialog, or null if none
title - the dialog's title, or null if none
message - the message
detail - the error
defaultIndex - the default index of the button to select
Returns:
true if the user presses the OK button, false otherwise