|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.metamatrix.common.callback.CallbackChoices
public class CallbackChoices
This callback class is used when a component requires an application to ask for YES/NO, OK/CANCEL, YES/NO/CANCEL or other similar confirmations
Field Summary | |
---|---|
static int |
CANCEL
Return value from class method if CANCEL is chosen. |
static int |
DISMISSED
Return value form class method if this callback is simply dismissed. |
static int |
ERROR_MESSAGE
Used for error messages. |
static int |
INFORMATION_MESSAGE
Used for information messages. |
static int |
NO
Return value from class method if NO is chosen. |
static int |
OK
Return value form class method if OK is chosen. |
static int |
OK_CANCEL_OPTION
Type used to provied Yes or No choice options. |
static int |
QUESTION_MESSAGE
Used for questions. |
static int |
UNSPECIFIED_MESSAGE
Used for generic message. |
static int |
UNSPECIFIED_OPTION
Type used to provied Yes or No choice options. |
static int |
WARNING_MESSAGE
Used for warning messages. |
static int |
YES
Return value from class method if YES is chosen. |
static int |
YES_NO_CANCEL_OPTION
Type used to provied Yes or No choice options. |
static int |
YES_NO_OPTION
Type used to provied Yes or No choice options. |
Constructor Summary | |
---|---|
CallbackChoices(java.lang.String prompt,
int messageType,
int optionType,
int defaultOption)
Construct a CallbackChoices with a message type, an option type and a default option. |
|
CallbackChoices(java.lang.String prompt,
int messageType,
java.lang.String[] options,
int defaultOption)
Construct a CallbackChoices with a message type, a list of options and a default option. |
Method Summary | |
---|---|
int |
getDefaultOption()
Get the default option. |
int |
getMessageType()
Get the message type. |
java.lang.String[] |
getOptions()
Get the confirmation options. |
int |
getOptionType()
Get the option type. |
java.lang.String |
getPrompt()
Get the prompt. |
int |
getSelectedIndex()
Get the selected confirmation option. |
protected boolean |
isOutOfBounds(int choice)
|
void |
setSelectedIndex(int selection)
Set the selected confirmation option. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int UNSPECIFIED_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 DISMISSED
public static final int YES
public static final int NO
public static final int CANCEL
public static final int OK
public static final int UNSPECIFIED_MESSAGE
public static final int ERROR_MESSAGE
public static final int INFORMATION_MESSAGE
public static final int WARNING_MESSAGE
public static final int QUESTION_MESSAGE
Constructor Detail |
---|
public CallbackChoices(java.lang.String prompt, int messageType, int optionType, int defaultOption)
This is used if either a YES/NO, YES/NO/CANCEL or OK/CANCEL confirmation is required.
prompt
- the prompt used to request the informationmessageType
- the message type (INFORMATION_MESSAGE, WARNING_MESSAGE or ERROR_MESSAGE).optionType
- the option type (YES_NO_OPTION, YES_NO_CANCEL_OPTION or OK_CANCEL_OPTION).defaultOption
- the default option from the provided optionType (YES, NO, CANCEL or OK).public CallbackChoices(java.lang.String prompt, int messageType, java.lang.String[] options, int defaultOption)
This is used if either a YES/NO, YES/NO/CANCEL or OK/CANCEL confirmation different from the available preset confirmations provided (for example, CONTINUE/ABORT or STOP/GOis required. The confirmation options are listed in the options array, and are displayed by the CallbackHandler implementation in a manner consistent with the way preset options are displayed.
prompt
- the prompt used to request the informationmessageType
- the message type (INFORMATION_MESSAGE, WARNING_MESSAGE or ERROR_MESSAGE).options
- the list of confirmation options.defaultOption
- the default option, represented as an index into the options array.Method Detail |
---|
public java.lang.String getPrompt()
public int getMessageType()
public int getOptionType()
If this method returns UNSPECIFIED_OPTION, then this ConfirmationCallback was instantiated with options instead of an optionType. In this case, invoke the getOptions method to determine which confirmation options to display
public java.lang.String[] getOptions()
public int getDefaultOption()
public void setSelectedIndex(int selection)
selection
- the selection represented as YES, NO, OK or CANCEL if
an optionType was specified to the constructor of this ConfirmationCallback.
Otherwise, the selection represents the index into the options array
specified to the constructor of this ConfirmationCallbackpublic int getSelectedIndex()
protected boolean isOutOfBounds(int choice)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |