Package org.eclipse.core.runtime

Examples of org.eclipse.core.runtime.OperationCanceledException


    }
  }

  void checkCancel() {
    if (this.monitor != null && this.monitor.isCanceled()) {
      throw new OperationCanceledException();
    }
  }
View Full Code Here


    diet = true;
    this.reportReferenceInfo = fullParse;
    CompilationResult compilationUnitResult = new CompilationResult(unit, 0, 0, this.options.maxProblemsPerUnit);
    parsedUnit = parse(unit, compilationUnitResult);
    if (pm != null && pm.isCanceled())
      throw new OperationCanceledException(Messages.operation_cancelled);
    if (scanner.recordLineSeparator) {
      requestor.acceptLineSeparatorPositions(compilationUnitResult.getLineSeparatorPositions());
    }
    int initialStart = this.scanner.initialPosition;
    int initialEnd = this.scanner.eofPosition;
View Full Code Here

  if (this.javaLikeNamesChanged) {
    this.javaLikeNamesChanged = hasJavaLikeNamesChanged();
  }
  for (int i = 0; i < length; i++) {
    if (progressMonitor != null && progressMonitor.isCanceled()) {
      throw new OperationCanceledException();
    }
    // may trigger some index recreation work
    IPath indexLocation = locations[i];
    Index index = getIndex(indexLocation);
    if (index == null) {
View Full Code Here

  } else {
    typeQualifiedName = getElementName();
  }

  pathBuffer.append(pack.getElementName().replace('.', '/')).append('/').append(typeQualifiedName).append(JavadocConstants.HTML_EXTENSION);
  if (monitor != null && monitor.isCanceled()) throw new OperationCanceledException();
  final String contents = getURLContents(String.valueOf(pathBuffer));
  JavadocContents javadocContents = new JavadocContents(this, contents);
  synchronized (projectInfo.javadocCache) {
    projectInfo.javadocCache.put(this, javadocContents);
  }
View Full Code Here

      StringBuffer documentPath = new StringBuffer(containerPath.length() + 1 + relativePath.length());
      documentPath.append(containerPath);
      documentPath.append(separator);
      documentPath.append(relativePath);
      if (!requestor.acceptIndexMatch(documentPath.toString(), pattern, participant, access))
        throw new OperationCanceledException();
    }
  } else {
    StringBuffer buffer = new StringBuffer(containerPath.length() + 1 + relativePath.length());
    buffer.append(containerPath);
    buffer.append(separator);
    buffer.append(relativePath);
    String documentPath = buffer.toString();
    boolean encloses = (scope instanceof HierarchyScope) ? ((HierarchyScope)scope).encloses(documentPath, monitor)
              : scope.encloses(documentPath);
    if (encloses)
      if (!requestor.acceptIndexMatch(documentPath, pattern, participant, null))
        throw new OperationCanceledException();

  }
}
View Full Code Here

*
* @noreference This method is not intended to be referenced by clients.
* @nooverride This method is not intended to be re-implemented or extended by clients.
*/
public void findIndexMatches(Index index, IndexQueryRequestor requestor, SearchParticipant participant, IJavaSearchScope scope, IProgressMonitor monitor) throws IOException {
  if (monitor != null && monitor.isCanceled()) throw new OperationCanceledException();
  try {
    index.startQuery();
    SearchPattern pattern = currentPattern();
    EntryResult[] entries = pattern.queryIn(index);
    if (entries == null) return;

    SearchPattern decodedResult = pattern.getBlankPattern();
    String containerPath = index.containerPath;
    char separator = index.separator;
    for (int i = 0, l = entries.length; i < l; i++) {
      if (monitor != null && monitor.isCanceled()) throw new OperationCanceledException();

      EntryResult entry = entries[i];
      decodedResult.decodeIndexKey(entry.getWord());
      if (pattern.matchesDecodedKey(decodedResult)) {
        // TODO (kent) some clients may not need the document names
View Full Code Here

public void ensureReadyToRun() {
  if (!this.areIndexesReady)
    getIndexes(null/*progress*/); // may trigger some index recreation
}
public boolean execute(IProgressMonitor progressMonitor) {
  if (progressMonitor != null && progressMonitor.isCanceled()) throw new OperationCanceledException();

  boolean isComplete = COMPLETE;
  this.executionTime = 0;
  Index[] indexes = getIndexes(progressMonitor);
  try {
    int max = indexes.length;
    if (progressMonitor != null)
      progressMonitor.beginTask("", max); //$NON-NLS-1$
    for (int i = 0; i < max; i++) {
      isComplete &= search(indexes[i], progressMonitor);
      if (progressMonitor != null) {
        if (progressMonitor.isCanceled()) throw new OperationCanceledException();
        progressMonitor.worked(1);
      }
    }
    if (JobManager.VERBOSE)
      Util.verbose("-> execution time: " + this.executionTime + "ms - " + this);//$NON-NLS-1$//$NON-NLS-2$
View Full Code Here

public String getJobFamily() {
  return ""; //$NON-NLS-1$
}
public boolean search(Index index, IProgressMonitor progressMonitor) {
  if (index == null) return COMPLETE;
  if (progressMonitor != null && progressMonitor.isCanceled()) throw new OperationCanceledException();
  ReadWriteMonitor monitor = index.monitor;
  if (monitor == null) return COMPLETE; // index got deleted since acquired
  try {
    monitor.enterRead(); // ask permission to read
    long start = System.currentTimeMillis();
View Full Code Here

    }
  }

  protected void checkCanceled() {
    if (this.monitor != null && this.monitor.isCanceled())
      throw new OperationCanceledException();
  }
View Full Code Here

    pathBuffer.append('/');
  }
  String packPath= getElementName().replace('.', '/');
  pathBuffer.append(packPath).append('/').append(JavadocConstants.PACKAGE_FILE_NAME);

  if (monitor != null && monitor.isCanceled()) throw new OperationCanceledException();
  final String contents = getURLContents(String.valueOf(pathBuffer));
  if (monitor != null && monitor.isCanceled()) throw new OperationCanceledException();
  if (contents == null) throw new JavaModelException(new JavaModelStatus(IJavaModelStatusConstants.CANNOT_RETRIEVE_ATTACHED_JAVADOC, this));
  synchronized (projectInfo.javadocCache) {
    projectInfo.javadocCache.put(this, contents);
  }
  return contents;
View Full Code Here

TOP

Related Classes of org.eclipse.core.runtime.OperationCanceledException

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.