KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > terracotta > dso > actions > AddTerracottaNatureAction


1 /*
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
3  */

4 package org.terracotta.dso.actions;
5
6 import org.eclipse.jdt.core.IJavaProject;
7 import org.eclipse.jface.action.IAction;
8 import org.eclipse.jface.viewers.ISelection;
9 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   public void run(IAction action) {
28     TcPlugin.getDefault().addTerracottaNature(m_currentProject);
29   }
30
31   public void selectionChanged(IAction action, ISelection selection) {
32     m_currentProject = ActionUtil.findSelectedJavaProject(selection);
33   }
34 }
35
Popular Tags