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.jdt.core.IJavaProject;
07: import org.eclipse.jface.action.IAction;
08: import org.eclipse.jface.viewers.ISelection;
09: import org.eclipse.ui.IObjectActionDelegate;
10: import org.eclipse.ui.IWorkbenchPart;
11:
12: import org.terracotta.dso.TcPlugin;
13:
14: /**
15: * Make the current JavaProject a Terracotta project.
16: */
17:
18: public class AddTerracottaNatureAction implements IObjectActionDelegate {
19: private IJavaProject m_currentProject;
20:
21: public AddTerracottaNatureAction() {
22: super ();
23: }
24:
25: public void setActivePart(IAction action, IWorkbenchPart targetPart) {/**/
26: }
27:
28: public void run(IAction action) {
29: TcPlugin.getDefault().addTerracottaNature(m_currentProject);
30: }
31:
32: public void selectionChanged(IAction action, ISelection selection) {
33: m_currentProject = ActionUtil
34: .findSelectedJavaProject(selection);
35: }
36: }
|