[jboss-cvs] jbosside/core/plugins/org.jboss.ide.eclipse.core/src/main/org/jboss/ide/eclipse/core/util ...
Marshall Culpepper
mculpepper at jboss.com
Sat Nov 18 20:18:32 EST 2006
User: mculpepper
Date: 06/11/18 20:18:32
Modified: core/plugins/org.jboss.ide.eclipse.core/src/main/org/jboss/ide/eclipse/core/util
ProjectUtil.java
Log:
added support for IStructuredSelection in getProject(Object)
Revision Changes Path
1.6 +9 -2 jbosside/core/plugins/org.jboss.ide.eclipse.core/src/main/org/jboss/ide/eclipse/core/util/ProjectUtil.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: ProjectUtil.java
===================================================================
RCS file: /cvsroot/jboss/jbosside/core/plugins/org.jboss.ide.eclipse.core/src/main/org/jboss/ide/eclipse/core/util/ProjectUtil.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- ProjectUtil.java 14 Sep 2006 19:54:12 -0000 1.5
+++ ProjectUtil.java 19 Nov 2006 01:18:32 -0000 1.6
@@ -36,13 +36,14 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
+import org.eclipse.jface.viewers.IStructuredSelection;
import org.jboss.ide.eclipse.core.AbstractPlugin;
/**
* Utility class for IProject object access
*
* @author Laurent Etiemble
- * @version $Revision: 1.5 $
+ * @version $Revision: 1.6 $
*/
public class ProjectUtil
{
@@ -320,7 +321,7 @@
* @param object
* @return an IProject or null if one could not be found
*/
- public static IProject getProject (Object element )
+ public static IProject getProject (Object element)
{
if (element instanceof IProject)
{
@@ -348,6 +349,12 @@
return container.getProject();
}
+ if (element instanceof IStructuredSelection)
+ {
+ IStructuredSelection selection = (IStructuredSelection) element;
+ return getProject(selection.getFirstElement());
+ }
+
return null;
}
More information about the jboss-cvs-commits
mailing list