public class Alerts
extends java.lang.Object
JOptionPane
's showMessageDialog
methods; the manager
reduces the input parameters to a simplified set and wraps message
elements in GuiUtilities.makeTextComponent(java.lang.String)
-generated components.
Most of the methods that show the manager's alerts take an Object
as the alert's message. This object is treated in much the same way as
the JOptionPane
's message, with the following exceptions:
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ID
Class identification name with source code version and date.
|
Constructor and Description |
---|
Alerts()
Creates a new alert manager with a generic title prefix for the alert
titles.
|
Alerts(java.awt.Component location_component)
Creates a new alert manager with the given location component.
|
Alerts(java.awt.Component location_component,
java.lang.String title_prefix)
Creates a new alert manager with the given location component and title
prefix.
|
Alerts(java.lang.String title_prefix)
Creates a new alert manager with the given title prefix.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
error_title()
Gets the default title used for error alerts.
|
void |
error_title(java.lang.String error_title)
Sets the default title used for error alerts.
|
java.lang.String |
info_title()
Gets the default title used for informational alerts.
|
void |
info_title(java.lang.String info_title)
Sets the default title used for informational alerts.
|
java.awt.Component |
location_component()
Gets the alert manager's location component.
|
void |
location_component(java.awt.Component location_component)
Sets the alert manager's location component.
|
java.lang.String |
plain_title()
Gets the default title used for plain alerts.
|
void |
plain_title(java.lang.String plain_title)
Sets the default title used for plain alerts.
|
void |
show_error(java.lang.Object message)
Displays an error dialog with the given message.
|
void |
show_error(java.lang.Object message,
java.lang.String title)
Displays an error dialog with the given message and title.
|
void |
show_error(java.lang.String message,
java.lang.Throwable throwable)
Displays an error dialog designed for exceptions.
|
void |
show_error(java.lang.String message,
java.lang.Throwable throwable,
java.lang.String title)
Displays an error dialog designed for exceptions.
|
void |
show_info(java.lang.Object message)
Displays an informational dialog with the given message.
|
void |
show_info(java.lang.Object message,
java.lang.String title)
Displays an informational dialog with the given message and title.
|
void |
show_plain(java.lang.Object message)
Displays a plain dialog with the given message.
|
void |
show_plain(java.lang.Object message,
java.lang.String title)
Displays a plain dialog with the given message and title.
|
void |
show_warning(java.lang.Object message)
Displays a warning dialog with the given messsage.
|
void |
show_warning(java.lang.Object message,
java.lang.String title)
Displays a warning dialog with the given message and title.
|
java.lang.String |
warning_title()
Gets the default title used for warning alerts.
|
void |
warning_title(java.lang.String warning_title)
Sets the default title used for warning alerts.
|
public static final java.lang.String ID
public Alerts(java.awt.Component location_component, java.lang.String title_prefix)
The title_prefix is used as the prefix for all alert titles. If the
prefix is null, a generic prefix is used. Plain alerts use the
title prefix alone. Informational alerts use the prefix plus "Info." Warning
alerts use the prefix plus "Warning." Error alerts use the prefix plus
"Error." The plain_title(String)
, info_title(String)
,
warning_title(String)
, and error_title(String)
can modify
the alert titles. Furthermore, each alert can be invoked with its own,
arbitrary title as well.
location_component
- the location component; may be null.title_prefix
- the prefix for the alert titles; may be
null.public Alerts(java.awt.Component location_component)
location_component
- the location component; may be null.Alerts(Component,String)
public Alerts(java.lang.String title_prefix)
title_prefix
- the prefix for the alert titles; may be
null.Alerts(Component,String)
public Alerts()
Alerts(Component,String)
public java.awt.Component location_component()
public void location_component(java.awt.Component location_component)
location_component
- the new location component; may be null.public java.lang.String plain_title()
show_plain(java.lang.Object, java.lang.String)
public void plain_title(java.lang.String plain_title)
plain_title
- the new title for plain alerts.show_plain(java.lang.Object, java.lang.String)
public java.lang.String info_title()
show_info(java.lang.Object, java.lang.String)
public void info_title(java.lang.String info_title)
info_title
- the new title for informational alerts.show_info(java.lang.Object, java.lang.String)
public java.lang.String warning_title()
show_warning(java.lang.Object, java.lang.String)
public void warning_title(java.lang.String warning_title)
warning_title
- the new title for warning alerts.show_warning(java.lang.Object, java.lang.String)
public java.lang.String error_title()
show_error(java.lang.Object, java.lang.String)
public void error_title(java.lang.String error_title)
error_title
- the new title for error alerts.show_error(java.lang.Object, java.lang.String)
public void show_plain(java.lang.Object message, java.lang.String title)
message
- the alert message.title
- the alert title.public void show_plain(java.lang.Object message)
plain_title
is used for the dialog's title.message
- the alert message.public void show_info(java.lang.Object message, java.lang.String title)
message
- the alert message.title
- the alert title.public void show_info(java.lang.Object message)
info_title
is used for the dialog's title.message
- the alert message.public void show_warning(java.lang.Object message, java.lang.String title)
message
- the alert message.title
- the alert title.public void show_warning(java.lang.Object message)
warning_title
is used for the dialog's title.message
- the alert message.public void show_error(java.lang.Object message, java.lang.String title)
message
- the alert message.title
- the alert title.public void show_error(java.lang.Object message)
error_title
is used for the dialog's title.message
- the alert message.public void show_error(java.lang.String message, java.lang.Throwable throwable, java.lang.String title)
extracted
from the throwable.
Note that, unlike the other dialog display methods of the alert manager,
the message of this method is a String
, not a general
Object
.
message
- the error dialog's message.throwable
- the source of the full error message details.title
- the error dialog's title.public void show_error(java.lang.String message, java.lang.Throwable throwable)
error_title
is used for the dialog's title.message
- the error dialog's message.throwable
- the source of the full error message details.show_error(String,Throwable,String)
Copyright \ (C) Arizona Board of Regents on behalf of the \ Planetary Image Research Laboratory, Lunar and \ Planetary Laboratory at the University of Arizona