本文整理匯總了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();
}
}
}
}
示例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();
}
示例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;
}