/** * Check whether the build has been canceled. */ public void checkCancel() { if (this.monitor != null && this.monitor.isCanceled()) throw new OperationCanceledException(); }
public void checkForCancellation() { if (root.isCanceled()) { throw new OperationCanceledException(); } } }
private void worked(int work) { if (this.monitor != null) { if (this.monitor.isCanceled()) throw new OperationCanceledException(); this.monitor.worked(work); } } }
protected void worked(IProgressMonitor monitor, int work) { if (monitor != null) { if (monitor.isCanceled()) { throw new OperationCanceledException(); } else { monitor.worked(work); } } } /**
@Override protected void childRegionUpdated() { if (fProgressMonitor.isCanceled()) throw new OperationCanceledException(); fProgressMonitor.worked(1); } }
private void checkCanceled() { if (this.monitor != null && this.monitor.isCanceled()) { if (NameLookup.VERBOSE) System.out.println(Thread.currentThread() + " CANCELLING LOOKUP "); //$NON-NLS-1$ throw new AbortCompilation(true/*silent*/, new OperationCanceledException()); } }
/** * Acquire a write lock on this {@link Nd}. Blocks until any existing read/write locks are released. * @throws OperationCanceledException * @throws IllegalStateException if this {@link Nd} is not writable */ public void acquireWriteLock(IProgressMonitor monitor) { try { acquireWriteLock(0, monitor); } catch (InterruptedException e) { throw new OperationCanceledException(); } }
@Override public CategorizedProblem createProblem(char[] originatingFileName, int problemId, String[] problemArguments, String[] messageArguments, int severity, int startPosition, int endPosition, int lineNumber, int columnNumber) { if (this.monitor != null && this.monitor.isCanceled()) throw new AbortCompilation(true/*silent*/, new OperationCanceledException()); return super.createProblem(originatingFileName, problemId, problemArguments, messageArguments, severity, startPosition, endPosition, lineNumber, columnNumber); }
protected static void checkCanceled(WorkbenchReporter reporter) throws OperationCanceledException { if (reporter == null) { return; } else if (reporter.getProgressMonitor().isCanceled()) { throw new OperationCanceledException(""); //$NON-NLS-1$ } }
private boolean queryReplace(IProject project) throws OperationCanceledException { switch (fReplaceQuery.doQuery(project)) { case IReplaceQuery.CANCEL : throw new OperationCanceledException(); case IReplaceQuery.NO : return false; } return true; }
private void replaceInFile(final IProgressMonitor pm, final IFile file, final String replacementText, final Match[] markers) throws BadLocationException, CoreException { if (pm.isCanceled()) throw new OperationCanceledException(); doReplaceInFile(pm, file, replacementText, markers); }
private void addUpdates(TextChangeManager changeManager, IProgressMonitor pm, RefactoringStatus status) throws CoreException { pm.beginTask("", fCus.length); //$NON-NLS-1$ for (int i= 0; i < fCus.length; i++){ if (pm.isCanceled()) throw new OperationCanceledException(); addUpdates(changeManager, fCus[i], new SubProgressMonitor(pm, 1), status); } }
private void addUpdates(TextChangeManager changeManager, IProgressMonitor pm, RefactoringStatus status) throws CoreException { pm.beginTask("", fCus.length); //$NON-NLS-1$ for (int i= 0; i < fCus.length; i++){ if (pm.isCanceled()) { throw new OperationCanceledException(); } addUpdates(changeManager, fCus[i], new SubProgressMonitor(pm, 1), status); } }
private Set<MavenProjectInfo> getMavenProjects(File directory, MavenModelManager modelManager, IProgressMonitor monitor) throws OperationCanceledException { if (directory == null) { return Collections.emptySet(); } try { LocalProjectScanner scanner = new LocalProjectScanner(directory.getParentFile(), directory.toString(), false, modelManager); scanner.run(monitor); return collectProjects(scanner.getProjects()); } catch (InterruptedException e) { throw new OperationCanceledException(); } }
@Override public void locateMatches(SearchDocument[] indexMatches, SearchPattern mPattern, IJavaSearchScope scope, SearchRequestor requestor, IProgressMonitor monitor) throws CoreException { MatchLocator matchLocator = new MatchLocator(mPattern, requestor, scope, monitor); /* eliminating false matches and locating them */ if (monitor != null && monitor.isCanceled()) throw new OperationCanceledException(); matchLocator.locateMatches(indexMatches); addRequiredModules(matchLocator); } private void addRequiredModules(MatchLocator matchLocator) {
private IProgressMonitor subMonitor(IProgressMonitor monitor, int work) { if (monitor != null) { if (monitor.isCanceled() || getControl().isDisposed()) throw new OperationCanceledException(); return new SubProgressMonitor(monitor, work); } return null; }
private void confirmMovingReadOnly(IReorgQueries reorgQueries) throws CoreException { if (!ReadOnlyResourceFinder.confirmMoveOfReadOnlyElements(getJavaElements(), getResources(), reorgQueries)) { throw new OperationCanceledException(); } }
private void confirmMovingReadOnly(IReorgQueries reorgQueries) throws CoreException { if (!ReadOnlyResourceFinder.confirmMoveOfReadOnlyElements(getJavaElements(), getResources(), reorgQueries)) { throw new OperationCanceledException(); } }
private void confirmMovingReadOnly(IReorgQueries reorgQueries) throws CoreException { if (!ReadOnlyResourceFinder.confirmMoveOfReadOnlyElements(getJavaElements(), getResources(), reorgQueries)) { throw new OperationCanceledException(); } }
@Override public void runInToolingApi(CancellationTokenSource tokenSource, IProgressMonitor monitor) throws Exception { SubMonitor progress = SubMonitor.convert(monitor); progress.setWorkRemaining(2); CancellationToken token = tokenSource.token(); op1.runInToolingApi(tokenSource, progress.newChild(1)); if (monitor.isCanceled() && token.isCancellationRequested()) { throw new OperationCanceledException(); } op2.runInToolingApi(tokenSource, progress.newChild(1)); }