Package org.eclipse.jdt.core.search

Examples of org.eclipse.jdt.core.search.SearchMatch


    if (results != null && !results.isEmpty()){
     
      Set vals = new HashSet(results.size());
      Set checkedTypes = new HashSet();
      for (Iterator it = results.iterator();it.hasNext();){
        SearchMatch match = (SearchMatch)it.next();
        IType res = (IType)match.getElement();
        addValidSubClasses(res, vals, checkedTypes);         
      }
      return createPossibleValues(vals);
    }           
    return new ArrayList(0);
View Full Code Here


      // The compilation units needing to be altered mapped to the
      // appropriate search matches.
      final Map units = new HashMap();
      for (final Iterator it = this.matchToPurposeMap.keySet().iterator(); it
          .hasNext();) {
        final SearchMatch match = (SearchMatch) it.next();
        final IJavaElement element = (IJavaElement) match.getElement();
        final ICompilationUnit unit = Util.getIMember(element)
            .getCompilationUnit();
        if (unit != null) {
          Collection searchMatchCollection = (Collection) units
              .get(unit);
View Full Code Here

      IProgressMonitor monitor) throws CoreException {
    final ASTRewrite astRewrite = ASTRewrite.create(node.getAST());
    final ImportRewrite importRewrite = ImportRewrite.create(node, true);

    for (final Iterator it = matches.iterator(); it.hasNext();) {
      final SearchMatch match = (SearchMatch) it.next();
      if (match.getAccuracy() == SearchMatch.A_ACCURATE
          && !match.isInsideDocComment())
        if (this.matchToPurposeMap.get(match) == SearchMatchPurpose.ALTER_TYPE_DECLARATION
            || this.matchToPurposeMap.get(match) == SearchMatchPurpose.ALTER_NAMESPACE_PREFIX)
          this.rewriteDeclarationsAndNamespaces(node, match, status,
              astRewrite, importRewrite);
        else if (this.matchToPurposeMap.get(match) == SearchMatchPurpose.ALTER_INFIX_EXPRESSION)
View Full Code Here

        // Work around for bug 164121. Force match for formal
        // parameters.
        if (je.getElementType() == IJavaElement.LOCAL_VARIABLE) {
          final ISourceRange isr = ((ILocalVariable) je)
              .getNameRange();
          final SearchMatch match = new SearchMatch(je,
              SearchMatch.A_ACCURATE, isr.getOffset(), isr
                  .getLength(), SearchEngine
                  .getDefaultSearchParticipant(), je
                  .getResource());
          requestor.acceptSearchMatch(match);
View Full Code Here

    if(!(elem instanceof IMethod)) return;
    try {
      IMethod element = (IMethod) elem;
      if(element.exists() == false) return;
      ISourceRange range = element.getSourceRange();
      SearchMatch match = new SearchMatch(element, SearchMatch.A_ACCURATE, range.getOffset(), range.getLength(), null, null);
      requestor.acceptSearchMatch(match);
    } catch (CoreException e) {
      JavaDocActivator.getDefault().handleSystemError(e, this);
    }
  }
View Full Code Here

          .replace("*", ".*")
          .replace("?", "."));
        List<SearchMatch> matches = search(pattern, getScope(scope, javaProject));
        Iterator<SearchMatch> iterator = matches.iterator();
        while (iterator.hasNext()){
          SearchMatch match = iterator.next();
          String name = JavaUtils.getFullyQualifiedName(
              (IJavaElement)match.getElement()).replace("#", ".");
          if (!toMatch.matcher(name).matches()){
            iterator.remove();
          }
        }
        return matches;
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.core.search.SearchMatch

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.