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.printing.ui.internal.editor;
16:
17: import net.refractions.udig.printing.model.Box;
18: import net.refractions.udig.printing.model.impl.MapBoxPrinter;
19: import net.refractions.udig.printing.ui.IBoxEditAction;
20: import net.refractions.udig.printing.ui.internal.editor.parts.BoxPart;
21: import net.refractions.udig.project.internal.Map;
22: import net.refractions.udig.project.ui.internal.ProjectExplorer;
23:
24: import org.eclipse.gef.commands.Command;
25:
26: /**
27: * Edits the map.
28: *
29: * @author Jesse
30: * @since 1.1.0
31: */
32: public class MapEditorAction implements IBoxEditAction {
33:
34: private Map map;
35:
36: public void init(BoxPart owner) {
37: map = ((MapBoxPrinter) ((Box) owner.getModel()).getBoxPrinter())
38: .getMap();
39: }
40:
41: public void perform() {
42: ProjectExplorer.getProjectExplorer().open(map);
43: }
44:
45: public boolean isDone() {
46: return true;
47: }
48:
49: public Command getCommand() {
50: return null;
51: }
52:
53: }
|