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


Java Job.NONE屬性代碼示例

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


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

示例1: open

@Override
public int open() {
	int result = super.open();

	// add a listener that will close the dialog when the job completes.
	IJobChangeListener listener = createCloseListener();
	job.addJobChangeListener(listener);
	if (job.getState() == Job.NONE) {
		// if the job completed before we had a chance to add
		// the listener, just remove the listener and return
		job.removeJobChangeListener(listener);
		finishedRun();
		cleanUpFinishedJob();
	}

	return result;
}
 
開發者ID:termsuite,項目名稱:termsuite-ui,代碼行數:17,代碼來源:ProgressMonitorFocusJobDialog.java

示例2: updateInProgressManager

/**
 * Update the receiver in the progress manager. If all of the jobs are
 * finished and the receiver is not being kept then remove it.
 */
private void updateInProgressManager() {
	Iterator<JobInfo> infoIterator = infos.iterator();
	while (infoIterator.hasNext()) {
		JobInfo next = infoIterator.next();
		if (!(next.getJob().getState() == Job.NONE)) {
			progressManager.refreshGroup(this);
			return;
		}
	}

	if (finishedJobs.isKept(this))
		progressManager.refreshGroup(this);
	else
		progressManager.removeGroup(this);
}
 
開發者ID:termsuite,項目名稱:termsuite-ui,代碼行數:19,代碼來源:GroupInfo.java

示例3: scheduleFetchChangePathJob

public void scheduleFetchChangePathJob(ILogEntry logEntry) {
  if(fetchChangePathJob == null) {
    fetchChangePathJob = new FetchChangePathJob();
  }
  if(fetchChangePathJob.getState() != Job.NONE) {
    fetchChangePathJob.cancel();
    try {
      fetchChangePathJob.join();
    } catch(InterruptedException e) {
  	SVNUIPlugin.log(IStatus.ERROR, e.getMessage(), e);  
      // SVNUIPlugin.log(new
      // SVNException(Policy.bind("HistoryView.errorFetchingEntries",
      // remoteResource.getName()), e)); //$NON-NLS-1$
    }
  }
  fetchChangePathJob.setLogEntry(logEntry);
  Utils.schedule(fetchChangePathJob, getSite());
}
 
開發者ID:subclipse,項目名稱:subclipse,代碼行數:18,代碼來源:SVNHistoryPage.java

示例4: run

public void run() {
  final ISVNRemoteResource remoteResource = historyTableProvider.getRemoteResource();
  if(fetchNextLogEntriesJob == null) {
    fetchNextLogEntriesJob = new FetchNextLogEntriesJob();
  }
  if(fetchNextLogEntriesJob.getState() != Job.NONE) {
    fetchNextLogEntriesJob.cancel();
    try {
      fetchNextLogEntriesJob.join();
    } catch(InterruptedException e) {
      SVNUIPlugin.log(new SVNException(Policy
          .bind("HistoryView.errorFetchingEntries", remoteResource.getName()), e)); //$NON-NLS-1$
    }
  }
  fetchNextLogEntriesJob.setRemoteFile(remoteResource);
  Utils.schedule(fetchNextLogEntriesJob, getSite());
}
 
開發者ID:subclipse,項目名稱:subclipse,代碼行數:17,代碼來源:SVNHistoryPage.java

示例5: handleEvent

@Override
public void handleEvent(final Event event) {
	final TableViewer tableViewer = gui.getResultsTable().getTableViewer();
	if (tableViewer != null && !tableViewer.getTable().isDisposed() && tableViewer.getStructuredSelection() != null) {
		final Earthquake selectedItem = (Earthquake) tableViewer.getStructuredSelection().getFirstElement();
		if (selectedItem != null) {
			final String guid = selectedItem.getGuid();
			final MapCanvas mapCanvas = gui.getMapCanvas();
			final MapCache cache = mapCanvas.getCache();
			if (mapCanvas.getDownloadMapJob() == null || mapCanvas.getDownloadMapJob().getState() == Job.NONE) {
				if (cache.contains(guid) && cache.get(guid).getEtag() != null) {
					mapCanvas.setDownloadMapJob(new DownloadMapJob(gui, selectedItem, cache.get(guid).getEtag()));
				}
				else {
					mapCanvas.setDownloadMapJob(new DownloadMapJob(gui, selectedItem));
				}
			}
			mapCanvas.getDownloadMapJob().schedule();
		}
	}
}
 
開發者ID:Albertus82,項目名稱:EarthquakeBulletin,代碼行數:21,代碼來源:ShowMapListener.java

示例6: checkForStaleness

