1 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 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 |