Package org.aspectj.org.eclipse.jdt.internal.core.search

Examples of org.aspectj.org.eclipse.jdt.internal.core.search.SubTypeSearchJob


    superRefKind = SuperTypeReferencePattern.ALL_SUPER_TYPES;
  }
  SuperTypeReferencePattern pattern =
    new SuperTypeReferencePattern(null, null, superRefKind, SearchPattern.R_EXACT_MATCH | SearchPattern.R_CASE_SENSITIVE);
  MatchLocator.setFocus(pattern, type);
  SubTypeSearchJob job = new SubTypeSearchJob(
    pattern,
    new JavaSearchParticipant(), // java search only
    scope,
    searchRequestor);

  int ticks = 0;
  queue.add(type.getElementName().toCharArray());
  try {
    while (queue.start <= queue.end) {
      if (progressMonitor != null && progressMonitor.isCanceled()) return;

      // all subclasses of OBJECT are actually all types
      char[] currentTypeName = queue.retrieve();
      if (CharOperation.equals(currentTypeName, IIndexConstants.OBJECT))
        currentTypeName = null;

      // search all index references to a given supertype
      pattern.superSimpleName = currentTypeName;
      indexManager.performConcurrentJob(job, waitingPolicy, progressMonitor == null ? null : new NullProgressMonitor() {
        // don't report progress since this is too costly for deep hierarchies
        // just handle isCanceled() (seehttps://bugs.eclipse.org/bugs/show_bug.cgi?id=179511)
        public void setCanceled(boolean value) {
          progressMonitor.setCanceled(value);
        }
        public boolean isCanceled() {
          return progressMonitor.isCanceled();
        }
      });
      if (progressMonitor != null && ++ticks <= MAXTICKS)
        progressMonitor.worked(1);

      // in case, we search all subtypes, no need to search further
      if (currentTypeName == null) break;
    }
  } finally {
    job.finished();
  }
}
View Full Code Here

TOP

Related Classes of org.aspectj.org.eclipse.jdt.internal.core.search.SubTypeSearchJob

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.