01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */
04: package org.terracotta.dso.actions;
05:
06: import org.eclipse.core.resources.IProject;
07: import org.eclipse.jdt.core.IJavaProject;
08: import org.eclipse.jface.action.IAction;
09: import org.eclipse.jface.viewers.ISelection;
10: import org.eclipse.ui.IObjectActionDelegate;
11: import org.eclipse.ui.IWorkbenchPart;
12: import org.eclipse.ui.PartInitException;
13:
14: import org.terracotta.dso.TcPlugin;
15:
16: public class OpenConfigurationAction implements IObjectActionDelegate {
17: private IJavaProject m_currentProject;
18:
19: public OpenConfigurationAction() {
20: super ();
21: }
22:
23: public void setActivePart(IAction action, IWorkbenchPart targetPart) {/**/
24: }
25:
26: public void run(IAction action) {
27: try {
28: IProject project = m_currentProject.getProject();
29:
30: TcPlugin.getDefault().openConfigurationEditor(project);
31: } catch (PartInitException pie) {
32: pie.printStackTrace();
33: }
34: }
35:
36: public void selectionChanged(IAction action, ISelection selection) {
37: m_currentProject = ActionUtil
38: .locateSelectedJavaProject(selection);
39: }
40: }
|