|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectIconAndMessageDialog
org.csstudio.ui.util.dialogs.ExceptionDetailsErrorDialog
public class ExceptionDetailsErrorDialog
A dialog to display one or more errors to the user, as contained in an
IStatus
object. If an error contains additional detailed
information then a Details button is automatically supplied, which shows or
hides an error details viewer when pressed by the user.
Taken from http://rubenlaguna.com/wp/2007/07/25/eclipse-error-reporting-exception-stacktrace-details/ and modified.
org.eclipse.core.runtime.IStatus
Field Summary | |
---|---|
static boolean |
AUTOMATED_MODE
Static to prevent opening of error dialogs for automated testing. |
Constructor Summary | |
---|---|
ExceptionDetailsErrorDialog(Shell parentShell,
java.lang.String dialogTitle,
java.lang.String message,
IStatus status,
int displayMask)
Creates an error dialog. |
Method Summary | |
---|---|
protected void |
buttonPressed(int id)
|
boolean |
close()
|
protected void |
configureShell(Shell shell)
|
protected void |
createButtonsForButtonBar(Composite parent)
|
protected void |
createDetailsButton(Composite parent)
Create the details button if it should be included. |
protected void |
createDialogAndButtonArea(Composite parent)
|
protected Control |
createDialogArea(Composite parent)
This implementation of the Dialog framework method creates
and lays out a composite and calls createMessageArea and
createCustomArea to populate it. |
protected Text |
createDropDownList(Composite parent)
Create this dialog's drop-down list component. |
protected Image |
getImage()
|
protected boolean |
isResizable()
Allow resize |
int |
open()
Extends Window.open() . |
static int |
openError(Shell shell,
java.lang.String title,
java.lang.Exception ex)
|
static int |
openError(Shell shell,
java.lang.String title,
java.lang.String message,
java.lang.Exception ex)
|
static int |
openError(Shell parent,
java.lang.String dialogTitle,
java.lang.String message,
IStatus status)
Opens an error dialog to display the given error. |
static int |
openError(Shell parentShell,
java.lang.String title,
java.lang.String message,
IStatus status,
int displayMask)
Opens an error dialog to display the given error. |
protected void |
setStatus(IStatus status)
Set the status displayed by this error dialog to the given status. |
protected static boolean |
shouldDisplay(IStatus status,
int mask)
Returns whether the given status object should be displayed. |
protected boolean |
shouldShowDetailsButton()
Return whether the Details button should be included. |
protected void |
showDetailsArea()
Show the details portion of the dialog if it is not already visible. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static boolean AUTOMATED_MODE
Constructor Detail |
---|
public ExceptionDetailsErrorDialog(Shell parentShell, java.lang.String dialogTitle, java.lang.String message, IStatus status, int displayMask)
Normally one should use openError
to create and open one of
these. This constructor is useful only if the error object being
displayed contains child items
parentShell
- the shell under which to create this dialogdialogTitle
- the title to use for this dialog, or null
to
indicate that the default title should be usedmessage
- the message to show in this dialog, or null
to
indicate that the error's message should be shown as the
primary messagestatus
- the error to show to the userdisplayMask
- the mask to use to filter the displaying of child items, as
per IStatus.matches
org.eclipse.core.runtime.IStatus#matches(int)
Method Detail |
---|
protected boolean isResizable()
protected void buttonPressed(int id)
protected void configureShell(Shell shell)
protected void createButtonsForButtonBar(Composite parent)
protected void createDetailsButton(Composite parent)
parent
- the parent compositeprotected Control createDialogArea(Composite parent)
Dialog
framework method creates
and lays out a composite and calls createMessageArea
and
createCustomArea
to populate it. Subclasses should override
createCustomArea
to add contents below the message.
protected void createDialogAndButtonArea(Composite parent)
protected Image getImage()
protected Text createDropDownList(Composite parent)
parent
- the parent composite
public int open()
Window.open()
. Opens an error dialog to display the
error. If you specified a mask to filter the displaying of these
children, the error dialog will only be displayed if there is at least
one child status matching the mask.
public static int openError(Shell parent, java.lang.String dialogTitle, java.lang.String message, IStatus status)
parent
- the parent shell of the dialog, or null
if nonedialogTitle
- the title to use for this dialog, or null
to
indicate that the default title should be usedmessage
- the message to show in this dialog, or null
to
indicate that the error's message should be shown as the
primary messagestatus
- the error to show to the user
Dialog.OK
if the OK
button was pressed, or Dialog.CANCEL
if this
dialog's close window decoration or the ESC key was used.public static int openError(Shell parentShell, java.lang.String title, java.lang.String message, IStatus status, int displayMask)
parentShell
- the parent shell of the dialog, or null
if nonetitle
- the title to use for this dialog, or null
to
indicate that the default title should be usedmessage
- the message to show in this dialog, or null
to
indicate that the error's message should be shown as the
primary messagestatus
- the error to show to the userdisplayMask
- the mask to use to filter the displaying of child items, as
per IStatus.matches
Dialog.OK
if the OK
button was pressed, or Dialog.CANCEL
if this
dialog's close window decoration or the ESC key was used.org.eclipse.core.runtime.IStatus#matches(int)
protected static boolean shouldDisplay(IStatus status, int mask)
status
- a status objectmask
- a mask as per IStatus.matches
true
if the given status should be displayed, and
false
otherwiseorg.eclipse.core.runtime.IStatus#matches(int)
public boolean close()
protected final void showDetailsArea()
createContents
method has been invoked and has returned the control for the content area
of the dialog. Invoking the method before the content area has been set
or after the dialog has been disposed will have no effect.
protected boolean shouldShowDetailsButton()
protected final void setStatus(IStatus status)
status
- the status to be displayed in the details listpublic static int openError(Shell shell, java.lang.String title, java.lang.Exception ex)
public static int openError(Shell shell, java.lang.String title, java.lang.String message, java.lang.Exception ex)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |