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


Java Job.getProperty方法代碼示例

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


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

示例1: keep

import org.eclipse.core.runtime.jobs.Job; //導入方法依賴的package包/類
/**
 * Returns true if JobInfo indicates that it must be kept.
 */
static boolean keep(JobInfo info) {
	Job job = info.getJob();
	if (job != null) {
		Object prop = job.getProperty(ProgressManagerUtil.KEEP_PROPERTY);
		if (prop instanceof Boolean) {
			if (((Boolean) prop).booleanValue()) {
				return true;
			}
		}

		prop = job.getProperty(ProgressManagerUtil.KEEPONE_PROPERTY);
		if (prop instanceof Boolean) {
			if (((Boolean) prop).booleanValue()) {
				return true;
			}
		}

		IStatus status = job.getResult();
		if (status != null && status.getSeverity() == IStatus.ERROR) {
			return true;
		}
	}
	return false;
}
 
開發者ID:termsuite,項目名稱:termsuite-ui,代碼行數:28,代碼來源:FinishedJobs.java

示例2: execute

import org.eclipse.core.runtime.jobs.Job; //導入方法依賴的package包/類
/**
 * @param ji
 * @param job
 * @return <code>true</code> if Action or Command is executed
 */
private boolean execute(JobInfo ji, Job job) {

	Object prop = job.getProperty(IProgressConstants.ACTION_PROPERTY);
	if (prop instanceof IAction && ((IAction) prop).isEnabled()) {
		IAction action = (IAction) prop;
		action.run();
		removeTopElement(ji);
		return true;
	}

	prop = job.getProperty(IProgressConstants.COMMAND_PROPERTY);
	if (prop instanceof ParameterizedCommand) {
		ParameterizedCommand command = (ParameterizedCommand) prop;
		getEHandlerService().executeHandler(command);
		removeTopElement(ji);
		return true;
	}
	return false;
}
 
開發者ID:termsuite,項目名稱:termsuite-ui,代碼行數:25,代碼來源:ProgressAnimationItem.java

示例3: getAction

import org.eclipse.core.runtime.jobs.Job; //導入方法依賴的package包/類
private IAction getAction(Job job) {
	Object property = job.getProperty(IProgressConstants.ACTION_PROPERTY);
	if (property instanceof IAction) {
		return (IAction) property;
	}
	return null;
}
 
開發者ID:termsuite,項目名稱:termsuite-ui,代碼行數:8,代碼來源:ProgressAnimationItem.java

示例4: disposeAction

import org.eclipse.core.runtime.jobs.Job; //導入方法依賴的package包/類
static void disposeAction(JobTreeElement jte) {
	if (jte.isJobInfo()) {
		JobInfo ji = (JobInfo) jte;
		Job job = ji.getJob();
		if (job != null) {
			Object prop = job
					.getProperty(IProgressConstants.ACTION_PROPERTY);
			if (prop instanceof IDisposableAction) {
				((IDisposableAction) prop).dispose();
			}
		}
	}
}
 
開發者ID:termsuite,項目名稱:termsuite-ui,代碼行數:14,代碼來源:FinishedJobs.java

示例5: 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

示例6: isInfrastructureJob

import org.eclipse.core.runtime.jobs.Job; //導入方法依賴的package包/類
/**
 * Return whether or not this job is an infrastructure job.
 *
 * @param job
 * @return boolean <code>true</code> if it is never displayed.
 */
private boolean isInfrastructureJob(Job job) {
	if (Policy.DEBUG_SHOW_ALL_JOBS)
		return false;
	return job.getProperty(ProgressManagerUtil.INFRASTRUCTURE_PROPERTY) != null;
}
 
開發者ID:termsuite,項目名稱:termsuite-ui,代碼行數:12,代碼來源:ProgressManager.java


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