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.project.command;
16:
17: import org.eclipse.core.runtime.IProgressMonitor;
18:
19: /**
20: * This is a special type of command that may or may not affect global state. Whether is does or not is
21: * not known until after the command has been ran. If the {@link #execute(IProgressMonitor)} method returns true
22: * the command will be put on Undo stack otherwise it won't be because it does not need to be undone.
23: *
24: * @author jones
25: * @since 1.1.0
26: */
27: public interface PostDeterminedEffectCommand extends UndoableMapCommand {
28: /**
29: * This method will not be called it should throw a UnsupportedException exception.
30: */
31: void run(IProgressMonitor monitor) throws Exception;
32:
33: /**
34: * This method should return true if the method has changed state and will do something when undone.
35: *
36: * @param monitor used to indicate the progress of the monitor.
37: * @return true if the method has changed global state and command should be put on the undo stack.
38: */
39: boolean execute(IProgressMonitor monitor) throws Exception;
40: }
|