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


Java Job.getResult方法代碼示例

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


在下文中一共展示了Job.getResult方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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: removeErrorJobs

import org.eclipse.core.runtime.jobs.Job; //導入方法依賴的package包/類
public void removeErrorJobs() {
	JobTreeElement[] infos = getKeptElements();
	for (int i = 0; i < infos.length; i++) {
		if (infos[i].isJobInfo()) {
			JobInfo info1 = (JobInfo) infos[i];
			Job job = info1.getJob();
			if (job != null) {
				IStatus status = job.getResult();
				if (status != null && status.getSeverity() == IStatus.ERROR) {
					JobTreeElement topElement = info1.getParent();
					if (topElement == null) {
						topElement = info1;
					}
					remove(topElement);
				}
			}
		}
	}
}
 
開發者ID:termsuite,項目名稱:termsuite-ui,代碼行數:20,代碼來源:FinishedJobs.java

示例3: doAction

import org.eclipse.core.runtime.jobs.Job; //導入方法依賴的package包/類
void doAction() {

		JobTreeElement[] jobTreeElements = finishedJobs.getKeptElements();
		// search from end (youngest)
		for (int i = jobTreeElements.length - 1; i >= 0; i--) {
			if (jobTreeElements[i] instanceof JobInfo) {
				JobInfo ji = (JobInfo) jobTreeElements[i];
				Job job = ji.getJob();
				if (job != null) {

					IStatus status = job.getResult();
					if (status != null && status.getSeverity() == IStatus.ERROR) {
						//TODO E4
//						StatusAdapter statusAdapter = StatusAdapterHelper
//								.getInstance().getStatusAdapter(ji);

//						if (statusAdapter == null)
//							statusAdapter = new StatusAdapter(status);
						getStatusReporter().report(status,
						        StatusReporter.SHOW, new Object[0]);
						removeTopElement(ji);
					}

					// To fix a bug (335543) introduced in 3.6.1.
					// doAction() should return if progress region button was
					// selected to open a job result action or command.
					if (execute(ji, job)) {
						return;
					}
				}
			}
		}

		progressRegion.processDoubleClick();
		refresh();
	}
 
開發者ID:termsuite,項目名稱:termsuite-ui,代碼行數:37,代碼來源:ProgressAnimationItem.java

示例4: joinJob

import org.eclipse.core.runtime.jobs.Job; //導入方法依賴的package包/類
@Override
public void joinJob(final Job job) throws InterruptedException {
    final Display display = Display.getCurrent();

    if (display != null && display.getThread() == Thread.currentThread()) {
        while (job.getResult() == null) {
            if (!display.readAndDispatch()) {
                display.sleep();
            }
        }
    } else {
        // display should only be null if the program is exiting
        job.join();
    }
}
 
開發者ID:Microsoft,項目名稱:team-explorer-everywhere,代碼行數:16,代碼來源:UIAsyncObjectWaiter.java

示例5: refresh

import org.eclipse.core.runtime.jobs.Job; //導入方法依賴的package包/類
private void refresh() {

		// Abort the refresh if we are in the process of shutting down
		if (!PlatformUI.isWorkbenchRunning()) {
			return;
		}

		if (toolbar == null || toolbar.isDisposed()) {
			return;
		}

		JobTreeElement[] jobTreeElements = finishedJobs.getKeptElements();
		// search from end (youngest)
		for (int i = jobTreeElements.length - 1; i >= 0; i--) {
			if (jobTreeElements[i] instanceof JobInfo) {
				JobInfo ji = (JobInfo) jobTreeElements[i];
				Job job = ji.getJob();
				if (job != null) {
					IStatus status = job.getResult();
					if (status != null && status.getSeverity() == IStatus.ERROR) {
						// green arrow with error overlay
						initButton(errorImage, NLS.bind(
								ProgressMessages.ProgressAnimationItem_error,
								job.getName()));
						return;
					}
					IAction action = getAction(job);
					if (action != null && action.isEnabled()) {
						// green arrow with exclamation mark
						String tt = action.getToolTipText();
						if (tt == null || tt.trim().length() == 0) {
							tt = NLS.bind(
									ProgressMessages.ProgressAnimationItem_ok,
									job.getName());
						}
						initButton(okImage, tt);
						return;
					}
					// just the green arrow
					initButton(noneImage,
							ProgressMessages.ProgressAnimationItem_tasks);
					return;
				}
			}
		}

		if (animationRunning) {
			initButton(noneImage, ProgressMessages.ProgressAnimationItem_tasks);
			return;
		}

		// if nothing found hide tool item
		toolbar.setVisible(false);
	}
 
開發者ID:termsuite,項目名稱:termsuite-ui,代碼行數:55,代碼來源:ProgressAnimationItem.java


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