borland Packages Class Hierarchy dbswing Package
java.lang.Object +----com.borland.dbswing.DBExceptionHandler
Constructors Properties Methods
Implements Designable, Serializable
The DBExceptionHandler
component is the dbSwing package's default DataSetException
handler. It displays an error dialog (DBExceptionDialog
) when a DataSetException
is thrown. See DBExceptionDialog
for descriptions of properties that can be set to configure the capabilities of the error dialog.
If the exception thrown is of type ValidationException
(a subclass of DataSetException
), the error dialog appears only if there are no StatusEvent
listeners on the DataSet
. An example of this is the JdbStatusLabel
component. A ValidationException
is usually generated by a constraint violation, such as a value entered outside the range of allowable minimum or maximum values.
To programmatically suppress this dialog at run time, set the displayErrors
property of the DataSet
to false
.
DBExceptionHandler handler = DBException.getInstance(); try { <some code which could cause a DataSetException> } catch (DataSetException exception) { handler.handleException(dataSet, frame, exception); }
public DBExceptionHandler()Constructs a
DBExceptionHandler
.
public boolean isAllowExit() public void setAllowExit(boolean allowExit)Returns and sets whether an Exit button is displayed when an
Exception
occurs.
public boolean isCloseConnectionsOnExit() public void setCloseConnectionsOnExit(boolean closeConnections)Returns and sets whether any open database connections should be closed when the Exit button is used to terminate an application. This property is
true
by default.
public boolean isCloseDataStoresOnExit() public void setCloseDataStoresOnExit(boolean closeDataStores)Returns and sets whether
DataStores
are automatically detected and closed when the Exit button is used to terminate an application. The default value is true
.
public boolean isDisplayChainedExceptions() public void setDisplayChainedExceptions(boolean displayChains)Returns and sets whether the Next or Previous buttons appear when a
ChainedException
occurs. For non-chained exceptions, this property has no effect. This property value is true
by default.
public boolean isDisplayStackTraces() public void setDisplayStackTraces(boolean displayStack)Returns and sets whether the Stack Trace toggle button appears when an
Exception
occurs. When it is selected, an exception message is displayed along with its stack trace. This property value is true
by default.
public boolean isEnableSecretDebugKey() public void setEnableSecretDebugKey(boolean enableSecretKey)Returns and sets whether the Ctrl-Alt-Shift-D key combination can be used to unconditionally force the display of all buttons when the dialog box is visible. This property value is
true
by default.
public static DBExceptionHandler getInstance()Returns a single instance of
DBExceptionHandler
. Properties set on the instance returned by this method are applied to all the DBExceptionDialogs
that are subsequently displayed.
public static final void handleException(DataSet dataSet, Component component, Exception ex)Calls
handleException(com.borland.dx.dataset.DataSet, java.awt.Component, java.lang.Throwable, boolean)
and passes to it the dataSet
, component
, and ex
parameter values. It also passes false
as the value of the modal
parameter.
dataSet
DataSet
the exception occurs in if the exception is a DataSet
exception.
component
ex
Exception
that occurs.
public static final void handleException(DataSet dataSet, Component component, Throwable ex, boolean modal)This method processes the exception as appropriate.
dataSet
DataSet
the exception occurs in if the exception is a DataSet
exception.
component
ex
Exception
that occurs.
modal
DBExceptionDialog
is modal or not. A modal dialog must be dismissed before using the rest of the program.
public static final void handleException(DataSet dataSet, Exception ex)Calls the
handleException(com.borland.dx.dataset.DataSet, java.awt.Component, java.lang.Throwable, boolean)
method and passes the dataSet
and the ex
parameter values. It passes a null
value for the component
parameter and passes false
as the value of the modal
parameter.
dataSet
DataSet
the exception occurs in if the exception is a DataSet
exception.
ex
Exception
that occurs.
public static final void handleException(Exception ex)Calls the
handleException(com.borland.dx.dataset.DataSet, java.awt.Component, java.lang.Throwable, boolean)
method and passes the exception and null
values for the dataSet
, component
and modal
parameters.
ex
Exception
that occurs.