java.lang.Object
org.eclipse.core.runtime.PlatformObject
org.eclipse.core.internal.jobs.InternalJob
org.eclipse.core.runtime.jobs.Job
org.eclipse.ui.progress.UIJob
- All Implemented Interfaces:
- java.lang.Comparable, org.eclipse.core.runtime.IAdaptable
- Direct Known Subclasses:
- WorkbenchJob
- public abstract class UIJob
- extends org.eclipse.core.runtime.jobs.Job
The UIJob is a Job that runs within the UI Thread via an asyncExec.
- Since:
- 3.0
| Fields inherited from class org.eclipse.core.internal.jobs.InternalJob |
|
| Methods inherited from class org.eclipse.core.runtime.jobs.Job |
addJobChangeListener, belongsTo, cancel, done, 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, wakeUp, wakeUp |
cachedDisplay
private org.eclipse.swt.widgets.Display cachedDisplay
UIJob
public UIJob(java.lang.String name)
- Create a new instance of the receiver with the supplied name. The display
used will be the one from the workbench if this is available. UIJobs with
this constructor will determine thier display at runtime.
UIJob
public UIJob(org.eclipse.swt.widgets.Display jobDisplay,
java.lang.String name)
- Create a new instance of the receiver with the supplied Display.
errorStatus
public static org.eclipse.core.runtime.IStatus errorStatus(java.lang.Throwable exception)
- Convenience method to return a status for an exception.
run
public final org.eclipse.core.runtime.IStatus run(org.eclipse.core.runtime.IProgressMonitor monitor)
- Description copied from class:
org.eclipse.core.runtime.jobs.Job
- Executes this job. Returns the result of the execution.
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.
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.
runInUIThread
public abstract org.eclipse.core.runtime.IStatus runInUIThread(org.eclipse.core.runtime.IProgressMonitor monitor)
- Run the job in the UI Thread.
setDisplay
public void setDisplay(org.eclipse.swt.widgets.Display runDisplay)
- Sets the display to execute the asyncExec in. Generally this is not'
used if there is a valid display avaialble via PlatformUI.isWorkbenchRunning().
getDisplay
public org.eclipse.swt.widgets.Display getDisplay()
- Returns the display for use by the receiver when running in an
asyncExec. If it is not set then the display set in the workbench
is used.
If the display is null the job will not be run.