|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.jface.window.Window
org.eclipse.jface.dialogs.Dialog
org.eclipse.jface.dialogs.IconAndMessageDialog
org.mailster.gui.dialogs.ErrorDialog
public class ErrorDialog
| Nested Class Summary | |
|---|---|
static class |
ErrorDialog.StringPrintWriter
|
| Nested classes/interfaces inherited from class org.eclipse.jface.window.Window |
|---|
org.eclipse.jface.window.Window.IExceptionHandler |
| Field Summary | |
|---|---|
static boolean |
AUTOMATED_MODE
Static to prevent opening of error dialogs for automated testing. |
private org.eclipse.swt.dnd.Clipboard |
clipboard
The current clipboard. |
private org.eclipse.swt.widgets.Button |
detailsButton
The Details button. |
private int |
displayMask
Filter mask for determining which status items to display. |
private org.eclipse.swt.widgets.List |
list
The SWT list control that displays the error details. |
private static int |
LIST_ITEM_COUNT
Reserve room for this many list items. |
private boolean |
listCreated
Indicates whether the error details viewer is currently created. |
private static java.lang.String |
NESTING_INDENT
The nesting indent. |
private boolean |
shouldIncludeTopLevelErrorInDetails
|
private org.eclipse.core.runtime.IStatus |
status
The main status object. |
private java.lang.String |
title
The title of the dialog. |
| 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 | |
|---|---|
ErrorDialog(org.eclipse.swt.widgets.Shell parentShell,
java.lang.String dialogTitle,
java.lang.String message,
org.eclipse.core.runtime.IStatus status,
int displayMask)
Creates an error dialog. |
|
| Method Summary | |
|---|---|
protected void |
buttonPressed(int id)
|
boolean |
close()
|
protected void |
configureShell(org.eclipse.swt.widgets.Shell shell)
|
private void |
copyToClipboard()
Copy the contents of the statuses to the clipboard. |
protected void |
createButtonsForButtonBar(org.eclipse.swt.widgets.Composite parent)
|
protected void |
createDetailsButton(org.eclipse.swt.widgets.Composite parent)
Create the details button if it should be included. |
protected void |
createDialogAndButtonArea(org.eclipse.swt.widgets.Composite parent)
|
protected org.eclipse.swt.widgets.Control |
createDialogArea(org.eclipse.swt.widgets.Composite parent)
This implementation of the Dialog framework method creates
and lays out a composite and calls createMessageArea and
createCustomArea to populate it. |
protected org.eclipse.swt.widgets.List |
createDropDownList(org.eclipse.swt.widgets.Composite parent)
Create this dialog's drop-down list component. |
protected org.eclipse.swt.graphics.Image |
getImage()
|
private java.util.List<java.lang.String> |
getStackTrace(java.lang.Throwable t)
|
int |
open()
Extends Window.open(). |
static int |
openError(org.eclipse.swt.widgets.Shell parent,
java.lang.String dialogTitle,
java.lang.String message,
org.eclipse.core.runtime.IStatus status)
Opens an error dialog to display the given error. |
static int |
openError(org.eclipse.swt.widgets.Shell parentShell,
java.lang.String title,
java.lang.String message,
org.eclipse.core.runtime.IStatus status,
int displayMask)
Opens an error dialog to display the given error. |
private void |
populateCopyBuffer(org.eclipse.core.runtime.IStatus buildingStatus,
java.lang.StringBuffer buffer,
int nesting)
Put the details of the status of the error onto the stream. |
private void |
populateList(org.eclipse.swt.widgets.List listToPopulate)
Populates the list using this error dialog's status object. |
private void |
populateList(org.eclipse.swt.widgets.List listToPopulate,
org.eclipse.core.runtime.IStatus buildingStatus,
int nesting,
boolean includeStatus)
Populate the list with the messages from the given status. |
private void |
repopulateList()
Repopulate the supplied list widget. |
protected void |
setStatus(org.eclipse.core.runtime.IStatus status)
Set the status displayed by this error dialog to the given status. |
protected static boolean |
shouldDisplay(org.eclipse.core.runtime.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. |
private void |
toggleDetailsArea()
Toggles the unfolding of the details area. |
| Methods inherited from class org.eclipse.jface.dialogs.IconAndMessageDialog |
|---|
createButtonBar, createContents, createMessageArea, getErrorImage, getInfoImage, getMessageLabelStyle, getQuestionImage, getWarningImage |
| Methods inherited from class org.eclipse.jface.dialogs.Dialog |
|---|
applyDialogFont, cancelPressed, convertHeightInCharsToPixels, convertHeightInCharsToPixels, convertHorizontalDLUsToPixels, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, convertVerticalDLUsToPixels, convertWidthInCharsToPixels, convertWidthInCharsToPixels, create, createButton, dialogFontIsDefault, getBlockedHandler, getButton, 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, handleShellCloseEvent, 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 |
| Field Detail |
|---|
public static final boolean AUTOMATED_MODE
private static final int LIST_ITEM_COUNT
private static final java.lang.String NESTING_INDENT
private org.eclipse.swt.widgets.Button detailsButton
private java.lang.String title
private org.eclipse.swt.widgets.List list
private boolean listCreated
private int displayMask
private org.eclipse.core.runtime.IStatus status
private org.eclipse.swt.dnd.Clipboard clipboard
private boolean shouldIncludeTopLevelErrorInDetails
| Constructor Detail |
|---|
public ErrorDialog(org.eclipse.swt.widgets.Shell parentShell,
java.lang.String dialogTitle,
java.lang.String message,
org.eclipse.core.runtime.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.matchesIStatus.matches(int)| Method Detail |
|---|
protected void buttonPressed(int id)
buttonPressed in class org.eclipse.jface.dialogs.Dialogprotected void configureShell(org.eclipse.swt.widgets.Shell shell)
configureShell in class org.eclipse.jface.window.Windowprotected void createButtonsForButtonBar(org.eclipse.swt.widgets.Composite parent)
createButtonsForButtonBar in class org.eclipse.jface.dialogs.Dialogprotected void createDetailsButton(org.eclipse.swt.widgets.Composite parent)
parent - the parent compositeprotected org.eclipse.swt.widgets.Control createDialogArea(org.eclipse.swt.widgets.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.
createDialogArea in class org.eclipse.jface.dialogs.Dialogprotected void createDialogAndButtonArea(org.eclipse.swt.widgets.Composite parent)
createDialogAndButtonArea in class org.eclipse.jface.dialogs.IconAndMessageDialogprotected org.eclipse.swt.graphics.Image getImage()
getImage in class org.eclipse.jface.dialogs.IconAndMessageDialogprotected org.eclipse.swt.widgets.List createDropDownList(org.eclipse.swt.widgets.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.
open in class org.eclipse.jface.window.Window
public static int openError(org.eclipse.swt.widgets.Shell parent,
java.lang.String dialogTitle,
java.lang.String message,
org.eclipse.core.runtime.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(org.eclipse.swt.widgets.Shell parentShell,
java.lang.String title,
java.lang.String message,
org.eclipse.core.runtime.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.IStatus.matches(int)private void populateList(org.eclipse.swt.widgets.List listToPopulate)
listToPopulate - The list to fill.
private void populateList(org.eclipse.swt.widgets.List listToPopulate,
org.eclipse.core.runtime.IStatus buildingStatus,
int nesting,
boolean includeStatus)
listToPopulate - the list to populatebuildingStatus - the status being displayednesting - the nesting level (increases one level for each level of children)includeStatus - whether to include the buildingStatus in the display or
just its childrenprivate java.util.List<java.lang.String> getStackTrace(java.lang.Throwable t)
protected static boolean shouldDisplay(org.eclipse.core.runtime.IStatus status,
int mask)
status - a status objectmask - a mask as per IStatus.matches
true if the given status should be displayed, and
false otherwiseIStatus.matches(int)private void toggleDetailsArea()
private void populateCopyBuffer(org.eclipse.core.runtime.IStatus buildingStatus,
java.lang.StringBuffer buffer,
int nesting)
buildingStatus - buffer - nesting - private void copyToClipboard()
public boolean close()
close in class org.eclipse.jface.dialogs.Dialogprotected 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(org.eclipse.core.runtime.IStatus status)
status - the status to be displayed in the details listprivate void repopulateList()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||