|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--javax.swing.JOptionPane | +--planetj.gui.CMOptionPaneJ
CMOptionPaneJ is an extension of the JOptionPane that adds internationalization. Implementors of this class must be sure to call the CM methods, as opposed to directly calling the methods of the JOptionPane, in order to utilize internationalization.
Field Summary | |
static int |
CANCEL_OPTION
Return value from class method if CANCEL is chosen. |
static int |
CLOSED_OPTION
Return value from class method if user closes window without selecting anything, more than likely this should be treated as either a CANCEL_OPTION or NO_OPTION. |
static int |
DEFAULT_OPTION
Type meaning look and feel should not supply any options -- only use the options from the JOptionPane. |
static int |
ERROR_MESSAGE
Used for error messages. |
static String |
ICON_PROPERTY
Bound property name for icon. |
static int |
INFORMATION_MESSAGE
Used for information messages. |
static String |
INITIAL_SELECTION_VALUE_PROPERTY
Bound property name for initialSelectionValue. |
static String |
INITIAL_VALUE_PROPERTY
Bounds property name for initialValue. |
static String |
INPUT_VALUE_PROPERTY
Bound property name for inputValue. |
static String |
MESSAGE_PROPERTY
Bound property name for message. |
static String |
MESSAGE_TYPE_PROPERTY
Bounds property name for type. |
static int |
NO_OPTION
Return value from class method if NO is chosen. |
static int |
OK_CANCEL_OPTION
Type used for showConfirmDialog. |
static int |
OK_OPTION
Return value form class method if OK is chosen. |
static String |
OPTION_TYPE_PROPERTY
Bound property name for optionType. |
static String |
OPTIONS_PROPERTY
Bounds property namer for option. |
static int |
PLAIN_MESSAGE
No icon is used. |
static int |
QUESTION_MESSAGE
Used for questions. |
static String |
SELECTION_VALUES_PROPERTY
Bound property name for selectionValues. |
static Object |
UNINITIALIZED_VALUE
Indicates that the user has not yet selected a value. |
static String |
VALUE_PROPERTY
Bounds property name for value. |
static String |
WANTS_INPUT_PROPERTY
Bound property name for wantsInput. |
static int |
WARNING_MESSAGE
Used for warning messages. |
static int |
YES_NO_CANCEL_OPTION
Type used for showConfirmDialog. |
static int |
YES_NO_OPTION
Type used for showConfirmDialog. |
static int |
YES_OPTION
Return value from class method if YES is chosen. |
Fields inherited from class javax.swing.JComponent |
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
CMOptionPaneJ()
CMOptionPaneJ constructor comment. |
|
CMOptionPaneJ(Object message)
CMOptionPaneJ constructor comment. |
|
CMOptionPaneJ(Object message,
int messageType)
CMOptionPaneJ constructor comment. |
|
CMOptionPaneJ(Object message,
int messageType,
int optionType)
CMOptionPaneJ constructor comment. |
|
CMOptionPaneJ(Object message,
int messageType,
int optionType,
Icon icon)
CMOptionPaneJ constructor comment. |
|
CMOptionPaneJ(Object message,
int messageType,
int optionType,
Icon icon,
Object[] options)
CMOptionPaneJ constructor comment. |
|
CMOptionPaneJ(Object message,
int messageType,
int optionType,
Icon icon,
Object[] options,
Object initialValue)
CMOptionPaneJ constructor comment. |
Method Summary | |
void |
setMessage(Object newMessage)
This method was overridden for I18N. |
void |
show()
Ensure Default Cursor |
static int |
showCMConfirmDialog(Component parentComponent,
Object message)
Overrides the JOptionPane method to provide internationalization. |
static int |
showCMConfirmDialog(Component parentComponent,
Object message,
String title,
int optionType)
Overrides the JOptionPane method to provide internationalization. |
static int |
showCMConfirmDialog(Component parentComponent,
Object message,
String title,
int optionType,
int messageType)
Overrides the JOptionPane method to provide internationalization. |
static int |
showCMConfirmDialog(Component parentComponent,
Object message,
String title,
int optionType,
int messageType,
Icon icon)
|
static String |
showCMInputDialog(Component parentComponent,
Object message)
Overrides the JOptionPane method to provide internationalization. |
static String |
showCMInputDialog(Component parentComponent,
Object message,
String title,
int messageType)
Overrides the JOptionPane method to provide internationalization. |
static Object |
showCMInputDialog(Component parentComponent,
Object message,
String title,
int messageType,
Icon icon,
Object[] selectionValues,
Object initialSelectionValue)
Overrides the JOptionPane method to provide internationalization. |
static String |
showCMInputDialog(Object message)
Overrides the JOptionPane method to provide internationalization. |
static int |
showCMInternalConfirmDialog(Component parentComponent,
Object message)
Overrides the JOptionPane method to provide internationalization. |
static int |
showCMInternalConfirmDialog(Component parentComponent,
Object message,
String title,
int optionType)
Overrides the JOptionPane method to provide internationalization. |
static int |
showCMInternalConfirmDialog(Component parentComponent,
Object message,
String title,
int optionType,
int messageType)
Overrides the JOptionPane method to provide internationalization. |
static int |
showCMInternalConfirmDialog(Component parentComponent,
Object message,
String title,
int optionType,
int messageType,
Icon icon)
Overrides the JOptionPane method to provide internationalization. |
static String |
showCMInternalInputDialog(Component parentComponent,
Object message)
Overrides the JOptionPane method to provide internationalization. |
static String |
showCMInternalInputDialog(Component parentComponent,
Object message,
String title,
int messageType)
Overrides the JOptionPane method to provide internationalization. |
static Object |
showCMInternalInputDialog(Component parentComponent,
Object message,
String title,
int messageType,
Icon icon,
Object[] selectionValues,
Object initialSelectionValue)
Overrides the JOptionPane method to provide internationalization. |
static void |
showCMInternalMessageDialog(Component parentComponent,
Object message)
Overrides the JOptionPane method to provide internationalization. |
static void |
showCMInternalMessageDialog(Component parentComponent,
Object message,
String title,
int messageType)
Overrides the JOptionPane method to provide internationalization. |
static void |
showCMInternalMessageDialog(Component parentComponent,
Object message,
String title,
int messageType,
Icon icon)
Overrides the JOptionPane method to provide internationalization. |
static int |
showCMInternalOptionDialog(Component parentComponent,
Object message,
String title,
int optionType,
int messageType,
Icon icon,
Object[] options,
Object initialValue)
Overrides the JOptionPane method to provide internationalization. |
static void |
showCMMessageDialog(Component parentComponent,
Object message)
Overrides the JOptionPane method to provide internationalization. |
static void |
showCMMessageDialog(Component parentComponent,
Object message,
String title,
int messageType)
Overrides the JOptionPane method to provide internationalization. |
static void |
showCMMessageDialog(Component parentComponent,
Object message,
String title,
int messageType,
Icon icon)
Overrides the JOptionPane method to provide internationalization. |
static int |
showCMOptionDialog(Component parentComponent,
Object message,
String title,
int optionType,
int messageType,
Icon icon,
Object[] options,
Object initialValue)
Overrides the JOptionPane method to provide internationalization. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final Object UNINITIALIZED_VALUE
public static final int DEFAULT_OPTION
public static final int YES_NO_OPTION
public static final int YES_NO_CANCEL_OPTION
public static final int OK_CANCEL_OPTION
public static final int YES_OPTION
public static final int NO_OPTION
public static final int CANCEL_OPTION
public static final int OK_OPTION
public static final int CLOSED_OPTION
public static final int ERROR_MESSAGE
public static final int INFORMATION_MESSAGE
public static final int WARNING_MESSAGE
public static final int QUESTION_MESSAGE
public static final int PLAIN_MESSAGE
public static final String ICON_PROPERTY
public static final String MESSAGE_PROPERTY
public static final String VALUE_PROPERTY
public static final String OPTIONS_PROPERTY
public static final String INITIAL_VALUE_PROPERTY
public static final String MESSAGE_TYPE_PROPERTY
public static final String OPTION_TYPE_PROPERTY
public static final String SELECTION_VALUES_PROPERTY
public static final String INITIAL_SELECTION_VALUE_PROPERTY
public static final String INPUT_VALUE_PROPERTY
public static final String WANTS_INPUT_PROPERTY
Constructor Detail |
public CMOptionPaneJ()
public CMOptionPaneJ(Object message)
message
- java.lang.Objectpublic CMOptionPaneJ(Object message, int messageType)
message
- java.lang.ObjectmessageType
- intpublic CMOptionPaneJ(Object message, int messageType, int optionType)
message
- java.lang.ObjectmessageType
- intoptionType
- intpublic CMOptionPaneJ(Object message, int messageType, int optionType, Icon icon)
message
- java.lang.ObjectmessageType
- intoptionType
- inticon
- javax.swing.Iconpublic CMOptionPaneJ(Object message, int messageType, int optionType, Icon icon, Object[] options)
message
- java.lang.ObjectmessageType
- intoptionType
- inticon
- javax.swing.Iconoptions
- java.lang.Object[]public CMOptionPaneJ(Object message, int messageType, int optionType, Icon icon, Object[] options, Object initialValue)
message
- java.lang.ObjectmessageType
- intoptionType
- inticon
- javax.swing.Iconoptions
- java.lang.Object[]initialValue
- java.lang.ObjectMethod Detail |
public void setMessage(Object newMessage)
setMessage
in class JOptionPane
public void show()
show
in class Component
public static int showCMConfirmDialog(Component parentComponent, Object message)
parentComponent
- Determines the Frame in which the dialog is displayed.
If null, or if the parentComponent has no Frame, a
default Frame is used.message
- The Object to display
public static int showCMConfirmDialog(Component parentComponent, Object message, String title, int optionType)
parentComponent
- Determines the Frame in which the dialog is displayed.
If null, or if the parentComponent has no Frame, a
default Frame is used.message
- The Object to displaytitle
- the title string for the dialogoptionType
- an int designating the options available on the dialog:
YES_NO_OPTION, or YES_NO_CANCEL_OPTION
public static int showCMConfirmDialog(Component parentComponent, Object message, String title, int optionType, int messageType)
parentComponent
- Determines the Frame in which the dialog is displayed.
If null, or if the parentComponent has no Frame, a
default Frame is used.message
- The Object to displaytitle
- the title string for the dialogoptionType
- an int designating the options available on the dialog:
YES_NO_OPTION, or YES_NO_CANCEL_OPTIONmessageType
- an int designating the kind of message this is,
primarily used to determine the icon from the pluggable
look and feel: ERROR_MESSAGE, INFORMATION_MESSAGE,
WARNING_MESSAGE, QUESTION_MESSAGE, or PLAIN_MESSAGE.
public static int showCMConfirmDialog(Component parentComponent, Object message, String title, int optionType, int messageType, Icon icon)
public static String showCMInputDialog(Component parentComponent, Object message)
parentComponent
- the parent Component for the dialogmessage
- the Object to displaypublic static String showCMInputDialog(Component parentComponent, Object message, String title, int messageType)
parentComponent
- the parent Component for the dialogmessage
- the Object to displaytitle
- the String to display in the dialog title barmessageType
- the type of message that is to be displayed:
ERROR_MESSAGE, INFORMATION_MESSAGE, WARNING_MESSAGE,
QUESTION_MESSAGE, or PLAIN_MESSAGE.public static Object showCMInputDialog(Component parentComponent, Object message, String title, int messageType, Icon icon, Object[] selectionValues, Object initialSelectionValue)
parentComponent
- the parent Component for the dialogmessage
- the Object to displaytitle
- the String to display in the dialog title barmessageType
- the type of message to be displayed:
ERROR_MESSAGE, INFORMATION_MESSAGE, WARNING_MESSAGE,
QUESTION_MESSAGE, or PLAIN_MESSAGE.icon
- the Icon image to displayselectionValues
- an array of Objects that gives the possible
selectionsinitialSelectionValue
- the value used to initialize the input
field
public static String showCMInputDialog(Object message)
message
- the Object to displaypublic static int showCMInternalConfirmDialog(Component parentComponent, Object message)
parentComponent
- Determines the Frame in which the dialog is displayed.
If null, or if the parentComponent has no Frame, a
default Frame is used.message
- The Object to display
public static int showCMInternalConfirmDialog(Component parentComponent, Object message, String title, int optionType)
parentComponent
- Determines the Frame in which the dialog is displayed.
If null, or if the parentComponent has no Frame, a
default Frame is used.message
- The object to display in the dialog. A Component object
is rendered as a Component. A String object is rendered
as a string. Other objects are converted to a String
using the toString
method.title
- the title string for the dialogoptionType
- an int designating the options available on the dialog:
YES_NO_OPTION, or YES_NO_CANCEL_OPTION
public static int showCMInternalConfirmDialog(Component parentComponent, Object message, String title, int optionType, int messageType)
parentComponent
- Determines the Frame in which the dialog is displayed.
If null, or if the parentComponent has no Frame, a
default Frame is used.message
- The object to display in the dialog. A Component object
is rendered as a Component. A String object is rendered
as a string. Other objects are converted to a String
using the toString
method.title
- the title string for the dialogoptionType
- an int designating the options available on the dialog:
YES_NO_OPTION, or YES_NO_CANCEL_OPTIONmessageType
- an int designating the kind of message this is,
primarily used to determine the icon from the pluggable
look and feel: ERROR_MESSAGE, INFORMATION_MESSAGE,
WARNING_MESSAGE, QUESTION_MESSAGE, or PLAIN_MESSAGE.
public static int showCMInternalConfirmDialog(Component parentComponent, Object message, String title, int optionType, int messageType, Icon icon)
parentComponent
- Determines the Frame in which the dialog is displayed.
If null, or if the parentComponent has no Frame, a
default Frame is used.message
- The object to display in the dialog. A Component object
is rendered as a Component. A String object is rendered
as a string. Other objects are converted to a String
using the toString
method.title
- the title string for the dialogoptionType
- an int designating the options available on the dialog:
YES_NO_OPTION, or YES_NO_CANCEL_OPTIONmessageType
- an int designating the kind of message this is,
primarily used to determine the icon from the pluggable
look and feel: ERROR_MESSAGE, INFORMATION_MESSAGE,
WARNING_MESSAGE, QUESTION_MESSAGE, or PLAIN_MESSAGE.icon
- the icon to display in the dialog
public static String showCMInternalInputDialog(Component parentComponent, Object message)
parentComponent
- the parent Component for the dialogmessage
- the Object to displaypublic static String showCMInternalInputDialog(Component parentComponent, Object message, String title, int messageType)
parentComponent
- the parent Component for the dialogmessage
- the Object to displaytitle
- the String to display in the dialog title barmessageType
- the type of message that is to be displayed:
ERROR_MESSAGE, INFORMATION_MESSAGE, WARNING_MESSAGE,
QUESTION_MESSAGE, or PLAIN_MESSAGE.public static Object showCMInternalInputDialog(Component parentComponent, Object message, String title, int messageType, Icon icon, Object[] selectionValues, Object initialSelectionValue)
parentComponent
- the parent Component for the dialogmessage
- the Object to displaytitle
- the String to display in the dialog title barmessageType
- the type of message to be displayed:
ERROR_MESSAGE, INFORMATION_MESSAGE, WARNING_MESSAGE,
QUESTION_MESSAGE, or PLAIN_MESSAGE.icon
- the Icon image to displayselectionValues
- an array of Objects that gives the possible
selectionsinitialSelectionValue
- the value used to initialize the input
field
public static void showCMInternalMessageDialog(Component parentComponent, Object message)
parentComponent
- Determines the Frame in which the dialog is displayed.
If null, or if the parentComponent has no Frame, a
default Frame is used.message
- The object to displaypublic static void showCMInternalMessageDialog(Component parentComponent, Object message, String title, int messageType)
parentComponent
- Determines the Frame in which the dialog is displayed.
If null, or if the parentComponent has no Frame, a
default Frame is used.message
- The Object to displaytitle
- the title string for the dialogmessageType
- the type of message to be displayed:
ERROR_MESSAGE, INFORMATION_MESSAGE, WARNING_MESSAGE,
QUESTION_MESSAGE, or PLAIN_MESSAGE.public static void showCMInternalMessageDialog(Component parentComponent, Object message, String title, int messageType, Icon icon)
parentComponent
- Determines the Frame in which the dialog is displayed.
If null, or if the parentComponent has no Frame, a
default Frame is used.message
- The Object to displaytitle
- the title string for the dialogmessageType
- the type of message to be displayed:
ERROR_MESSAGE, INFORMATION_MESSAGE, WARNING_MESSAGE,
QUESTION_MESSAGE, or PLAIN_MESSAGE.icon
- an icon to display in the dialog that helps the user
identify the kind of message that is being displayed.public static int showCMInternalOptionDialog(Component parentComponent, Object message, String title, int optionType, int messageType, Icon icon, Object[] options, Object initialValue)
parentComponent
- Determines the Frame in which the dialog is displayed.
If null, or if the parentComponent has no Frame, a
default Frame is used.message
- The object to display in the dialog. A Component object
is rendered as a Component. A String object is rendered
as a string. Other objects are converted to a String
using the toString
method.title
- the title string for the dialogoptionType
- an int designating the options available on the dialog:
YES_NO_OPTION, or YES_NO_CANCEL_OPTIONmessageType
- an int designating the kind of message this is,
primarily used to determine the icon from the pluggable
look and feel: ERROR_MESSAGE, INFORMATION_MESSAGE,
WARNING_MESSAGE, QUESTION_MESSAGE, or PLAIN_MESSAGE.icon
- the icon to display in the dialogoptions
- an array of objects indicating the possible choices
the user can make. If the objects are components, they
are rendered properly. Non-String objects are
rendered using their toString
methods.
If this parameter is null, the options are determined
by the look and feel.initialValue
- the object that represents the default selection
for the dialog
public static void showCMMessageDialog(Component parentComponent, Object message)
parentComponent
- Determines the Frame in which the dialog is displayed.
If null, or if the parentComponent has no Frame, a
default Frame is used.message
- The Object to displaypublic static void showCMMessageDialog(Component parentComponent, Object message, String title, int messageType)
parentComponent
- Determines the Frame in which the dialog is displayed.
If null, or if the parentComponent has no Frame, a
default Frame is used.message
- The Object to displaytitle
- the title string for the dialogmessageType
- the type of message to be displayed:
ERROR_MESSAGE, INFORMATION_MESSAGE, WARNING_MESSAGE,
QUESTION_MESSAGE, or PLAIN_MESSAGE.public static void showCMMessageDialog(Component parentComponent, Object message, String title, int messageType, Icon icon)
parentComponent
- Determines the Frame in which the dialog is displayed.
If null, or if the parentComponent has no Frame, a
default Frame is used.message
- The Object to displaytitle
- the title string for the dialogmessageType
- the type of message to be displayed:
ERROR_MESSAGE, INFORMATION_MESSAGE, WARNING_MESSAGE,
QUESTION_MESSAGE, or PLAIN_MESSAGE.icon
- an icon to display in the dialog that helps the user
identify the kind of message that is being displayed.public static int showCMOptionDialog(Component parentComponent, Object message, String title, int optionType, int messageType, Icon icon, Object[] options, Object initialValue)
parentComponent
- Determines the Frame in which the dialog is displayed.
If null, or if the parentComponent has no Frame, a
default Frame is used.message
- The Object to displaytitle
- the title string for the dialogoptionType
- an int designating the options available on the dialog:
YES_NO_OPTION, or YES_NO_CANCEL_OPTIONmessageType
- an int designating the kind of message this is,
primarily used to determine the icon from the pluggable
look and feel: ERROR_MESSAGE, INFORMATION_MESSAGE,
WARNING_MESSAGE, QUESTION_MESSAGE, or PLAIN_MESSAGE.icon
- the icon to display in the dialogoptions
- an array of objects indicating the possible choices
the user can make. If the objects are components, they
are rendered properly. Non-String objects are
rendered using their toString
methods.
If this parameter is null, the options are determined
by the look and feel.initialValue
- the object that represents the default selection
for the dialog
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |