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


Java Job.WAITING属性代码示例

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


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

示例1: getDisplayImage

@Override
public Image getDisplayImage() {
       int done = getPercentDone();
       if (done > 0) {
           return super.getDisplayImage();
       }
       if (isBlocked()) {
		return JFaceResources.getImage(ProgressManager.BLOCKED_JOB_KEY);
	}
       int state = getJob().getState();
       if (state == Job.SLEEPING) {
		return JFaceResources.getImage(ProgressManager.SLEEPING_JOB_KEY);
	}
       if (state == Job.WAITING) {
		return JFaceResources.getImage(ProgressManager.WAITING_JOB_KEY);
	}
       //By default return the first progress image
       return super.getDisplayImage();

   }
 
开发者ID:termsuite,项目名称:termsuite-ui,代码行数:20,代码来源:JobInfo.java

示例2: dispose

/**
 * @see org.eclipse.ui.part.MultiPageEditorPart#dispose()
 */
@Override
public void dispose() {
    super.dispose();

    if (pollJob != null && (pollJob.getState() == Job.SLEEPING || pollJob.getState() == Job.WAITING)) {
        pollJob.cancel();
        pollJob = null;
    }

    if (serverManagerListener != null) {
        TFSCommonUIClientPlugin.getDefault().getProductPlugin().getServerManager().removeListener(
            serverManagerListener);
        serverManagerListener = null;
    }

    queuedPageImage.dispose();
    completedPageImage.dispose();
    if (queueEditorPage != null) {
        queueEditorPage.dispose();
    }
    buildEditorPage.dispose();
    instance = null;

    disposed = true;
}
 
开发者ID:Microsoft,项目名称:team-explorer-everywhere,代码行数:28,代码来源:BuildExplorer.java

示例3: isRunning

/**
 * Return whether or not the receiver is being displayed as running.
 *
 * @return boolean
 */
private boolean isRunning() {

	JobInfo[] infos = getJobInfos();
	for (int i = 0; i < infos.length; i++) {
		int state = infos[i].getJob().getState();
		if (state == Job.WAITING || state == Job.RUNNING)
			return true;
	}
	return false;
}
 
开发者ID:termsuite,项目名称:termsuite-ui,代码行数:15,代码来源:ProgressInfoItem.java

示例4: update

public void update() {
	if (state != State.READY) return;
	switch (getState()) {
		case Job.WAITING:
		case Job.RUNNING:
			schedule(store.getInt(Prefs.VIEW_UPDATE_DELAY));
			break;
		default:
			schedule(SHORT);
			break;
	}
}
 
开发者ID:grosenberg,项目名称:fluentmark,代码行数:12,代码来源:ViewJob.java

示例5: dumpJob

private void dumpJob(StringBuilder sb, String linePrefix, Job job, Thread thread) {
  String status;
  switch (job.getState()) {
    case Job.RUNNING:
      status = "RUNNING";
      break;
    case Job.WAITING:
      status = "WAITING";
      break;
    case Job.SLEEPING:
      status = "SLEEPING";
      break;
    case Job.NONE:
      status = "NONE";
      break;
    default:
      status = "UNKNOWN(" + job.getState() + ")";
      break;
  }
  Object blockingJob = null;
  try {
    blockingJob = ReflectionUtil.invoke(Job.getJobManager(), "findBlockingJob",
        InternalJob.class, new Class<?>[] {InternalJob.class}, job);
  } catch (NoSuchMethodException | SecurityException | IllegalAccessException
      | IllegalArgumentException | InvocationTargetException ex) {
    System.err.println("Unable to fetch blocking-job: " + ex);
  }
  sb.append("\n").append(linePrefix);
  //@formatter:off
  sb.append(String.format("  %s%s{pri=%d%s%s%s%s} %s (%s)%s",
      status,
      (job.isBlocking() ? "<BLOCKING>" : ""),
      job.getPriority(),
      (job.isSystem() ? ",system" : ""),
      (job.isUser() ? ",user" : ""),
      (job.getRule() != null ? ",rule=" + job.getRule() : ""),
      (thread != null ? ",thr=" + thread : ""),
      job,
      job.getClass().getName(),
      (job.getJobGroup() != null ? " [group=" + job.getJobGroup() + "]" : "")));
  if (blockingJob != null) {
    sb.append("\n").append(linePrefix)
        .append(String.format("    - blocked by: %s (%s)", blockingJob, blockingJob.getClass()));
  }
  //@formatter:on
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:46,代码来源:ThreadDumpingWatchdog.java

示例6: build

/**
    * Build the project.
    * 
 * @see IncrementalProjectBuilder.build
 */
   @Override
protected IProject[] build(int kind, Map args,
        IProgressMonitor monitor) throws CoreException {

       final IProject project = getProject();
       final ProjectFileTracking fileTracking = new ProjectFileTracking(project);
       final OutputFileManager fileManager = new OutputFileManager(project, fileTracking);

       Object rebuild = TexlipseProperties.getSessionProperty(project,
               TexlipseProperties.FORCED_REBUILD);

       // Wait for all scheduled parser jobs, since they could change relevant
       // session properties
       for (Job parser : Job.getJobManager().find(TexDocumentModel.PARSER_FAMILY)) {
           int state = parser.getState();
           if (state == Job.WAITING || state == Job.SLEEPING) {
               // If waiting, run immediately
               parser.cancel();
               parser.schedule();
           }
           try {
               parser.join();
           } catch (InterruptedException e) {
           }
       }

       if (rebuild == null && fileManager.isUpToDate()) {
           return null;
       }

       BuilderRegistry.clearConsole();

       Object s = TexlipseProperties.getProjectProperty(project,
               TexlipseProperties.PARTIAL_BUILD_PROPERTY);
	if (s != null) {
		partialBuild(project, fileManager, monitor);
	} else {
		buildFile(project, null, fileManager, monitor);
	}

	TexlipseProperties.setSessionProperty(project,
	        TexlipseProperties.FORCED_REBUILD, null);

	return null;
}
 
开发者ID:eclipse,项目名称:texlipse,代码行数:50,代码来源:TexlipseBuilder.java


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