Confirm alert in java
A utility class for displaying alerts. Most of the methods on this class just call the equivalent methods on oracle.javatools.dialogs.MessageDialog, which should be used in preference to this class. oracle.ide.dialogs.MessageDialog mostly exists for backward API compatibility.
Field Summary
Return value from confirmOrCancel( Component, Object, String, String, boolean ) indicating that the user dismissed the alert using the Cancel button.
Return value from confirmOrCancel( Component, Object, String, String, boolean ) indicating that the user dismissed the alert using the No button.
Return value from confirmOrCancel( Component, Object, String, String, boolean ) indicating that the user dismissed the alert using the Yes button.
Constructor Summary
Method Summary
Modifier and Type | Method and Description |
---|---|
static boolean | confirm(java.awt.Component parent, java.lang.Object message, java.lang.String title, java.lang.String helptopic) |
Methods inherited from class java.lang.Object
Field Detail
CONFIRM_CANCEL
public static final int CONFIRM_CANCEL
Return value from confirmOrCancel( Component, Object, String, String, boolean ) indicating that the user dismissed the alert using the Cancel button.
CONFIRM_NO
public static final int CONFIRM_NO
Return value from confirmOrCancel( Component, Object, String, String, boolean ) indicating that the user dismissed the alert using the No button.
CONFIRM_YES
public static final int CONFIRM_YES
Return value from confirmOrCancel( Component, Object, String, String, boolean ) indicating that the user dismissed the alert using the Yes button.
Constructor Detail
MessageDialog
Method Detail
error
public static void error(java.awt.Component parent, java.lang.Object message, java.lang.String title, java.lang.String helpTopic)
Display an error alert. An error alert is used to notify the user about an unanticipated condition which prevented the user’s task from completing successfully. The interruption does not result in significant data loss, however the user must resolve the condition before the task can be carried out as planned. Examples of events that can raise error alerts are validation failure, disk full, or network interruption. In general, these are errors that occur within the application and are easily corrected.
confirm
public static boolean confirm(java.awt.Component parent, java.lang.Object message, java.lang.String title, java.lang.String helptopic)
Display a warning / confirmation alert. A confirmation alert is used to warn the user about the consequences of an action, giving the user a chance to accept the consequences, avoid them, or resolve them in some other fashion. When a task initiated by the user raises a confirmation alert, the task does not actually begin until the user responds to the alert. A confirmation alert must be used for destructive operations (like delete) which will result in significant data loss and cannot easily be undone. Examples of events that can raise confirmation alerts are dropping a database table, cancelling an installation, or deleting or overwriting a file.
confirm
public static boolean confirm(java.awt.Component parent, java.lang.Object message, java.lang.String title, java.lang.String helptopic, boolean isDestructive)
Display a warning / confirmation alert. A confirmation alert is used to warn the user about the consequences of an action, giving the user a chance to accept the consequences, avoid them, or resolve them in some other fashion. When a task initiated by the user raises a confirmation alert, the task does not actually begin until the user responds to the alert. A confirmation alert must be used for destructive operations (like delete) which will result in significant data loss and cannot easily be undone. Examples of events that can raise confirmation alerts are dropping a database table, cancelling an installation, or deleting or overwriting a file.
confirm
public static boolean confirm(java.awt.Component parent, java.lang.Object message, java.lang.String title, java.lang.String helptopic, boolean isDestructive, java.lang.String yesText, java.lang.String noText)
Display a warning / confirmation alert. A confirmation alert is used to warn the user about the consequences of an action, giving the user a chance to accept the consequences, avoid them, or resolve them in some other fashion. When a task initiated by the user raises a confirmation alert, the task does not actually begin until the user responds to the alert. A confirmation alert must be used for destructive operations (like delete) which will result in significant data loss and cannot easily be undone. Examples of events that can raise confirmation alerts are dropping a database table, cancelling an installation, or deleting or overwriting a file.
confirmOrCancel
public static int confirmOrCancel(java.awt.Component parent, java.lang.Object message, java.lang.String title, java.lang.String helptopic)
Display a confirmation alert with the option to cancel. A confirmation alert is used to warn the user about the consequences of an action, giving the user a chance to accept the consequences, avoid them, or resolve them in some other fashion. When a task initiated by the user raises a confirmation alert, the task does not actually begin until the user responds to the alert. A confirmation alert must be used for destructive operations (like delete) which will result in significant data loss and cannot easily be undone. Examples of events that can raise confirmation alerts are dropping a database table, cancelling an installation, or deleting or overwriting a file.
confirmOrCancel
public static int confirmOrCancel(java.awt.Component parent, java.lang.Object message, java.lang.String title, java.lang.String helptopic, boolean isDestructive)
Display a confirmation alert with the option to cancel. A confirmation alert is used to warn the user about the consequences of an action, giving the user a chance to accept the consequences, avoid them, or resolve them in some other fashion. When a task initiated by the user raises a confirmation alert, the task does not actually begin until the user responds to the alert. A confirmation alert must be used for destructive operations (like delete) which will result in significant data loss and cannot easily be undone. Examples of events that can raise confirmation alerts are dropping a database table, cancelling an installation, or deleting or overwriting a file.
information
public static void information(java.awt.Component parent, java.lang.Object message, java.lang.String title, java.lang.String helptopic)
Display an information alert. An information alert is used to provide the user with harmless status information. The event communicated by an information alert is not an interruption of a task initiated by the user. The event also has not resulted in data loss and does not require any resolution; it merely informs the user that something has happened. Examples of events that can raise information alerts are completing a compilation, virus definitions becoming out-of-date or the arrival of new mail.
critical
public static void critical(java.awt.Component parent, java.lang.Object message, java.lang.String title, java.lang.String helptopic)
Display a critical alert. A critical alert is used to notify the user about a severe unanticipated condition which will not allow task completion. The interruption may have reseulted in significant data loss, however the is little the user can do to resolve the condition. Examples of events that can raise critical alerts are vendor OS errors, database integrity errors, or web cache corruption. In general, these are potentially harmful events that occur outside of the application and are largely beyond the user’s control.