org.ceryle.util
Interface SafeQuit

All Known Implementing Classes:
Desktop

public interface SafeQuit

A simple interface between a message handler and any implementing class. This permits a message to be passed to the application asking if the current count of warnings and errors warrants an application abort, and secondly, a method politely requesting to quit the application.

Since:
JDK1.3
Version:
$Id: SafeQuit.java,v 3.2 2007-06-15 12:09:57 altheim Exp $
Author:
Murray Altheim

Method Summary
 void quit(boolean confirm, boolean force)
          An indication to quit the application.
 boolean terminateOnError(int warnings, int maxWarnings, int errors, int maxErrors)
          This method is to be called if the number of warnings or errors exceeds a set limit.
 

Method Detail

terminateOnError

boolean terminateOnError(int warnings,
                         int maxWarnings,
                         int errors,
                         int maxErrors)
This method is to be called if the number of warnings or errors exceeds a set limit. The application may choose to deal with this in any suitable manner, such as displaying a dialog box. If this method returns true it is expected that the calling class will terminate the application (unless the application itself performs the System exit).


quit

void quit(boolean confirm,
          boolean force)
An indication to quit the application. When confirm is true, the application may choose to display a dialog or other notification, and quit upon confirmation. If force is true, the assumption is that there are to be no options - the application is forceably being closed and any measures to ensure a safe closure should be taken.



The Ceryle Project. Copyright ©2001-2007 Murray Altheim, All Rights Reserved. See LICENSE included with distribution.