Class XViewerUIJob

java.lang.Object
org.eclipse.core.runtime.PlatformObject
org.eclipse.core.internal.jobs.InternalJob
org.eclipse.core.runtime.jobs.Job
org.eclipse.nebula.widgets.xviewer.util.internal.XViewerUIJob
All Implemented Interfaces:
java.lang.Comparable, org.eclipse.core.runtime.IAdaptable
Direct Known Subclasses:
XViewerWorkbenchJob

public abstract class XViewerUIJob
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

    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

    manager
  • Constructor Summary

    Constructors 
    Constructor Description
    XViewerUIJob​(java.lang.String name)
    Create a new instance of the receiver with the supplied name.
    XViewerUIJob​(org.eclipse.swt.widgets.Display jobDisplay, java.lang.String name)
    Create a new instance of the receiver with the supplied Display.
  • Method Summary

    Modifier and Type Method Description
    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)  
    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, canceling, create, create, 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, yieldRule

    Methods inherited from class org.eclipse.core.internal.jobs.InternalJob

    compareTo

    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
  • Constructor Details

    • XViewerUIJob

      public XViewerUIJob​(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 their display at runtime.
      Parameters:
      name - the job name
    • XViewerUIJob

      public XViewerUIJob​(org.eclipse.swt.widgets.Display jobDisplay, java.lang.String name)
      Create a new instance of the receiver with the supplied Display.
      Parameters:
      jobDisplay - the display
      name - the job name
      See Also:
      Job
  • Method Details

    • errorStatus

      public static org.eclipse.core.runtime.IStatus errorStatus​(java.lang.Throwable exception)
      Convenience method to return a status for an exception.
      Parameters:
      exception -
      Returns:
      IStatus an error status built from the exception
      See Also:
      Job
    • run

      public final org.eclipse.core.runtime.IStatus run​(org.eclipse.core.runtime.IProgressMonitor monitor)
      Specified by:
      run in class org.eclipse.core.runtime.jobs.Job
      See Also:
      Note: this message is marked final. Implementors should use runInUIThread() instead.
    • runInUIThread

      public abstract org.eclipse.core.runtime.IStatus runInUIThread​(org.eclipse.core.runtime.IProgressMonitor monitor)
      Run the job in the UI Thread.
      Parameters:
      monitor -
      Returns:
      IStatus
    • 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 available via PlatformUI.isWorkbenchRunning().
      Parameters:
      runDisplay - Display
      See Also:
      getDisplay(), 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.
      Returns:
      Display or null.