com.sas.util.errorhandlers
Class MessageBoxErrorHandler

com.sas.util.errorhandlers.MessageBoxErrorHandler
All Implemented Interfaces:
ErrorHandlerInterface, java.io.Serializable

public class MessageBoxErrorHandler
implements ErrorHandlerInterface, java.io.Serializable

MessageBoxErrorHandler is an error handler which displays a MessageBox when handleError() is called. The MessageBox displays the passed in message and an Ok button.

See Also:
Serialized Form

Field Summary
protected  java.awt.Frame frame
          The frame to parent the MessageBox dialog to.
protected  java.lang.String overrideMessage
          A message used to override the message returned by the validator.
static java.lang.String RB_KEY
           
 
Constructor Summary
MessageBoxErrorHandler()
          Default constructor
MessageBoxErrorHandler(java.awt.Component frame)
          Constructor.
MessageBoxErrorHandler(java.awt.Component frame, java.lang.String overrideMessage)
          Constructor.
MessageBoxErrorHandler(java.lang.String overrideMessage)
          Constructor.
 
Method Summary
 void handleError(com.sas.ComponentInterface component, com.sas.text.Message message, java.lang.String messageCode)
          handleError should perform whatever action is desired when an error occurs.
 

Field Detail

RB_KEY

public static final java.lang.String RB_KEY
See Also:
Constant Field Values

frame

protected java.awt.Frame frame
The frame to parent the MessageBox dialog to.


overrideMessage

protected java.lang.String overrideMessage
A message used to override the message returned by the validator.

Constructor Detail

MessageBoxErrorHandler

public MessageBoxErrorHandler()
Default constructor


MessageBoxErrorHandler

public MessageBoxErrorHandler(java.lang.String overrideMessage)
Constructor.

Parameters:
overrideMessage - A message to display instead of the message returned by the validator.

MessageBoxErrorHandler

public MessageBoxErrorHandler(java.awt.Component frame)
Constructor.

Parameters:
frame - A java.awt.Component used to determine the parent frame for the MessageBox dialog.

MessageBoxErrorHandler

public MessageBoxErrorHandler(java.awt.Component frame,
                              java.lang.String overrideMessage)
Constructor.

Parameters:
frame - A java.awt.Component used to determine the parent frame for the MessageBox dialog.
overrideMessage - A message to display instead of the message returned by the validator.
Method Detail

handleError

public void handleError(com.sas.ComponentInterface component,
                        com.sas.text.Message message,
                        java.lang.String messageCode)
Description copied from interface: ErrorHandlerInterface
handleError should perform whatever action is desired when an error occurs. Examples might be displaying a MessageBox, writing a message to the log, or printing a message to a stream.

Specified by:
handleError in interface ErrorHandlerInterface
Parameters:
component - The component on which the error occured.
message - A Message object with formatted with the message to display. The object should also contain the necessary arguments for formatting the message.
messageCode - A non-translatable string which indicates the type of error that occured.



Copyright © 2009 SAS Institute Inc. All Rights Reserved.