当前位置: 首页>>代码示例>>Java>>正文


Java Job.belongsTo方法代码示例

本文整理汇总了Java中org.eclipse.core.runtime.jobs.Job.belongsTo方法的典型用法代码示例。如果您正苦于以下问题:Java Job.belongsTo方法的具体用法?Java Job.belongsTo怎么用?Java Job.belongsTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.core.runtime.jobs.Job的用法示例。


在下文中一共展示了Job.belongsTo方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: busyListenersForJob

import org.eclipse.core.runtime.jobs.Job; //导入方法依赖的package包/类
/**
 * Return the listeners for the job.
 *
 * @param job
 * @return Collection of IJobBusyListener
 */
@SuppressWarnings("unchecked")
   private Collection<IJobBusyListener> busyListenersForJob(Job job) {
	if (job.isSystem()) {
		return Collections.EMPTY_LIST;
	}
	synchronized (familyListeners) {

		if (familyListeners.isEmpty()) {
			return Collections.EMPTY_LIST;
		}

		Iterator<Object> families = familyListeners.keySet().iterator();
		Collection<IJobBusyListener> returnValue = new HashSet<>();
		while (families.hasNext()) {
			Object next = families.next();
			if (job.belongsTo(next)) {
				Collection<IJobBusyListener> currentListeners = familyListeners
						.get(next);
				returnValue.addAll(currentListeners);
			}
		}
		return returnValue;
	}
}
 
开发者ID:termsuite,项目名称:termsuite-ui,代码行数:31,代码来源:ProgressManager.java

示例2: forFamily

import org.eclipse.core.runtime.jobs.Job; //导入方法依赖的package包/类
/**
 * Returns a new job finder to match all jobs of a given family.
 *
 * @param family
 *          family to match
 * @return job finder
 */
public static JobFinder forFamily(final Object family) {
  return new JobFinder() {
    @Override
    public boolean apply(final Job input) {
      return input.belongsTo(family);
    }

    @Override
    public List<Job> find() {
      return ImmutableList.copyOf(Job.getJobManager().find(family));
    }

    @Override
    public String toString() {
      return "Predicate(family=" + family + ")";
    }
  };
}
 
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:26,代码来源:JobMatcher.java

示例3: getIconFor

import org.eclipse.core.runtime.jobs.Job; //导入方法依赖的package包/类
@Override
public Image getIconFor(Job job) {
	Enumeration<Object> families = imageKeyTable.keys();
	while (families.hasMoreElements()) {
		Object next = families.nextElement();
		if (job.belongsTo(next)) {
			return JFaceResources.getImageRegistry().get(imageKeyTable.get(next));
		}
	}
	return null;
}
 
开发者ID:termsuite,项目名称:termsuite-ui,代码行数:12,代码来源:ProgressServiceImpl.java

示例4: findJobsToRemove

import org.eclipse.core.runtime.jobs.Job; //导入方法依赖的package包/类
private JobTreeElement[] findJobsToRemove(JobTreeElement info) {

		if (info.isJobInfo()) {
			Job myJob = ((JobInfo) info).getJob();

			if (myJob != null) {

				Object prop = myJob
						.getProperty(ProgressManagerUtil.KEEPONE_PROPERTY);
				if (prop instanceof Boolean && ((Boolean) prop).booleanValue()) {
					ArrayList<JobTreeElement> found = null;
					JobTreeElement[] all;
					synchronized (keptjobinfos) {
						all = keptjobinfos
								.toArray(new JobTreeElement[keptjobinfos.size()]);
					}
					for (int i = 0; i < all.length; i++) {
						JobTreeElement jte = all[i];
						if (jte != info && jte.isJobInfo()) {
							Job job = ((JobInfo) jte).getJob();
							if (job != null && job != myJob
									&& job.belongsTo(myJob)) {
								if (found == null) {
									found = new ArrayList<>();
								}
								found.add(jte);
							}
						}
					}
					if (found != null) {
						return found
								.toArray(new JobTreeElement[found.size()]);
					}
				}
			}
		}
		return null;
	}
 
开发者ID:termsuite,项目名称:termsuite-ui,代码行数:39,代码来源:FinishedJobs.java

示例5: done

import org.eclipse.core.runtime.jobs.Job; //导入方法依赖的package包/类
public void done(IJobChangeEvent event) {
	final Job j = event.getJob();
	if(j.belongsTo(ToolboxJob.FAMILY)) {
		final String jobName = j.getName();
		if(jobName.endsWith(model.getName())) {
			job = j;
		}
	}
}
 
开发者ID:tlaplus,项目名称:tlaplus,代码行数:10,代码来源:DummyJobChangeListener.java

示例6: matches

import org.eclipse.core.runtime.jobs.Job; //导入方法依赖的package包/类
@Override
public boolean matches(Job job) {
	return job.belongsTo(InitHandler.JAVA_LS_INITIALIZATION_JOBS);
}
 
开发者ID:eclipse,项目名称:eclipse.jdt.ls,代码行数:5,代码来源:JobHelpers.java


注:本文中的org.eclipse.core.runtime.jobs.Job.belongsTo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。