01: /*
02: * uDig - User Friendly Desktop Internet GIS client
03: * http://udig.refractions.net
04: * (C) 2004, Refractions Research Inc.
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation;
09: * version 2.1 of the License.
10: *
11: * This library is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Lesser General Public License for more details.
15: *
16: */
17: package net.refractions.udig.printing.ui.internal.editor.commands;
18:
19: import net.refractions.udig.printing.model.Box;
20: import net.refractions.udig.printing.model.Page;
21: import net.refractions.udig.printing.ui.internal.Messages;
22:
23: import org.eclipse.gef.commands.Command;
24:
25: /**
26: * Provides ...TODO summary sentence
27: * <p>
28: * TODO Description
29: * </p><p>
30: * Responsibilities:
31: * <ul>
32: * <li>
33: * <li>
34: * </ul>
35: * </p><p>
36: * Example Use:<pre><code>
37: * DeleteCommand x = new DeleteCommand( ... );
38: * TODO code example
39: * </code></pre>
40: * </p>
41: * @author Richard Gould
42: * @since 0.3
43: */
44: public class DeleteCommand extends Command {
45: private Page parent;
46: private Box child;
47:
48: public DeleteCommand() {
49: super (Messages.DeleteCommand_delete);
50: }
51:
52: public void execute() {
53: parent.getBoxes().remove(child);
54: }
55:
56: public void undo() {
57: parent.getBoxes().add(child);
58: }
59:
60: public void setChild(Box child) {
61: this .child = child;
62: }
63:
64: public void setParent(Page parent) {
65: this.parent = parent;
66: }
67: }
|