Class RuntimeExecutionErrorDialog
- java.lang.Object
-
- org.eclipse.jface.window.Window
-
- org.eclipse.jface.dialogs.Dialog
-
- org.eclipse.jface.dialogs.IconAndMessageDialog
-
- org.eclipse.jface.dialogs.MessageDialog
-
- com._1c.g5.v8.dt.platform.services.ui.runtimes.RuntimeExecutionErrorDialog
-
- All Implemented Interfaces:
org.eclipse.jface.window.IShellProvider
public class RuntimeExecutionErrorDialog extends org.eclipse.jface.dialogs.MessageDialog
Error message dialog with stack trace information.
-
-
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
-
-
Constructor Summary
Constructors Constructor Description RuntimeExecutionErrorDialog(org.eclipse.swt.widgets.Shell parentShell, String message, String title, int dialogImageType, Throwable exception)
Constructor ofRuntimeExecutionErrorDialog
.RuntimeExecutionErrorDialog(org.eclipse.swt.widgets.Shell parentShell, String message, Throwable exception)
Constructor ofRuntimeExecutionErrorDialog
withERROR
dialog image type.RuntimeExecutionErrorDialog(org.eclipse.swt.widgets.Shell parentShell, org.eclipse.core.runtime.IStatus status)
Constructor ofRuntimeExecutionErrorDialog
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
buttonPressed(int id)
Handles the pressing of theOK
orDetails
button in this dialog.protected void
createButtonsForButtonBar(org.eclipse.swt.widgets.Composite parent)
protected org.eclipse.swt.widgets.Control
createDetailsArea(org.eclipse.swt.widgets.Composite parent)
Create the details composite.protected static <T extends Exception>
TgetCauseOfType(Throwable exception, Class<T> causeType)
Returns the cause of the typecauseType
from the given exception, ornull
if the exception is not caused by an exception with typecauseType
.protected String
getMessage(Throwable exception)
Returns error message for given exception.protected static <T extends Exception>
TgetRootCauseOfType(Throwable exception, Class<T> causeType)
Returns the root cause of the typecauseType
from the given exception, ornull
if the exception is not caused by an exception with typecauseType
.protected void
initializeBounds()
protected boolean
isInitiallyOpened(Throwable throwable)
Returns whether error dialog details areas for the given throwable will be initially opened.static int
openError(org.eclipse.swt.widgets.Shell parentShell, String message, Throwable exception)
Opens an error dialog to display the given error, containing in status.static int
openError(org.eclipse.swt.widgets.Shell parentShell, org.eclipse.core.runtime.IStatus status)
Opens an error dialog to display the given error, containing in status.void
setInitiallyOpened(boolean initiallyOpened)
Set whether error dialog details areas will be initially opened.protected String
toString(org.eclipse.core.runtime.IStatus status, String prefix)
Returns multi lineString
presentation of the given multi-status.-
Methods inherited from class org.eclipse.jface.dialogs.MessageDialog
configureShell, createButton, createCustomArea, createDialogArea, customShouldTakeFocus, getButton, getButtonLabels, getDefaultButtonIndex, getImage, getMinimumMessageWidth, handleShellCloseEvent, open, open, openConfirm, openError, openInformation, openQuestion, openWarning, setButtonLabels, setButtons
-
Methods inherited from class org.eclipse.jface.dialogs.IconAndMessageDialog
createButtonBar, createContents, createDialogAndButtonArea, createMessageArea, getColumnCount, 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, 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, open, setBlockOnOpen, setDefaultImage, setDefaultImages, setDefaultModalParent, setDefaultOrientation, setExceptionHandler, setParentShell, setReturnCode, setShellStyle, setWindowManager
-
-
-
-
Constructor Detail
-
RuntimeExecutionErrorDialog
public RuntimeExecutionErrorDialog(org.eclipse.swt.widgets.Shell parentShell, org.eclipse.core.runtime.IStatus status)
Constructor ofRuntimeExecutionErrorDialog
.- Parameters:
parentShell
- the parent shell, ornull
to create a top-level shellstatus
- the error to show to the user, cannot benull
-
RuntimeExecutionErrorDialog
public RuntimeExecutionErrorDialog(org.eclipse.swt.widgets.Shell parentShell, String message, Throwable exception)
Constructor ofRuntimeExecutionErrorDialog
withERROR
dialog image type.- Parameters:
parentShell
- the parent shell, ornull
to create a top-level shellmessage
- the message to show in dialog header, cannot benull
exception
- the exception to print in dialog content, cannot benull
-
RuntimeExecutionErrorDialog
public RuntimeExecutionErrorDialog(org.eclipse.swt.widgets.Shell parentShell, String message, String title, int dialogImageType, Throwable exception)
Constructor ofRuntimeExecutionErrorDialog
.- Parameters:
parentShell
- the parent shell, ornull
to create a top-level shellmessage
- the message to show in dialog header, cannot benull
title
- the shell title, cannot benull
dialogImageType
- one of the following values:MessageDialog.NONE
for a dialog with no imageMessageDialog.ERROR
for a dialog with an error imageMessageDialog.INFORMATION
for a dialog with an information imageMessageDialog.QUESTION
for a dialog with a question imageMessageDialog.WARNING
for a dialog with a warning image
exception
- the exception to print in dialog content, cannot benull
-
-
Method Detail
-
openError
public static int openError(org.eclipse.swt.widgets.Shell parentShell, org.eclipse.core.runtime.IStatus status)
Opens an error dialog to display the given error, containing in status.- Parameters:
parentShell
- the parent shell, ornull
to create a top-level shellstatus
- the error to show to the user, cannot benull
- Returns:
- the code of the button that was pressed that resulted in this dialog closing
-
openError
public static int openError(org.eclipse.swt.widgets.Shell parentShell, String message, Throwable exception)
Opens an error dialog to display the given error, containing in status.- Parameters:
parentShell
- the parent shell, ornull
to create a top-level shellmessage
- the message to show in dialog header, cannot benull
exception
- the exception to print in dialog content, cannot benull
- Returns:
- the code of the button that was pressed that resulted in this dialog closing
-
setInitiallyOpened
public void setInitiallyOpened(boolean initiallyOpened)
Set whether error dialog details areas will be initially opened.- Parameters:
initiallyOpened
- new initially opened state
-
buttonPressed
protected void buttonPressed(int id)
Handles the pressing of theOK
orDetails
button in this dialog.If the
OK
button was pressed then close this dialog. If theDetails
button was pressed then toggle the displaying of the exceptions details area.- Overrides:
buttonPressed
in classorg.eclipse.jface.dialogs.MessageDialog
-
initializeBounds
protected void initializeBounds()
- Overrides:
initializeBounds
in classorg.eclipse.jface.dialogs.Dialog
-
createButtonsForButtonBar
protected void createButtonsForButtonBar(org.eclipse.swt.widgets.Composite parent)
- Overrides:
createButtonsForButtonBar
in classorg.eclipse.jface.dialogs.MessageDialog
-
createDetailsArea
protected org.eclipse.swt.widgets.Control createDetailsArea(org.eclipse.swt.widgets.Composite parent)
Create the details composite. Details composite will contains information about occurred exception.- Parameters:
parent
- the parent composite, cannot benull
- Returns:
- the details composite, never
null
-
getMessage
protected String getMessage(Throwable exception)
Returns error message for given exception.- Parameters:
exception
- exception to get error message for, ornull
if undefined- Returns:
- error message for given exception, never
null
-
toString
protected String toString(org.eclipse.core.runtime.IStatus status, String prefix)
Returns multi lineString
presentation of the given multi-status.- Parameters:
status
- the multi-status to getString
presentation for, cannot benull
prefix
- the prefix to add, cannot benull
, may be empty- Returns:
- multi line
String
presentation of the given multi-status, nevernull
-
isInitiallyOpened
protected boolean isInitiallyOpened(Throwable throwable)
Returns whether error dialog details areas for the given throwable will be initially opened.- Parameters:
throwable
- the throwable to check, cannot benull
- Returns:
- whether error dialog details areas for the given throwable will be initially opened
-
getCauseOfType
protected static <T extends Exception> T getCauseOfType(Throwable exception, Class<T> causeType)
Returns the cause of the typecauseType
from the given exception, ornull
if the exception is not caused by an exception with typecauseType
.If the given exception is instance of
causeType
, returns it.- Parameters:
exception
- the exception to get cause from, cannot benull
causeType
- the exceptiont type to find cause with, cannot benull
- Returns:
- the cause of
causeType
type, if there is one ornull
if none
-
getRootCauseOfType
protected static <T extends Exception> T getRootCauseOfType(Throwable exception, Class<T> causeType)
Returns the root cause of the typecauseType
from the given exception, ornull
if the exception is not caused by an exception with typecauseType
.If the given exception is instance of
causeType
, returns it.- Parameters:
exception
- the exception to get cause from, cannot benull
causeType
- the exceptiont type to find cause with, cannot benull
- Returns:
- the root cause of
causeType
type, if there is one ornull
if none
-
-