Package org.eclipse.ui.progress
Class UIJob
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:
- Comparable<org.eclipse.core.internal.jobs.InternalJob>,- IAdaptable
- Direct Known Subclasses:
- WorkbenchJob
The UIJob is a Job that runs within the UI Thread via an asyncExec.
- Since:
- 3.0
- 
Field SummaryFields inherited from class org.eclipse.core.runtime.jobs.JobASYNC_FINISH, BUILD, DECORATE, INTERACTIVE, LONG, NONE, RUNNING, SHORT, SLEEPING, WAITINGFields inherited from class org.eclipse.core.internal.jobs.InternalJobmanager
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic UIJobcreate(String name, ICoreRunnable runnable) Creates a new UIJob that will execute the provided runnable in the UI thread when it runs.static UIJobcreate(String name, IJobFunction function) Creates a new UIJob that will execute the provided function in the UI thread when it runs.static IStatuserrorStatus(Throwable exception) Convenience method to return a status for an exception.Returns the display for use by the receiver when running in an asyncExec.final IStatusrun(IProgressMonitor monitor) Note: this message is marked final.abstract IStatusrunInUIThread(IProgressMonitor monitor) Run the job in the UI Thread.voidsetDisplay(Display runDisplay) Sets the display to execute the asyncExec in.Methods inherited from class org.eclipse.core.runtime.jobs.JobaddJobChangeListener, belongsTo, cancel, canceling, createSystem, createSystem, done, getJobGroup, getJobManager, getName, getPriority, getProperty, getResult, getRule, getState, getThread, isBlocking, isSystem, isUser, join, join, removeJobChangeListener, schedule, schedule, setJobGroup, setName, setPriority, setProgressGroup, setProperty, setRule, setSystem, setThread, setUser, shouldRun, shouldSchedule, sleep, toString, wakeUp, wakeUp, yieldRuleMethods inherited from class org.eclipse.core.internal.jobs.InternalJobcompareToMethods inherited from class org.eclipse.core.runtime.PlatformObjectgetAdapter
- 
Constructor Details- 
UIJobCreate 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 their display at runtime.- Parameters:
- name- the job name
 
- 
UIJobCreate a new instance of the receiver with the supplied Display.- Parameters:
- jobDisplay- the display
- name- the job name
- See Also:
 
 
- 
- 
Method Details- 
createCreates a new UIJob that will execute the provided function in the UI thread when it runs. Prefer usingcreate(String, ICoreRunnable).- Parameters:
- name- The name of the job
- function- The function to execute
- Returns:
- A UIJob that encapsulates the provided function
- Since:
- 3.127
- See Also:
 
- 
createCreates a new UIJob that will execute the provided runnable in the UI thread when it runs.- Parameters:
- name- the name of the job
- runnable- the runnable to execute
- Returns:
- a UIJob that encapsulates the provided runnable
- Since:
- 3.127
- See Also:
 
- 
errorStatusConvenience method to return a status for an exception.- Parameters:
- exception- the thrown exception
- Returns:
- IStatus an error status built from the exception
- See Also:
 
- 
runNote: this message is marked final. Implementors should use runInUIThread() instead.
- 
runInUIThreadRun the job in the UI Thread.- Parameters:
- monitor- the monitor to be used for reporting progress and responding to cancellation. The monitor is never- null
- Returns:
- resulting status of the run. The result must not be null
 
- 
setDisplaySets the display to execute the asyncExec in. Generally this is not' used if there is a valid display available via PlatformUI.isWorkbenchRunning().- Parameters:
- runDisplay- Display
- See Also:
 
- 
getDisplayReturns 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.- Returns:
- Display or null.
 
 
-