|
Eclipse Platform 2.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.eclipse.jface.window.Window | +--org.eclipse.jface.dialogs.Dialog | +--org.eclipse.jface.dialogs.ErrorDialog
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.
IStatus
Nested Class Summary |
Nested classes inherited from class org.eclipse.jface.window.Window |
Window.IExceptionHandler |
Field Summary |
Fields inherited from class org.eclipse.jface.dialogs.Dialog |
DLG_IMG_ERROR, DLG_IMG_INFO, DLG_IMG_MESSAGE_ERROR, DLG_IMG_MESSAGE_INFO, DLG_IMG_MESSAGE_WARNING, DLG_IMG_QUESTION, DLG_IMG_WARNING |
Fields inherited from class org.eclipse.jface.window.Window |
CANCEL, OK |
Constructor Summary | |
ErrorDialog(Shell parentShell,
String dialogTitle,
String message,
IStatus status,
int displayMask)
Creates an error dialog. |
Method Summary | |
protected void |
buttonPressed(int id)
Notifies that this dialog's button with the given id has been pressed. |
protected void |
configureShell(Shell shell)
Configures the given shell in preparation for opening this window in it. |
protected Control |
createButtonBar(Composite parent)
Creates and returns the contents of this dialog's button bar. |
protected void |
createButtonsForButtonBar(Composite parent)
Adds buttons to this dialog's button bar. |
protected Control |
createContents(Composite parent)
The Dialog implementation of this Window method
creates and lays out the top level composite for the dialog, and
determines the appropriate horizontal and vertical dialog units
based on the font size. |
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 List |
createDropDownList(Composite parent)
Create this dialog's drop-down list component. |
protected Control |
createMessageArea(Composite composite)
Create the area the message will be shown in. |
protected Image |
getImage()
Returns the image to display beside the message in this dialog. |
int |
open()
Extends Window.open() . |
static int |
openError(Shell parent,
String dialogTitle,
String message,
IStatus status)
Opens an error dialog to display the given error. |
static int |
openError(Shell parentShell,
String title,
String message,
IStatus status,
int displayMask)
Opens an error dialog to display the given error. |
protected static boolean |
shouldDisplay(IStatus status,
int mask)
Returns whether the given status object should be displayed. |
Methods inherited from class org.eclipse.jface.window.Window |
close, create, createShell, getContents, getDefaultImage, getInitialLocation, getInitialSize, getParentShell, getReturnCode, getShell, getShellListener, getShellStyle, getWindowManager, handleFontChange, handleShellCloseEvent, initializeBounds, setBlockOnOpen, setDefaultImage, setExceptionHandler, setReturnCode, setShellStyle, setWindowManager |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ErrorDialog(Shell parentShell, String dialogTitle, 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
IStatus.matches(int)
Method Detail |
protected void buttonPressed(int id)
Dialog
The Dialog
implementation of this framework method calls
okPressed
if the ok button is the pressed,
and cancelPressed
if the cancel button is the pressed.
All other button presses are ignored. Subclasses may override
to handle other buttons, but should call super.buttonPressed
if the default handling of the ok and cancel buttons is desired.
buttonPressed
in class Dialog
id
- the id of the button that was pressed (see
IDialogConstants.*_ID
constants)protected void configureShell(Shell shell)
Window
The default implementation of this framework method sets the shell's image and gives it a grid layout. Subclasses may extend or reimplement.
configureShell
in class Window
shell
- the shellprotected void createButtonsForButtonBar(Composite parent)
Dialog
The Dialog
implementation of this framework method adds
standard ok and cancel buttons using the createButton
framework method. These standard buttons will be accessible from
getCancelButton
, and getOKButton
.
Subclasses may override.
createButtonsForButtonBar
in class Dialog
parent
- the button bar compositeprotected Control createMessageArea(Composite composite)
protected Control createButtonBar(Composite parent)
Dialog
The Dialog
implementation of this framework method
lays out a button bar and calls the createButtonsForButtonBar
framework method to populate it. Subclasses may override.
The returned control's layout data must be an instance of
GridData
.
createButtonBar
in class Dialog
parent
- the parent composite to contain the button bar
protected Control createContents(Composite parent)
Dialog
Dialog
implementation of this Window
method
creates and lays out the top level composite for the dialog, and
determines the appropriate horizontal and vertical dialog units
based on the font size. It then calls the createDialogArea
and createButtonBar
methods to create the dialog area
and button bar, respectively. Overriding createDialogArea
and
createButtonBar
are recommended rather than overriding
this method.
createContents
in class Dialog
protected 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.
createDialogArea
in class Dialog
parent
- the parent composite to contain the dialog area
protected Image getImage()
Subclasses may override.
protected List 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.
open
in class Window
Window.create()
public static int openError(Shell parent, String dialogTitle, 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, String title, String message, IStatus status, int displayMask)
parentShell
- the parent shell of the dialog, or null
if nonemessage
- 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)
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
otherwiseIStatus.matches(int)
|
Eclipse Platform 2.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |