try { project.refreshLocal(IResource.DEPTH_INFINITE, null); IJobManager jobManager = Job.getJobManager(); jobManager.join(ResourcesPlugin.FAMILY_AUTO_BUILD, null); } catch (CoreException | OperationCanceledException | InterruptedException e) { e.printStackTrace(); }
@Override public boolean selectChange(boolean next) { // wait for repositories actions IJobManager manager = Job.getJobManager(); try { manager.join(JobFamilies.ADD_TO_INDEX, null); manager.join(JobFamilies.REMOVE_FROM_INDEX, null); manager.join(org.eclipse.egit.core.JobFamilies.REPOSITORY_CHANGED, null); } catch (InterruptedException e) { // ignore } return mainNavigator.selectChange(next); }
/** * Waits for the early startup job to complete. */ private void waitForEarlyStartup() { try { Job.getJobManager().join(Workbench.EARLY_STARTUP_FAMILY, null); } catch (OperationCanceledException e) { // ignore } catch (InterruptedException e) { // ignore } }
public void stop() { try { //ensure there are no more profile preference save jobs running Job.getJobManager().join(ProfilePreferences.PROFILE_SAVE_JOB_FAMILY, null); } catch (InterruptedException e) { //ignore } }
@Override public void stop() { try { //ensure there are no more profile preference save jobs running Job.getJobManager().join(ProfilePreferences.PROFILE_SAVE_JOB_FAMILY, null); } catch (InterruptedException e) { //ignore } }
protected IStatus run(IProgressMonitor monitor) { try { try { Job.getJobManager().join(IndexerJob.FAMILY, monitor); } catch (InterruptedException e) { // TODO should we do someting here? } performSearch(phrase, excludeContext, monitor); return Status.OK_STATUS; } catch (OperationCanceledException e) { // it is ok to cancel the search return Status.OK_STATUS; } } };
private void waitForLifecycleJobs(IProgressMonitor monitor) { try { Job.getJobManager().join(DocumentLifeCycleHandler.DOCUMENT_LIFE_CYCLE_JOBS, monitor); } catch (OperationCanceledException ignorable) { // No need to pollute logs when query is cancelled } catch (InterruptedException e) { JavaLanguageServerPlugin.logException(e.getMessage(), e); } }
public static void waitForAutoBuild() { System.out.println("Waiting for auto-build"); boolean wasInterrupted = false; do { try { Job.getJobManager().join(ResourcesPlugin.FAMILY_AUTO_BUILD, null); wasInterrupted = false; } catch (OperationCanceledException e) { e.printStackTrace(); } catch (InterruptedException e) { wasInterrupted = true; } } while (wasInterrupted); }
public static void fullBuild() throws CoreException { System.out.println("Starting full build"); ResourcesPlugin.getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, new NullProgressMonitor()); boolean wasInterrupted = false; do { try { Job.getJobManager().join(ResourcesPlugin.FAMILY_MANUAL_BUILD, null); wasInterrupted = false; } catch (OperationCanceledException e) { e.printStackTrace(); } catch (InterruptedException e) { wasInterrupted = true; } } while (wasInterrupted); }
public static void waitForAutoBuild() { boolean wasInterrupted = false; do { try { Job.getJobManager().join(ResourcesPlugin.FAMILY_AUTO_BUILD, null); wasInterrupted = false; } catch (OperationCanceledException e) { e.printStackTrace(); } catch (InterruptedException e) { wasInterrupted = true; } } while (wasInterrupted); }
public static void cleanBuild() throws CoreException { ResourcesPlugin.getWorkspace().build(IncrementalProjectBuilder.CLEAN_BUILD, new NullProgressMonitor()); boolean wasInterrupted = false; do { try { Job.getJobManager().join(ResourcesPlugin.FAMILY_MANUAL_BUILD, null); wasInterrupted = false; } catch (OperationCanceledException e) { e.printStackTrace(); } catch (InterruptedException e) { wasInterrupted = true; } } while (wasInterrupted); }
public void stop(BundleContext bundleContext) throws Exception { try { // cancel any repository load jobs started in the UI Job.getJobManager().cancel(LoadMetadataRepositoryJob.LOAD_FAMILY); // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=305163 // join the jobs so that this bundle does not stop until the jobs are // actually cancelled. Job.getJobManager().join(LoadMetadataRepositoryJob.LOAD_FAMILY, new NullProgressMonitor()); plugin = null; ProvUIActivator.context = null; ui = null; } finally { super.stop(bundleContext); } }
protected void waitPaused(URI uri, OutputStream anOutputStream, long startPos, IProgressMonitor monitor) throws AuthenticationFailedException, JREHttpClientRequiredException, FileNotFoundException, CoreException, OperationCanceledException, InterruptedException { if (hasPaused) { while (hasPaused) { Thread.sleep(1000); if (monitor.isCanceled()) throw new OperationCanceledException(); } Job.getJobManager().join(this, new SuppressBlockedMonitor(monitor, 0)); waitPaused(uri, anOutputStream, startPos, monitor); } }
protected void waitPaused(URI uri, OutputStream anOutputStream, long startPos, IProgressMonitor monitor) throws AuthenticationFailedException, JREHttpClientRequiredException, FileNotFoundException, CoreException, OperationCanceledException, InterruptedException { if (hasPaused) { while (hasPaused) { Thread.sleep(1000); if (monitor.isCanceled()) throw new OperationCanceledException(); } Job.getJobManager().join(this, new SuppressBlockedMonitor(monitor, 0)); waitPaused(uri, anOutputStream, startPos, monitor); } }
protected void waitPaused(URI uri, OutputStream anOutputStream, long startPos, IProgressMonitor monitor) throws AuthenticationFailedException, JREHttpClientRequiredException, FileNotFoundException, CoreException, OperationCanceledException, InterruptedException { if (hasPaused) { while (hasPaused) { Thread.sleep(1000); if (monitor.isCanceled()) throw new OperationCanceledException(); } Job.getJobManager().join(this, new SuppressBlockedMonitor(monitor, 0)); waitPaused(uri, anOutputStream, startPos, monitor); } }
public static void cleanBuild() throws CoreException { ResourcesPlugin.getWorkspace().build( IncrementalProjectBuilder.CLEAN_BUILD, monitor()); boolean wasInterrupted = false; do { try { Job.getJobManager().join(ResourcesPlugin.FAMILY_MANUAL_BUILD, null); wasInterrupted = false; } catch (OperationCanceledException e) { e.printStackTrace(); } catch (InterruptedException e) { wasInterrupted = true; } } while (wasInterrupted); }
public IStatus runInUIThread(IProgressMonitor monitor) { IJobManager jobManager = Job.getJobManager(); try { jobManager.join(this, monitor); } catch (OperationCanceledException e1) { return Status.CANCEL_STATUS; } catch (InterruptedException e1) { return Status.CANCEL_STATUS; } IDocument document = getDocument(); String orig = document.get(); if (orig != null && orig.length() > 0) { document.set(format(orig)); } return Status.OK_STATUS; } };
public static void fullBuild() throws CoreException { ResourcesPlugin.getWorkspace().build( IncrementalProjectBuilder.FULL_BUILD, monitor()); boolean wasInterrupted = false; do { try { Job.getJobManager().join(ResourcesPlugin.FAMILY_MANUAL_BUILD, null); wasInterrupted = false; } catch (OperationCanceledException e) { e.printStackTrace(); } catch (InterruptedException e) { wasInterrupted = true; } } while (wasInterrupted); }
public void stop(BundleContext context) throws Exception { super.stop(context); ResourcesPlugin.getWorkspace().removeResourceChangeListener(J2EEComponentClasspathUpdater.getInstance()); try { org.eclipse.core.runtime.Platform.getJobManager().join( J2EEElementChangedListener.PROJECT_COMPONENT_UPDATE_JOB_FAMILY, new NullProgressMonitor() ); } catch (OperationCanceledException e) { Logger.getLogger().logError(e.getMessage()); } catch (InterruptedException e) { Logger.getLogger().logError(e.getMessage()); } }