01: /* uDig - User Friendly Desktop Internet GIS client
02: * http://udig.refractions.net
03: * (C) 2004, Refractions Research Inc.
04: *
05: * This library is free software; you can redistribute it and/or
06: * modify it under the terms of the GNU Lesser General Public
07: * License as published by the Free Software Foundation;
08: * version 2.1 of the License.
09: *
10: * This library is distributed in the hope that it will be useful,
11: * but WITHOUT ANY WARRANTY; without even the implied warranty of
12: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13: * Lesser General Public License for more details.
14: */
15: package net.refractions.udig.ui;
16:
17: import org.eclipse.core.runtime.IProgressMonitor;
18: import org.eclipse.ui.IWorkbench;
19:
20: /**
21: * Encapsulates a task that needs to be run after the workbench has shutdown.
22: * It can be submitted to the {@link ShutdownTaskList} object .
23: * Methods are NOT called in the Display thread.
24: *
25: * @author Jesse
26: * @since 1.1.0
27: */
28: public interface PostShutdownTask {
29:
30: /**
31: * Called after shutdown is complete, at this point it is too late to cancel.
32: * @param monitor the progress monitor to use.
33: * @param workbench workbench that is shutting down
34: */
35: void postShutdown(IProgressMonitor monitor, IWorkbench workbench)
36: throws Exception;
37:
38: /**
39: * Called if {@link #postShutdown(IWorkbench)} throws an exception
40: *
41: * @param t the exception
42: */
43: void handlePostShutdownException(Throwable t);
44:
45: /**
46: * Returns the number of steps {@link #postShutdown(IProgressMonitor, IWorkbench)} will use.
47: * This is called only once just before all shutdown tasks are run.
48: *
49: * @return the number of steps {@link #postShutdown(IProgressMonitor, IWorkbench)} will use.
50: */
51: public int getProgressMonitorSteps();
52: }
|