org.scopemvc.core
Class ControlException

java.lang.Object
  |
  +--java.lang.Throwable
        |
        +--java.lang.Exception
              |
              +--org.scopemvc.util.LocalizedException
                    |
                    +--org.scopemvc.core.ControlException
All Implemented Interfaces:
java.io.Serializable

public final class ControlException
extends LocalizedException

Controllers throw ControlExceptions while responding to Controls if something goes wrong that must be reported to the user. A ControlException is a LocalizedException.

ControlExceptions contain a Control ID that can be used by an error handler to identify the Control that caused the exception. For example, the Control ID could be used to get a String title from UIStrings for a Swing error dialog. The error handling implementation in BasicController automatically populates the Control ID.

Version:
$Revision: 1.4 $ $Date: 2002/09/05 15:41:45 $
Author:
Steve Meyfroidt
See Also:
Serialized Form

Constructor Summary
ControlException(java.lang.String inMessageID)
          Constructor for the ControlException object
ControlException(java.lang.String inMessageID, java.lang.Object inMessageParameter)
          Constructor for the ControlException object
ControlException(java.lang.String inMessageID, java.lang.Object[] inMessageParameters)
          Constructor for the ControlException object
 
Method Summary
 java.lang.String getLocalizedSourceControlName()
          Use the source Control ID to get a localised name from the UIStrings.
 void setSourceControlID(java.lang.String inSourceControlID)
          Sets the ID of the Control being executed when the error was detected.
 
Methods inherited from class org.scopemvc.util.LocalizedException
getLocalizedMessage
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ControlException

public ControlException(java.lang.String inMessageID)
Constructor for the ControlException object

Parameters:
inMessageID - a message ID that identifies the localised user-readable message in UIStrings

ControlException

public ControlException(java.lang.String inMessageID,
                        java.lang.Object inMessageParameter)
Constructor for the ControlException object

Parameters:
inMessageID - a message ID that identifies the localised user-readable message in UIStrings
inMessageParameter - one parameter to be substituted in the message as MessageFormat

ControlException

public ControlException(java.lang.String inMessageID,
                        java.lang.Object[] inMessageParameters)
Constructor for the ControlException object

Parameters:
inMessageID - a message ID that identifies the localised user-readable message in UIStrings
inMessageParameters - a set of parameters to be substituted in the message as MessageFormat
Method Detail

getLocalizedSourceControlName

public final java.lang.String getLocalizedSourceControlName()
Use the source Control ID to get a localised name from the UIStrings.

Returns:
Localized name of Control ID or empty String if no Control ID set.

setSourceControlID

public final void setSourceControlID(java.lang.String inSourceControlID)
Sets the ID of the Control being executed when the error was detected.
For use by a ControlException handler only, not for application writers.

Parameters:
inSourceControlID - the ID of the Control executing when the error was detected.


Copyright © 2000-2002 The Scope Team. All Rights Reserved.