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.tools.edit;
16:
17: /**
18: * A safe runnable.
19: * @author jones
20: * @since 1.1.0
21: */
22: public interface Activator {
23:
24: /**
25: * The action to be performed by this activator when activating.
26: *
27: * @param handler
28: */
29: public void activate(EditToolHandler handler);
30:
31: /**
32: * The action to be performed by this activator when deactivating.
33: *
34: * @param handler
35: */
36: public void deactivate(EditToolHandler handler);
37:
38: /**
39: * This method is called if an exception occurs during the execution of the activate method.
40: * <p>
41: * This method should
42: * <ol>
43: * <li>Rollback the changes made during the run method</li>
44: * <li>Log the error in the plugin's log</li>
45: * </ol>
46: *
47: * @param error Error that occurred
48: * @param activating Indicates whether activator is being activated.
49: */
50: public void handleActivateError(EditToolHandler handler,
51: Throwable error);
52:
53: /**
54: * This method is called if an exception occurs during the execution of the deactivate method.
55: * <p>
56: * This method should
57: * <ol>
58: * <li>Rollback the changes made during the run method</li>
59: * <li>Log the error in the plugin's log</li>
60: * </ol>
61: *
62: * @param error Error that occurred
63: * @param activating Indicates whether activator is being activated.
64: */
65: public void handleDeactivateError(EditToolHandler handler,
66: Throwable error);
67:
68: }
|