public final class MessageType
extends org.freedesktop.bindings.Constant
MessageDialog
.
Mostly this is about determining the type of icon that will be shown.Modifier and Type | Field and Description |
---|---|
static MessageType |
ERROR
The Dialog shows an error message.
|
static MessageType |
INFO
The Dialog shows an informational message.
|
static MessageType |
OTHER
Use this when the predefined MessageTypes are not suitable for your
MessageDialog.
|
static MessageType |
QUESTION
The Dialog present a choice to the user.
|
static MessageType |
WARNING
The Dialog shows a warning message.
|
public static final MessageType ERROR
You should use this kind of MessageDialog when an operation requested
by the user cannot be successfully completed. However, if the operation
that has caused the error is a background or periodic operation, you
may want to consider displaying the error by other means, such as a
Statusbar
message, unless the error could result in
data loss or other serious problems.
You should present an OK
Button to let user
close the Dialog. Optionally, if the error can be immediately fixed,
you may add a Button to launch the repair operation (a "Format..."
Button in a "This disk is not formatted" alert, for example).
public static final MessageType INFO
Only use this kind of messages for important information the user must
know before continuing to use the application, or for information the
user has requested. For less important information you shouldn't use a
MessageDialog, but other informational Widgets such as a
Statusbar
.
Consider using a single OK
Button to let the
user close the Dialog.
public static final MessageType OTHER
public static final MessageType QUESTION
Use this type to present Dialogs that ask users to take a non serious
decision. Usually you will provide YES_NO
Buttons to let the user express his choice.
If the choice can have a serious impact in the application, such as the
lost of data, a WARNING
message is a better
alternative.
public static final MessageType WARNING
A typical usage of these messages is to request user confirmation to a potentially dangerous action. You should present such messages when the the task that is going to be executed may destroy user data, create a security risk, or take more than 30 seconds of user effort to recover from if it was selected in error.
While simple warning messages can be correctly handled by
OK_CANCEL
Buttons, in many cases you may
want to provide a Help Button to give the user more information about
the risk, or to replace the OK Button with a message that clearly show
what the Button does. For example, in a "Close without saving?" alert,
the OK text could be "Discard changes". A third Button can also be
useful (for example, a "Save changes" Button in the previous" case. In
all cases a CANCEL Button must be present to let the user cancel the
operation.