本文整理汇总了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;
}
}
示例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 + ")";
}
};
}
示例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;
}
示例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;
}
示例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;
}
}
}
示例6: matches
import org.eclipse.core.runtime.jobs.Job; //导入方法依赖的package包/类
@Override
public boolean matches(Job job) {
return job.belongsTo(InitHandler.JAVA_LS_INITIALIZATION_JOBS);
}