int addMethodsByName(String methodName, String type, String category, JavaProject project, IProgressMonitor monitor, boolean nonWeb) {
int matches = 0;
ViewContentProvider cp = ((ViewContentProvider)viewer.getContentProvider());
try {
MethodDeclarationsSearchRequestor requestor = new MethodDeclarationsSearchRequestor();
SearchEngine searchEngine = new SearchEngine();
IJavaSearchScope searchScope = CallerFinder.getSearchScope(project);
SearchPattern pattern = SearchPattern.createPattern(
methodName,
IJavaSearchConstants.METHOD,
IJavaSearchConstants.DECLARATIONS,
SearchPattern.R_PATTERN_MATCH | SearchPattern.R_CASE_SENSITIVE
);
searchEngine.search(
pattern,
new SearchParticipant[] { SearchEngine.getDefaultSearchParticipant() },
searchScope,
requestor,
monitor
);
Collection pairs = requestor.getMethodUnitPairs();
for(Iterator iter = pairs.iterator(); iter.hasNext();) {
Utils.MethodDeclarationUnitPair pair = (MethodDeclarationUnitPair) iter.next();
ViewMatch match = new ViewMatch(
pair.getMember().getDeclaringType().getElementName() + "." + pair.getMember().getElementName(),
pair.getMethod() != null ? pair.getMethod().getName() : null,