public class DiagnosticDialog
extends IconAndMessageDialog
Diagnostic
object to the user. If a diagnostic
contains additional detailed information then a Details button is automatically
supplied, which shows or hides an details viewer when pressed by the user.Diagnostic
Constructor and Description |
---|
DiagnosticDialog(Shell parentShell,
java.lang.String dialogTitle,
java.lang.String message,
Diagnostic diagnostic,
int severityMask)
Creates an diagnostic dialog.
|
Modifier and Type | Method and Description |
---|---|
protected void |
buttonPressed(int id)
Handles the pressing of the OK
or Details button in this dialog.
|
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 DiagnosticComposite |
createDiagnosticComposite(Composite parent)
Create the diagnostic composite.
|
protected void |
createDialogAndButtonArea(Composite parent) |
protected Control |
createDialogArea(Composite parent)
This implementation of the
Dialog framework method creates
and lays out a composite. |
protected Image |
getImage() |
DiagnosticComposite.TextProvider |
getTextProvider() |
int |
open()
Extends
Window.open() . |
static int |
open(Shell parent,
java.lang.String dialogTitle,
java.lang.String message,
Diagnostic diagnostic)
Opens a diagnostic dialog to display the given diagnostic.
|
static int |
open(Shell parentShell,
java.lang.String title,
java.lang.String message,
Diagnostic diagnostic,
int displayMask)
Opens an diagnostic dialog to display the given diagnostic.
|
static int |
openProblem(Shell parent,
java.lang.String dialogTitle,
java.lang.String message,
Diagnostic diagnostic)
Opens a diagnostic dialog to display the given diagnostic.
|
protected void |
setDiagnostic(Diagnostic diagnostic)
Set the diagnostic displayed by this diagnostic dialog to the given diagnostic.
|
void |
setTextProvider(DiagnosticComposite.TextProvider textProvider) |
protected static boolean |
shouldDisplay(Diagnostic diagnostic,
int mask)
Returns whether the given diagnostic object should be displayed.
|
protected boolean |
shouldShowDetailsButton()
Return whether the Details button should be included.
|
public DiagnosticDialog(Shell parentShell, java.lang.String dialogTitle, java.lang.String message, Diagnostic diagnostic, int severityMask)
Normally one should use open
to create and open one
of these. This constructor is useful only if the diagnostic 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 diagnostic's message should be shown as the
primary messagediagnostic
- the diagnostic to show to the userseverityMask
- the mask to use to filter the displaying of child items, as
per DiagnosticComposite.severityMatches(Diagnostic, int)
DiagnosticComposite.severityMatches(Diagnostic, int)
public static int open(Shell parent, java.lang.String dialogTitle, java.lang.String message, Diagnostic diagnostic)
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 diagnostic's message should be shown as the
primary messagediagnostic
- the diagnostic to show to the userDialog.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 openProblem(Shell parent, java.lang.String dialogTitle, java.lang.String message, Diagnostic diagnostic)
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 diagnostic's message should be shown as the
primary messagediagnostic
- the diagnostic to show to the userDialog.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 open(Shell parentShell, java.lang.String title, java.lang.String message, Diagnostic diagnostic, 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 diagnostic's message should be shown as the
primary messagediagnostic
- the diagnostic to show to the userdisplayMask
- the mask to use to filter the displaying of child items, as
per DiagnosticComposite.severityMatches(Diagnostic, int)
Dialog.OK
if the OK
button was pressed, or Dialog.CANCEL
if this
dialog's close window decoration or the ESC key was used.DiagnosticComposite.severityMatches(Diagnostic, int)
protected static boolean shouldDisplay(Diagnostic diagnostic, int mask)
diagnostic
- a diagnostic objectmask
- a mask as per DiagnosticComposite.severityMatches(Diagnostic, int)
true
if the given diagnostic should be displayed, and
false
otherwiseDiagnosticComposite.severityMatches(Diagnostic, int)
public void setTextProvider(DiagnosticComposite.TextProvider textProvider)
public DiagnosticComposite.TextProvider getTextProvider()
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. Subclasses that require a different dialog
area may either override this method, or call the super
implementation and add controls to the created composite.protected void createDialogAndButtonArea(Composite parent)
protected Image getImage()
protected DiagnosticComposite createDiagnosticComposite(Composite parent)
parent
- the parent compositepublic int open()
Window.open()
. Opens an diagnostic dialog to display
the diagnostic. If you specified a mask to filter the displaying of these
children, the diagnostic dialog will only be displayed if there is at least
one child diagnostic matching the mask.public boolean close()
protected boolean shouldShowDetailsButton()
protected final void setDiagnostic(Diagnostic diagnostic)
diagnostic
- the diagnostic to be displayed in the diagnostic composite