/** * @see IProgressMonitor */ @Override public boolean isCanceled() { if (this.progressMonitor != null) { return this.progressMonitor.isCanceled(); } return false; } /**
/** * @see IProgressMonitor */ public boolean isCanceled() { if (this.progressMonitor != null) { return this.progressMonitor.isCanceled(); } return false; } /**
/** * @see IProgressMonitor */ public boolean isCanceled() { if (this.progressMonitor != null) { return this.progressMonitor.isCanceled(); } return false; } /**
public boolean isCanceled() { return progress.isCanceled(); } };
@Override public void checkCancel() throws MethodCancelException { if (monitor.isCanceled() || Thread.currentThread().isInterrupted()) { throw new MethodCancelException(); } }
private void checkCancelled(SubMonitor pm) { if (pm.isCanceled()) throw new OperationCanceledException(); }
private void worked(SubMonitor subMonitor, int work) { if (subMonitor.isCanceled()) throw new OperationCanceledException(); subMonitor.worked(work); }
protected void createReferenceUpdates(IReferenceUpdater referenceUpdater, ElementRenameArguments elementRenameArguments, Iterable<IReferenceDescription> referenceDescriptions, IRefactoringUpdateAcceptor updateAcceptor, SubMonitor updaterProgress) { if (updaterProgress.isCanceled()) return; referenceUpdater.createReferenceUpdates(elementRenameArguments, referenceDescriptions, updateAcceptor, updaterProgress.newChild(1)); }
private void worked(SubMonitor subMonitor, int work) { if (subMonitor.isCanceled()) throw new OperationCanceledException(); subMonitor.worked(work); }
private void worked(SubMonitor subMonitor, int work) { if (subMonitor.isCanceled()) throw new OperationCanceledException(); subMonitor.worked(work); }
private void worked(SubMonitor subMonitor, int work) { if (subMonitor.isCanceled()) throw new OperationCanceledException(); subMonitor.worked(work); }
private void worked(SubMonitor subMonitor, int work) { if (subMonitor.isCanceled()) throw new OperationCanceledException(); subMonitor.worked(work); }
private void worked(SubMonitor subMonitor, int work) { if (subMonitor.isCanceled()) throw new OperationCanceledException(); subMonitor.worked(work); }
public void run() { if (!progress.isCanceled()) { final IAnnotationModel annotationModel = getAnnotationModel(editor); if (annotationModel instanceof IAnnotationModelExtension) ((IAnnotationModelExtension) annotationModel).replaceAnnotations( getExistingOccurrenceAnnotations(annotationModel), annotations); else if(annotationModel != null) throw new IllegalStateException( "AnnotationModel does not implement IAnnotationModelExtension"); //$NON-NLS-1$ } } });
@Override protected final void run(IProgressMonitor monitor, IWorkingCopyManager workingCopyManager) throws CoreException { final SubMonitor progress = SubMonitor.convert(monitor, getName(), m_operations.size() * 100); if (progress.isCanceled()) { return; } for (IOperation op : m_operations) { op.run(progress.newChild(100), workingCopyManager); } } }
public boolean visit(IResource resource) throws CoreException { if (progress.isCanceled()) throw new OperationCanceledException(); if (resource instanceof IStorage) { return updateStorage(null, toBeBuilt, (IStorage) resource); } if (resource instanceof IFolder) { return isHandled((IFolder)resource); } return true; } });
public void build(IBuildContext buildContext, IProgressMonitor monitor) throws CoreException { ImmutableList<IXtextBuilderParticipant> participants = getParticipants(); if (participants.isEmpty()) return; SubMonitor progress = SubMonitor.convert(monitor, participants.size()); progress.subTask(Messages.RegistryBuilderParticipant_InvokingBuildParticipants); for (IXtextBuilderParticipant participant : participants) { if (progress.isCanceled()) throw new OperationCanceledException(); participant.build(buildContext, progress.newChild(1)); } }
/** * {@inheritDoc} */ public void updateMarkers(Delta delta, @Nullable ResourceSet resourceSet, IProgressMonitor monitor) { SubMonitor subMonitor = SubMonitor.convert(monitor, Messages.MarkerUpdaterImpl_ValidateResources, 1); subMonitor.subTask(Messages.MarkerUpdaterImpl_ValidateResources); if (subMonitor.isCanceled()) { throw new OperationCanceledException(); } processDelta(delta, resourceSet, subMonitor.newChild(1)); }
private void fetch(IArtifactRepository[] repositories, IProgressMonitor mon) { SubMonitor monitor = SubMonitor.convert(mon, requestsToProcess.size()); for (int i = 0; i < repositories.length && !requestsToProcess.isEmpty() && !monitor.isCanceled(); i++) { IArtifactRequest[] requests = getRequestsForRepository(repositories[i]); publishDownloadEvent(new CollectEvent(CollectEvent.TYPE_REPOSITORY_START, repositories[i], provContext, requests)); IStatus dlStatus = repositories[i].getArtifacts(requests, monitor.newChild(requests.length)); publishDownloadEvent(new CollectEvent(CollectEvent.TYPE_REPOSITORY_END, repositories[i], provContext, requests)); if (dlStatus.getSeverity() == IStatus.CANCEL) return; filterUnfetched(); monitor.setWorkRemaining(requestsToProcess.size()); } }
protected void addMarkers(IFile file, Resource resource, CheckMode mode, IProgressMonitor monitor) { SubMonitor subMonitor = SubMonitor.convert(monitor, 1); try { List<Issue> list = resourceValidator.validate(resource, mode, getCancelIndicator(subMonitor)); if (subMonitor.isCanceled()) { throw new OperationCanceledException(); } subMonitor.worked(1); deleteMarkers(file, mode, subMonitor); createMarkers(file, list, subMonitor); } catch (CoreException e) { log.error(e.getMessage(), e); } }