Class BasicUIJob

All Implemented Interfaces:
Comparable<>, IAdaptable

public abstract class BasicUIJob extends Job
Merge of UIJob and WokbenchJob minus tracking whether the workbench is running - do not use for long running jobs!
  • Constructor Details

    • BasicUIJob

      public BasicUIJob(String name, Display display)
      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 their display at runtime.
      name - the job name
  • Method Details

    • run

      public final IStatus run(IProgressMonitor monitor)
      Description copied from class: 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 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.

      Specified by:
      run in class Job
      monitor - the monitor to be used for reporting progress and responding to cancelation. The monitor is never null
      resulting status of the run. The result must not be null
      See Also:
    • runInUIThread

      public abstract IStatus runInUIThread(IProgressMonitor monitor)
      Run the job in the UI Thread.
    • getDisplay

      public 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.
      Display or null.