Package org.eclipse.jdt.core.search

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


    search(pattern);
  }

  private void search(SearchPattern pattern) {
    try {
      SearchEngine engine = new SearchEngine();
      IJavaSearchScope scope = SearchEngine.createWorkspaceScope();
      SearchParticipant[] participants = new SearchParticipant[] {SearchEngine.getDefaultSearchParticipant()};
      engine.search(pattern, participants, scope, requestor, monitor);
    } catch (CoreException e) {
      JavaDocActivator.getDefault().handleSystemError(e, this);
    }
  }
View Full Code Here


  }

  private void waitForIndexer() throws JavaModelException {
    TypeNameRequestor nameRequestor = new TypeNameRequestor(){};
    new SearchEngine().searchAllTypeNames(
        null,
        SearchPattern.R_EXACT_MATCH,
        null,
        SearchPattern.R_EXACT_MATCH,
        IJavaSearchConstants.CLASS,
View Full Code Here

  public Iterator<Relation> iterator() {
    return rels.values().iterator();
  }
 
  public void populate(IProgressMonitor monitor) throws CoreException {
    SearchEngine engine = new SearchEngine();
    SearchPattern pattern = SearchPattern.createPattern("Relation", IJavaSearchConstants.ANNOTATION_TYPE, IJavaSearchConstants.ANNOTATION_TYPE_REFERENCE, SearchPattern.R_EXACT_MATCH | SearchPattern.R_CASE_SENSITIVE);
    SearchParticipant[] participants = new SearchParticipant[] {SearchEngine.getDefaultSearchParticipant()};
    IJavaSearchScope scope = SearchEngine.createWorkspaceScope();
   
    engine.search(pattern, participants, scope, this, monitor);
  }
View Full Code Here

    constraints = new LinkedList<Constraint>();
    this.rels = rels;
  }
 
  public void populate(IProgressMonitor monitor) throws CoreException {
    SearchEngine engine = new SearchEngine();
    SearchPattern pattern = SearchPattern.createPattern("Constraint", IJavaSearchConstants.ANNOTATION_TYPE, IJavaSearchConstants.ANNOTATION_TYPE_REFERENCE, SearchPattern.R_EXACT_MATCH | SearchPattern.R_CASE_SENSITIVE);
    SearchParticipant[] participants = new SearchParticipant[] {SearchEngine.getDefaultSearchParticipant()};
    IJavaSearchScope scope = SearchEngine.createWorkspaceScope();
   
    ConstraintRequestor consReq = new ConstraintRequestor(rels);   
    engine.search(pattern, participants, scope, consReq, monitor);
    constraints.addAll(consReq.getConstraints());
   
    CallbackRequestor callRequest = new CallbackRequestor(rels);
    pattern = SearchPattern.createPattern("Callback", IJavaSearchConstants.ANNOTATION_TYPE, IJavaSearchConstants.ANNOTATION_TYPE_REFERENCE, SearchPattern.R_EXACT_MATCH | SearchPattern.R_CASE_SENSITIVE);
    engine.search(pattern, participants, scope, callRequest, monitor);
    constraints.addAll(callRequest.getConstraints());
   
    EffectRequestor effReq = new EffectRequestor(rels);
    for (Relation rel : rels) {
      pattern = SearchPattern.createPattern(rel.getName(), IJavaSearchConstants.ANNOTATION_TYPE, IJavaSearchConstants.ANNOTATION_TYPE_REFERENCE, SearchPattern.R_EXACT_MATCH | SearchPattern.R_CASE_SENSITIVE);
      engine.search(pattern, participants, scope, effReq, monitor);     
    }
    constraints.addAll(effReq.getConstraints());
   
  }
View Full Code Here

  public void addRule(InferredRel inf) {
    inferRules.add(inf);
  }

  public void populate(IProgressMonitor monitor) throws CoreException {
    SearchEngine engine = new SearchEngine();
    SearchPattern pattern = SearchPattern.createPattern("Infer", IJavaSearchConstants.ANNOTATION_TYPE, IJavaSearchConstants.ANNOTATION_TYPE_REFERENCE, SearchPattern.R_EXACT_MATCH | SearchPattern.R_CASE_SENSITIVE);
    SearchParticipant[] participants = new SearchParticipant[] {SearchEngine.getDefaultSearchParticipant()};
    IJavaSearchScope scope = SearchEngine.createWorkspaceScope();
    InferRequestor requestor = new InferRequestor(rels);
   
    engine.search(pattern, participants, scope, requestor, monitor);
    inferRules.addAll(requestor.getRules());
  }
View Full Code Here

          IJavaSearchConstants.DECLARATIONS,
          SearchPattern.R_EXACT_MATCH | SearchPattern.R_CASE_SENSITIVE);
    IJavaSearchScope scope =
      SearchEngine.createJavaSearchScope(new IJavaElement[]{javaProject});
    SearchRequestor requestor = new SearchRequestor();
    SearchEngine engine = new SearchEngine();
    SearchParticipant[] participants =
      new SearchParticipant[]{SearchEngine.getDefaultSearchParticipant()};
    engine.search(pattern, participants, scope, requestor, null);

    ArrayList<IType> types = new ArrayList<IType>();
    if (requestor.getMatches().size() > 0){
      for (SearchMatch match : requestor.getMatches()){
        if(match.getAccuracy() != SearchMatch.A_ACCURATE){
View Full Code Here

              IJavaSearchConstants.DECLARATIONS,
              SearchPattern.R_EXACT_MATCH | SearchPattern.R_CASE_SENSITIVE);
        IJavaSearchScope scope =
          SearchEngine.createJavaSearchScope(new IJavaElement[]{javaProject});
        SearchRequestor requestor = new SearchRequestor();
        SearchEngine engine = new SearchEngine();
        SearchParticipant[] participants =
          new SearchParticipant[]{SearchEngine.getDefaultSearchParticipant()};
        engine.search(pattern, participants, scope, requestor, null);
        if (requestor.getMatches().size() > 0){
          imports = new ArrayList<String>();
          for (SearchMatch match : requestor.getMatches()){
            if(match.getAccuracy() != SearchMatch.A_ACCURATE){
              continue;
View Full Code Here

      SearchPattern pattern, IJavaSearchScope scope)
    throws CoreException
  {
    SearchRequestor requestor = new SearchRequestor();
    if(pattern != null){
      SearchEngine engine = new SearchEngine();
      SearchParticipant[] participants =
        new SearchParticipant[]{SearchEngine.getDefaultSearchParticipant()};
      engine.search(pattern, participants, scope, requestor, null);
    }
    return requestor.getMatches();
  }
View Full Code Here

          // ignore
        }
      }
    };

    SearchEngine engine = new SearchEngine();
    SearchParticipant[] participants =
      new SearchParticipant[]{SearchEngine.getDefaultSearchParticipant()};
    engine.search(pattern, participants, scope, requestor, null);

    // if we found only 1 result, we can use it.
    if (methods.size() == 1){
      IMethod method = methods.get(0);
      ICompilationUnit cu = method.getCompilationUnit();
View Full Code Here

      manager.deltaState.initializeRoots(true/*initAfteLoad*/);

      // dummy query for waiting until the indexes are ready
      if (monitor != null)
        monitor.subTask(Messages.javamodel_configuring_searchengine);
      SearchEngine engine = new SearchEngine();
      IJavaSearchScope scope = SearchEngine.createWorkspaceScope();
      try {
        engine.searchAllTypeNames(
          null,
          SearchPattern.R_EXACT_MATCH,
          "!@$#!@".toCharArray(), //$NON-NLS-1$
          SearchPattern.R_PATTERN_MATCH | SearchPattern.R_CASE_SENSITIVE,
          IJavaSearchConstants.CLASS,
View Full Code Here

TOP

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

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.