forrest-svn mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgard...@apache.org
Subject svn commit: r116298 - /forrest/trunk/tools/eclipse/src/org/apache/forrest/eclipse/popup/actions/StopForrest.java
Date Thu, 16 Dec 2004 03:09:42 GMT
Author: rgardler
Date: Wed Dec 15 19:09:41 2004
New Revision: 116298

URL: http://svn.apache.org/viewcvs?view=rev&rev=116298
Log:
monitor selection changed events so we keep track of the active project.
Modified:
   forrest/trunk/tools/eclipse/src/org/apache/forrest/eclipse/popup/actions/StopForrest.java

Modified: forrest/trunk/tools/eclipse/src/org/apache/forrest/eclipse/popup/actions/StopForrest.java
Url: http://svn.apache.org/viewcvs/forrest/trunk/tools/eclipse/src/org/apache/forrest/eclipse/popup/actions/StopForrest.java?view=diff&rev=116298&p1=forrest/trunk/tools/eclipse/src/org/apache/forrest/eclipse/popup/actions/StopForrest.java&r1=116297&p2=forrest/trunk/tools/eclipse/src/org/apache/forrest/eclipse/popup/actions/StopForrest.java&r2=116298
==============================================================================
--- forrest/trunk/tools/eclipse/src/org/apache/forrest/eclipse/popup/actions/StopForrest.java
(original)
+++ forrest/trunk/tools/eclipse/src/org/apache/forrest/eclipse/popup/actions/StopForrest.java
Wed Dec 15 19:09:41 2004
@@ -17,11 +17,13 @@
 
 import org.apache.forrest.eclipse.job.ForrestManager;
 import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
 import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.jobs.Job;
 import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
 import org.eclipse.jface.action.IAction;
 import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.ui.IActionDelegate;
 import org.eclipse.ui.IObjectActionDelegate;
 import org.eclipse.ui.IWorkbenchPart;
@@ -58,6 +60,13 @@
 	 * @see IActionDelegate#selectionChanged(IAction, ISelection)
 	 */
 	public void selectionChanged(IAction action, ISelection selection) {
+		if (selection instanceof IStructuredSelection) {
+			Object first = ((IStructuredSelection)selection).getFirstElement();
+            IResource resource = (IResource)first;
+            if (resource instanceof IProject) {
+                activeProject = (IProject)resource;
+            }            
+		}
 	}
 
 }

Mime
View raw message