java-gnome version 4.0.19

org.gnome.gtk
Class MessageType

Object
  extended by org.freedesktop.bindings.Constant
      extended by org.gnome.gtk.MessageType

public final class MessageType
extends org.freedesktop.bindings.Constant

The type of the message shown in a MessageDialog. Mostly this is about determining the type of icon that will be shown.

Since:
4.0.5
Author:
Vreixo Formoso

Field Summary
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.
 
Method Summary
 
Methods inherited from class org.freedesktop.bindings.Constant
toString
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ERROR

public static final MessageType ERROR
The Dialog shows an error message.

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).


INFO

public static final MessageType INFO
The Dialog shows an informational message.

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.


OTHER

public static final MessageType OTHER
Use this when the predefined MessageTypes are not suitable for your MessageDialog. In that cases you may want to add a custom icon to the Dialog.


QUESTION

public static final MessageType QUESTION
The Dialog present a choice to the user.

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.


WARNING

public static final MessageType WARNING
The Dialog shows a warning message.

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.



java-gnome