Author: dazarov
Date: 2009-11-05 11:09:54 -0500 (Thu, 05 Nov 2009)
New Revision: 18418
Modified:
trunk/common/plugins/org.jboss.tools.common.el.ui/src/org/jboss/tools/common/el/ui/refactoring/ELReferencesQueryParticipant.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5093
Modified:
trunk/common/plugins/org.jboss.tools.common.el.ui/src/org/jboss/tools/common/el/ui/refactoring/ELReferencesQueryParticipant.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.el.ui/src/org/jboss/tools/common/el/ui/refactoring/ELReferencesQueryParticipant.java 2009-11-05
15:20:28 UTC (rev 18417)
+++
trunk/common/plugins/org.jboss.tools.common.el.ui/src/org/jboss/tools/common/el/ui/refactoring/ELReferencesQueryParticipant.java 2009-11-05
16:09:54 UTC (rev 18418)
@@ -20,6 +20,7 @@
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.search.IJavaSearchConstants;
import org.eclipse.jdt.ui.search.ElementQuerySpecification;
import org.eclipse.jdt.ui.search.IMatchPresentation;
import org.eclipse.jdt.ui.search.IQueryParticipant;
@@ -47,6 +48,9 @@
throws CoreException {
if(querySpecification instanceof ElementQuerySpecification){
+ if (!isSearchForReferences(querySpecification.getLimitTo()))
+ return;
+
ElementQuerySpecification qs = (ElementQuerySpecification)querySpecification;
if(qs.getElement() instanceof IMethod || qs.getElement() instanceof IType){
IFile file = (IFile)qs.getElement().getResource();
@@ -60,6 +64,15 @@
}
}
+ public boolean isSearchForReferences(int limitTo) {
+ int maskedLimitTo = limitTo &
~(IJavaSearchConstants.IGNORE_DECLARING_TYPE+IJavaSearchConstants.IGNORE_RETURN_TYPE);
+ if (maskedLimitTo == IJavaSearchConstants.REFERENCES || maskedLimitTo ==
IJavaSearchConstants.ALL_OCCURRENCES) {
+ return true;
+ }
+
+ return false;
+ }
+
class ELSearcher extends RefactorSearcher{
ISearchRequestor requestor;
ProjectsSet projectSet=null;