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


Java Job.SLEEPING屬性代碼示例

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


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

/**
   * Get the display string based on the current status and the name of the
   * job.
   * @param showProgress a boolean to indicate if we should
   * show progress or not.
   *
   * @return String
   */
  private String getDisplayStringWithStatus(boolean showProgress) {
      if (isCanceled()) {
	return NLS.bind(ProgressMessages.JobInfo_Cancelled, (new Object[] { getJob().getName() }));
}
      if (isBlocked()) {
	return NLS.bind(ProgressMessages.JobInfo_Blocked, (new Object[] { getJob().getName(),
	blockedStatus.getMessage() }));
}
      if (getJob().getState() == Job.RUNNING) {
      	TaskInfo info = getTaskInfo();
          if (info == null) {
		return getJob().getName();
	}
          return info.getDisplayString(showProgress);
      }
      if (getJob().getState() == Job.SLEEPING) {
	return NLS.bind(ProgressMessages.JobInfo_Sleeping, (new Object[] { getJob().getName() }));
}

      return NLS.bind(ProgressMessages.JobInfo_Waiting, (new Object[] { getJob().getName() }));

  }
 
開發者ID:termsuite,項目名稱:termsuite-ui,代碼行數:30,代碼來源:JobInfo.java

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

示例4: getJobNameAndStatus

/**
 * Get the name and status for a jobInfo
 *
 * @param jobInfo
 *
 * @return String
 */
public String getJobNameAndStatus(JobInfo jobInfo) {

	Job job = jobInfo.getJob();

	String name = job.getName();

	if (job.isSystem()) {
		name = NLS.bind(ProgressMessages.JobInfo_System, name);
	}

	if (jobInfo.isCanceled()) {
		if (job.getState() == Job.RUNNING)
			return NLS
					.bind(ProgressMessages.JobInfo_Cancel_Requested, name);
		return NLS.bind(ProgressMessages.JobInfo_Cancelled, name);
	}

	if (jobInfo.isBlocked()) {
		IStatus blockedStatus = jobInfo.getBlockedStatus();
		return NLS.bind(ProgressMessages.JobInfo_Blocked, name,
				blockedStatus.getMessage());
	}

	switch (job.getState()) {
	case Job.RUNNING:
		return name;
	case Job.SLEEPING: {
		return NLS.bind(ProgressMessages.JobInfo_Sleeping, name);

	}
	case Job.NONE: // Only happens for kept jobs
		return getJobInfoFinishedString(job, true);
	default:
		return NLS.bind(ProgressMessages.JobInfo_Waiting, name);
	}
}
 
開發者ID:termsuite,項目名稱:termsuite-ui,代碼行數:43,代碼來源:ProgressInfoItem.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

示例7: isCurrentDisplaying

/**
 * Return whether or not this job is currently displayable.
 *
 * @param job
 * @param debug
 *            If the listener is in debug mode.
 * @return boolean <code>true</code> if the job is not displayed.
 */
boolean isCurrentDisplaying(Job job, boolean debug) {
	return isNeverDisplaying(job, debug) || job.getState() == Job.SLEEPING;
}
 
開發者ID:termsuite,項目名稱:termsuite-ui,代碼行數:11,代碼來源:ProgressManager.java


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