Author: dazarov
Date: 2011-10-17 21:30:13 -0400 (Mon, 17 Oct 2011)
New Revision: 35744
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/search/CDIBeanQueryParticipant.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/search/InjectionPointQueryParticipant.java
Log:
Updated CDI Query Participants in order to search in related projects and check search
scope
https://issues.jboss.org/browse/JBIDE-9801
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/search/CDIBeanQueryParticipant.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/search/CDIBeanQueryParticipant.java 2011-10-18
00:29:52 UTC (rev 35743)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/search/CDIBeanQueryParticipant.java 2011-10-18
01:30:13 UTC (rev 35744)
@@ -60,8 +60,6 @@
ICDIProject cdiProject = CDICorePlugin.getCDIProject(project, true);
-
-
if(cdiProject == null) {
return;
}
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/search/InjectionPointQueryParticipant.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/search/InjectionPointQueryParticipant.java 2011-10-18
00:29:52 UTC (rev 35743)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/search/InjectionPointQueryParticipant.java 2011-10-18
01:30:13 UTC (rev 35744)
@@ -14,7 +14,7 @@
import java.util.List;
import java.util.Set;
-import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
@@ -80,11 +80,11 @@
ElementQuerySpecification qs = (ElementQuerySpecification)querySpecification;
IJavaElement element = qs.getElement();
if(element instanceof IMethod || element instanceof IField || element instanceof
ILocalVariable){
- IFile file = (IFile)element.getResource();
- if(file == null)
+ IProject project = element.getJavaProject().getProject();
+ if(project == null)
return;
- CDICoreNature cdiNature = CDICorePlugin.getCDI(file.getProject(), true);
+ CDICoreNature cdiNature = CDICorePlugin.getCDI(project, true);
if(cdiNature == null)
return;
@@ -94,7 +94,7 @@
if(cdiProject == null)
return;
- Set<IBean> beans = cdiProject.getBeans(file.getFullPath());
+ Set<IBean> beans = cdiProject.getBeans(element.getPath());
IInjectionPoint injectionPoint = CDIUtil.findInjectionPoint(beans, element, 0);
if(injectionPoint != null){