/**
 * Check the if the job should be removed from the list as it may be stale.
 *
 * @param job
 * @return boolean
 */
boolean checkForStaleness(Job job) {
	if (job.getState() == Job.NONE) {
		removeJobInfo(getJobInfo(job));
		return true;
	}
	return false;
}
 
開發者ID:termsuite,項目名稱:termsuite-ui,代碼行數:13,代碼來源:ProgressManager.java

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

示例8: isCompleted

/**
 * Return whether or not the receiver is a completed job.
 *
 * @return boolean <code>true</code> if the state is Job#NONE.
 */
private boolean isCompleted() {

	JobInfo[] infos = getJobInfos();
	for (int i = 0; i < infos.length; i++) {
		if (infos[i].getJob().getState() != Job.NONE) {
			return false;
		}
	}
	// Only completed if there are any jobs
	return infos.length > 0;
}
 
開發者ID:termsuite,項目名稱:termsuite-ui,代碼行數:16,代碼來源:ProgressInfoItem.java

示例9: widgetSelected

@Override
public void widgetSelected(final SelectionEvent se) {
	if (gui.getSearchForm().isValid() && (gui.getSearchForm().getSearchJob() == null || gui.getSearchForm().getSearchJob().getState() == Job.NONE)) {
		gui.getSearchForm().setSearchJob(new SearchJob(gui));
		gui.getSearchForm().getSearchJob().schedule();
	}
}
 
開發者ID:Albertus82,項目名稱:EarthquakeBulletin,代碼行數:7,代碼來源:SearchButtonSelectionListener.java

示例10: waitUntilDone

/**
   * Wait until the collector is done processing any events.
   * This method is for testing purposes only.
   * @param monitor 
   */
  public void waitUntilDone(IProgressMonitor monitor) {
monitor.worked(1);
// wait for the event handler to process changes.
while(handler.getEventHandlerJob().getState() != Job.NONE) {
	monitor.worked(1);
	try {
		Thread.sleep(10);		
	} catch (InterruptedException e) {
	}
	Policy.checkCanceled(monitor);
}
monitor.worked(1);
  }
 
開發者ID:subclipse,項目名稱:subclipse,代碼行數:18,代碼來源:SubclipseSubscriberChangeSetManager.java

示例11: share

public void share(IProject project) {
    if (!RepositoryProvider.isShared(project)) {
        synchronized (projectsToShare) {
            if (!projectsToShare.contains(project)) {
                SVNWorkspaceRoot.setManagedBySubclipse(project);
                projectsToShare.add(project);
            }
        }
        if(getState() == Job.NONE && !isQueueEmpty())
            schedule();
    }
}
 
開發者ID:subclipse,項目名稱:subclipse,代碼行數:12,代碼來源:SVNTeamProviderType.java

示例12: dispose

public void dispose() {
	isReferenceInitialized = false;
	// stop update job
	if(fUpdateJob != null && fUpdateJob.getState() != Job.NONE) {
		fUpdateJob.cancel();
	}
	
	// remove listeners
	if(documentProvider != null) {
		documentProvider.removeElementStateListener(documentListener);
	}
	SVNWorkspaceSubscriber.getInstance().removeListener(teamChangeListener);				
}
 
開發者ID:subclipse,項目名稱:subclipse,代碼行數:13,代碼來源:SVNPristineCopyQuickDiffProvider.java

示例13: updateButtons

public void updateButtons() {
	if (searchJob == null || searchJob.getState() == Job.NONE) {
		stopButton.setEnabled(false);
		searchButton.setEnabled(isValid());
	}
	else {
		searchButton.setEnabled(false);
		stopButton.setEnabled(true);
	}
}
 
開發者ID:Albertus82,項目名稱:EarthquakeBulletin,代碼行數:10,代碼來源:SearchForm.java

示例14: close

public void close() throws InterruptedException {
	bookmarkDatabase.removeListener(bookmarksListener);
	eventBroker.unsubscribe(bookmarkVisitedHandler);
	do {
		saveJob.join();
	} while (saveJob.getState() != Job.NONE);
}
 
開發者ID:cchabanois,項目名稱:mesfavoris,代碼行數:7,代碼來源:VisitedBookmarksDatabase.java

示例15: close

public void close() {
	bookmarkDatabase.removeListener(bookmarksListener);
	try {
		do {
			job.join();
		} while (job.getState() != Job.NONE);
	} catch (InterruptedException e) {
		// ignore
	}
}
 
開發者ID:cchabanois,項目名稱:mesfavoris,代碼行數:10,代碼來源:BackgroundBookmarksModificationsHandler.java


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