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.project.ui.internal.actions;
18:
19: import net.refractions.udig.project.ui.internal.MapImport;
20:
21: import org.eclipse.jface.action.IAction;
22: import org.eclipse.swt.widgets.Event;
23: import org.eclipse.ui.IObjectActionDelegate;
24: import org.eclipse.ui.IWorkbenchPart;
25: import org.eclipse.ui.IWorkbenchWindow;
26: import org.eclipse.ui.IWorkbenchWindowActionDelegate;
27: import org.eclipse.ui.actions.ActionDelegate;
28:
29: /**
30: * Performs the open action from the file menu of uDig. It is responseible for creating new maps
31: * from selected resources.
32: *
33: * @author rgould
34: * @since 0.9.0
35: */
36: public class AddLayersAction extends ActionDelegate implements
37: IWorkbenchWindowActionDelegate, IObjectActionDelegate {
38:
39: /** <code>ID</code> field */
40: public static final String ID = "net.refractions.udig.project.ui.openAction"; //$NON-NLS-1$
41:
42: /**
43: * @see org.eclipse.ui.actions.ActionDelegate#runWithEvent(org.eclipse.jface.action.IAction,
44: * org.eclipse.swt.widgets.Event)
45: */
46: @Override
47: public void runWithEvent(IAction action, Event event) {
48: MapImport mapImport = new MapImport();
49: mapImport.getDialog().open();
50: }
51:
52: /**
53: * @see org.eclipse.ui.actions.ActionDelegate#run(org.eclipse.jface.action.IAction)
54: */
55: public void run(IAction action) {
56: runWithEvent(action, null);
57: }
58:
59: /**
60: * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#init(org.eclipse.ui.IWorkbenchWindow)
61: */
62: public void init(IWorkbenchWindow window) {
63: }
64:
65: /**
66: * @see org.eclipse.ui.IObjectActionDelegate#setActivePart(org.eclipse.jface.action.IAction,
67: * org.eclipse.ui.IWorkbenchPart)
68: */
69: public void setActivePart(IAction action, IWorkbenchPart targetPart) {
70: }
71:
72: }
|