當前位置: 首頁>>代碼示例>>Java>>正文


Java Job.getJobManager方法代碼示例

本文整理匯總了Java中org.eclipse.core.runtime.jobs.Job.getJobManager方法的典型用法代碼示例。如果您正苦於以下問題:Java Job.getJobManager方法的具體用法?Java Job.getJobManager怎麽用?Java Job.getJobManager使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.core.runtime.jobs.Job的用法示例。


在下文中一共展示了Job.getJobManager方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: widgetSelected

import org.eclipse.core.runtime.jobs.Job; //導入方法依賴的package包/類
@Override
public void widgetSelected(SelectionEvent e) {
	startButton.setText("Start");
	IJobManager jobManager = Job.getJobManager();
	Job[] find = jobManager.find("timer");
	
	if (find != null) {
		for (Job job : find) {
			if (job instanceof CountDownJob) {
				CountDownJob cjob = (CountDownJob) job;
				cjob.stop();
				cjob.cancel();
			}
		}
	}
}
 
開發者ID:NineWorlds,項目名稱:xstreamer,代碼行數:17,代碼來源:RestTimerListener.java

示例2: waitForIdleState

import org.eclipse.core.runtime.jobs.Job; //導入方法依賴的package包/類
/**
 * Wait until all background tasks are complete then makes sure that the UI thread is idle as well.
 */
protected void waitForIdleState() {
	final IJobManager manager = Job.getJobManager();
	while (manager.currentJob() != null) {
		waitForUiThread();
	}
	waitForUiThread();
}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:11,代碼來源:AbstractPluginUITest.java

示例3: findPendingBuildJobs

import org.eclipse.core.runtime.jobs.Job; //導入方法依賴的package包/類
/** Identify all jobs that we know of that are related to building. */
private static Collection<Job> findPendingBuildJobs(IProject... projects) {
  Set<Job> jobs = new HashSet<>();
  IJobManager jobManager = Job.getJobManager();
  Collections.addAll(jobs, jobManager.find(ResourcesPlugin.FAMILY_MANUAL_BUILD));
  Collections.addAll(jobs, jobManager.find(ResourcesPlugin.FAMILY_AUTO_BUILD));
  // J2EEElementChangedListener.PROJECT_COMPONENT_UPDATE_JOB_FAMILY
  Collections.addAll(jobs, jobManager.find("org.eclipse.jst.j2ee.refactor.component"));
  // ServerPlugin.SHUTDOWN_JOB_FAMILY
  Collections.addAll(jobs, jobManager.find("org.eclipse.wst.server.core.family"));
  Collections.addAll(jobs, jobManager.find("org.eclipse.wst.server.ui.family"));
  Collections.addAll(jobs, jobManager.find(ValidationBuilder.FAMILY_VALIDATION_JOB));
  for (IProject project : projects) {
    Collections.addAll(jobs,
        jobManager.find(project.getName() + ValidatorManager.VALIDATOR_JOB_FAMILY));
  }
  // some jobs are not part of a family
  for (Job job : jobManager.find(null)) {
    switch (job.getClass().getName()) {
      case "org.eclipse.wst.jsdt.web.core.internal.project.ConvertJob":
      case "org.eclipse.m2e.core.ui.internal.wizards.ImportMavenProjectsJob":
      case "org.eclipse.m2e.core.internal.project.registry.ProjectRegistryRefreshJob":
        jobs.add(job);
        break;
    }
  }
  return jobs;
}
 
開發者ID:GoogleCloudPlatform,項目名稱:google-cloud-eclipse,代碼行數:29,代碼來源:ProjectUtils.java


注:本文中的org.eclipse.core.runtime.jobs.Job.getJobManager方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。