本文整理匯總了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;
}
示例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);
}
示例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());
}
示例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());
}
示例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();
}
}
}
示例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;
}
示例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);
}
}
示例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;
}
示例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();
}
}
示例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);
}
示例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();
}
}
示例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);
}
示例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);
}
}
示例14: close
public void close() throws InterruptedException {
bookmarkDatabase.removeListener(bookmarksListener);
eventBroker.unsubscribe(bookmarkVisitedHandler);
do {
saveJob.join();
} while (saveJob.getState() != Job.NONE);
}
示例15: close
public void close() {
bookmarkDatabase.removeListener(bookmarksListener);
try {
do {
job.join();
} while (job.getState() != Job.NONE);
} catch (InterruptedException e) {
// ignore
}
}