Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.eclipse.ui.progress
Class UIJob  view UIJob download UIJob.java

java.lang.Object
  extended byorg.eclipse.core.runtime.PlatformObject
      extended byorg.eclipse.core.internal.jobs.InternalJob
          extended byorg.eclipse.core.runtime.jobs.Job
              extended byorg.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

Field Summary
private  org.eclipse.swt.widgets.Display cachedDisplay
           
 
Fields inherited from class org.eclipse.core.runtime.jobs.Job
ASYNC_FINISH, BUILD, DECORATE, INTERACTIVE, LONG, NONE, RUNNING, SHORT, SLEEPING, WAITING
 
Fields inherited from class org.eclipse.core.internal.jobs.InternalJob
 
Constructor Summary
UIJob(org.eclipse.swt.widgets.Display jobDisplay, java.lang.String name)
          Create a new instance of the receiver with the supplied Display.
UIJob(java.lang.String name)
          Create a new instance of the receiver with the supplied name.
 
Method Summary
static org.eclipse.core.runtime.IStatus errorStatus(java.lang.Throwable exception)
          Convenience method to return a status for an exception.
 org.eclipse.swt.widgets.Display getDisplay()
          Returns the display for use by the receiver when running in an asyncExec.
 org.eclipse.core.runtime.IStatus run(org.eclipse.core.runtime.IProgressMonitor monitor)
          Executes this job.
abstract  org.eclipse.core.runtime.IStatus runInUIThread(org.eclipse.core.runtime.IProgressMonitor monitor)
          Run the job in the UI Thread.
 void setDisplay(org.eclipse.swt.widgets.Display runDisplay)
          Sets the display to execute the asyncExec in.
 
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
 
Methods inherited from class org.eclipse.core.internal.jobs.InternalJob
compareTo, toString
 
Methods inherited from class org.eclipse.core.runtime.PlatformObject
getAdapter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 

Field Detail

cachedDisplay

private org.eclipse.swt.widgets.Display cachedDisplay
Constructor Detail

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.

Method Detail

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.