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: * Revert the current Terracotta project back to a plain Java Project.
16: */
17:
18: public class RemoveTerracottaNatureAction implements
19: IObjectActionDelegate {
20: private IJavaProject m_currentProject;
21:
22: public RemoveTerracottaNatureAction() {
23: super ();
24: }
25:
26: public void setActivePart(IAction action, IWorkbenchPart targetPart) {/**/
27: }
28:
29: public void run(IAction action) {
30: TcPlugin.getDefault().removeTerracottaNature(m_currentProject);
31: }
32:
33: public void selectionChanged(IAction action, ISelection selection) {
34: m_currentProject = ActionUtil
35: .findSelectedJavaProject(selection);
36: }
37: }
|