| java.lang.Object com.sun.rave.designtime.Result
All known Subclasses: com.sun.rave.designtime.CustomizerResult,
Result | public class Result (Code) | | A Result object represents the logical result of an operation. The SUCCESS and
FAILURE Result objects are useful when returning an otherwise empty result with no user
messages. null Results should never be returned, but if one is, it will be treated
as Result.SUCCESS with no messages.
Some Result objects may contain user messages, returned by the 'getMessages()' method. These
messages will be displayed to the user in one of three ways:
Status Bar |
The Status Bar displays very low-importance messages. Any ResultMessage objects of type
ResultMessage.TYPE_INFORMATION will be displayed here, as long as there are no result
options returned from the 'getResultOptions()' method. |
Message Window |
The Message Window displays more important messages than the status bar, as they are
persisted until the user clears the message window. Any ResultMessage objects of type
ResultMessage.TYPE_WARNING will be displayed here, as long as there are no result
options returned from the 'getResultOptions()' method. |
Message Dialog |
A pop-up modal Message Dialog displays the most important messages, as the user must stop
work to 'handle' the dialog. Any ResultMessage objects of type ResultMessage.TYPE_CRITICAL
will be displayed in an modal dialog. If there are any result options returned from the
'getResultOptions()' method, they will be displayed as buttons in the dialog, otherwise
a default 'OK' button will be displayed. If a Result contains messages that are less
than TYPE_CRITICAL, but result options are included - the messages will be 'upgraded' and
displayed in the model dialog, as if they were TYPE_CRITICAL. |
The three most important methods of this class are: 'isSuccess()', 'getMessages()', and
'getMessageOptions()'. These are called by the IDE to investigate the details of a Result
object.
author: Joe Nuxoll version: 1.0 |
FAILURE | final public static Result FAILURE(Code) | | Common instance of a failed result object
|
SUCCESS | final public static Result SUCCESS(Code) | | Common instance of a successful result object
|
dialogTitle | protected String dialogTitle(Code) | | Protected storage for the 'resultDialogTitle' property
|
helpKey | protected String helpKey(Code) | | Protected storage for the 'dialogHelpKey' property
|
messages | protected ArrayList messages(Code) | | Protected storage for the message list (ResultMessage[])
|
options | protected ArrayList options(Code) | | Protected storage for the result option list (DisplayAction[])
|
success | protected boolean success(Code) | | Protected storage for the 'success' property
|
Result | public Result(boolean success)(Code) | | Constructs a Result object with the specified success status
Parameters: success - true if successful, false if not |
Result | public Result(boolean success, ResultMessage message)(Code) | | Constructs a Result object with the specified success status and message
Parameters: success - true if successful, false if not Parameters: message - A ResultMessage to display to the user |
Result | public Result(boolean success, ResultMessage[] messages)(Code) | | Constructs a Result object with the specified success status and messages
Parameters: success - true if successful, false if not Parameters: messages - A set of ResultMessage(s) to display to the user |
Result | public Result(boolean success, ResultMessage[] messages, DisplayAction[] options)(Code) | | Constructs a Result object with the specified success status, messages, and options
Parameters: success - true if successful, false if not Parameters: messages - A set of ResultMessage(s) to display to the user Parameters: options - A set of DisplayAction(s) to present to the user as option buttons |
addMessage | public void addMessage(ResultMessage message)(Code) | | Adds a ResultMessage to this Result to be displayed to the user
Parameters: message - The ResultMessage to add |
addMessages | public void addMessages(ResultMessage[] messages)(Code) | | Adds an array of ResultMessage to this Result to be displayed to the user
Parameters: messages - The array of ResultMessage(s) to add |
addResultOption | public void addResultOption(DisplayAction option)(Code) | | Adds a DisplayAction to this Result to be displayed to the user as an option button in a
dialog
Parameters: option - The DisplayAction to add as an option button |
addResultOptions | public void addResultOptions(DisplayAction[] options)(Code) | | Adds a set of DisplayAction(s) to this Result to be displayed to the user as option buttons
in a dialog
Parameters: options - The DisplayAction(s) to add as option buttons |
getDialogHelpKey | public String getDialogHelpKey()(Code) | | Returns the 'dialogHelpKey' property. The Result can only trigger a dialog if there is a
ResultMessage of TYPE_CRITICAL or there are result options to display.
The help key for the result dialog |
getDialogTitle | public String getDialogTitle()(Code) | | Returns the 'dialogTitle' property. The Result can only trigger a dialog if there is a
ResultMessage of TYPE_CRITICAL or there are result options to display.
The title for the result dialog |
getMessageCount | public int getMessageCount()(Code) | | Returns the count of ResultMessage(s) in this Result
the count of ResultMessage(s) in this Result |
getMessages | public ResultMessage[] getMessages()(Code) | | Returns an (optional) set of ResultMessage objects from the completed operation. Any
ResultMessage objects will be displayed to the user either via the status-line, message
window, or in a dialog - depending on several conditions outlined above.
An array of ResultMessage objects, or null if there the operation produced nomessages |
getResultOptionCount | public int getResultOptionCount()(Code) | | Returns the count of DisplayAction(s) in this Result which will be displayed to the user as
option buttons in a dialog
The count of option buttons to show in the dialog |
getResultOptions | public DisplayAction[] getResultOptions()(Code) | | Returns an (optional) set of DisplayAction objects representing options in a dialog box for
the user. If the returned array is non-null and has more than zero elements, a dialog box
will automatically be shown to the user with a button for each returned DisplayAction. When
the user 'clicks' a particular button, the DisplayAction will be 'invoked()'.
An array of DisplayAction objects representing buttons in a dialog to show the user,or null |
isSuccess | public boolean isSuccess()(Code) | | Returns true if the operation represented by this Result object was successful
true if the operation was successful, false if not |
removeMessage | public void removeMessage(ResultMessage message)(Code) | | Removes a ResultMessage from the set to display to the user
Parameters: message - the ResultMessage to remove from the set |
removeMessages | public void removeMessages(ResultMessage[] messages)(Code) | | Removes an array of ResultMessage(s) from the set to display to the user
Parameters: messages - the ResultMessage(s) to remove from the set |
removeResultOption | public void removeResultOption(DisplayAction option)(Code) | | Removes a DisplayAction (option button in a dialog) from this Result
Parameters: option - The DisplayAction (option button) to remove |
removeResultOptions | public void removeResultOptions(DisplayAction[] options)(Code) | | Removes an array of DisplayAction(s) (option buttons in a dialog) from this Result
Parameters: options - The DisplayAction(s) (option buttons) to remove |
setDialogHelpKey | public void setDialogHelpKey(String helpKey)(Code) | | Sets the 'dialogHelpKey' property. The Result can only trigger a dialog if there is a
ResultMessage of TYPE_CRITICAL or there are result options to display.
Parameters: dialogHelpKey - The desired help key for the result dialog |
setDialogTitle | public void setDialogTitle(String dialogTitle)(Code) | | Sets the 'dialogTitle' property. The Result can only trigger a dialog if there is a
ResultMessage of TYPE_CRITICAL or there are result options to display.
Parameters: dialogTitle - The desired title for the result dialog |
setSuccess | public void setSuccess(boolean success)(Code) | | Sets the success state of this Result
Parameters: success - the success state of this Result |
|
|