當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。