public abstract class UIJob extends Job
Constructor and Description |
---|
UIJob(Display jobDisplay,
String name)
Create a new instance of the receiver with the supplied Display.
|
UIJob(String name)
Create a new instance of the receiver with the supplied name.
|
Modifier and Type | Method and Description |
---|---|
static IStatus |
errorStatus(Throwable exception)
Convenience method to return a status for an exception.
|
Display |
getDisplay()
Returns the display for use by the receiver when running in an
asyncExec.
|
IStatus |
run(IProgressMonitor monitor)
Executes this job.
|
abstract IStatus |
runInUIThread(IProgressMonitor monitor)
Run the job in the UI Thread.
|
void |
setDisplay(Display runDisplay)
Sets the display to execute the asyncExec in.
|
addJobChangeListener, belongsTo, cancel, canceling, create, done, getJobManager, getName, getPriority, getProperty, getResult, getRule, getState, getThread, isBlocking, isSystem, isUser, join, removeJobChangeListener, schedule, schedule, setName, setPriority, setProgressGroup, setProperty, setRule, setSystem, setThread, setUser, shouldRun, shouldSchedule, sleep, toString, wakeUp, wakeUp, yieldRule
getAdapter
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getAdapter
public UIJob(String name)
name
- the job namepublic static IStatus errorStatus(Throwable exception)
exception
- Job
public final IStatus run(IProgressMonitor monitor)
Job
The provided monitor can be used to report progress and respond to
cancellation. If the progress monitor has been canceled, the job
should finish its execution at the earliest convenience and return a result
status of severity IStatus.CANCEL
. The singleton
cancel status Status.CANCEL_STATUS
can be used for
this purpose. The monitor is only valid for the duration of the invocation
of this method.
This method must not be called directly by clients. Clients should call
schedule
, which will in turn cause this method to be called.
Jobs can optionally finish their execution asynchronously (in another thread) by
returning a result status of Job.ASYNC_FINISH
. Jobs that finish
asynchronously must specify the execution thread by calling
setThread
, and must indicate when they are finished by calling
the method done
.
run
in class Job
monitor
- the monitor to be used for reporting progress and
responding to cancelation. The monitor is never null
null
Note: this message is marked final. Implementors should use
runInUIThread() instead.
public abstract IStatus runInUIThread(IProgressMonitor monitor)
monitor
- public void setDisplay(Display runDisplay)
runDisplay
- DisplaygetDisplay()
,
PlatformUI.isWorkbenchRunning()
public Display getDisplay()
null
.
Copyright (c) 2000, 2014 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.