Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 


Eclipse Platform
Release 3.5

org.eclipse.ui.progress
Class UIJob


java.lang.Object
  extended by 

org.eclipse.core.runtime.PlatformObject
      extended by org.eclipse.core.internal.jobs.InternalJob
          extended by 

org.eclipse.core.runtime.jobs.Job
              extended by 
org.eclipse.ui.progress.UIJob
All Implemented Interfaces:
Comparable, IAdaptable
Direct Known Subclasses:
WorkbenchJob

public abstract class UIJob
extends 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
UIJob ( Display jobDisplay, String name)
          Create a new instance of the receiver with the supplied Display.
UIJob ( String name)
          Create a new instance of the receiver with the supplied name.
 
Method Summary
static  IStatus errorStatus ( Throwable exception)
          Convenience method to return a status for an exception.
  Display getDisplay ()
          Returns the display for use by the receiver when running in an asyncExec.
  IStatus run ( IProgressMonitor monitor)
          Executes this job.
abstract   IStatus runInUIThread ( IProgressMonitor monitor)
          Run the job in the UI Thread.
 void setDisplay ( Display runDisplay)
          Sets the display to execute the asyncExec in.
 
Methods inherited from class org.eclipse.core.runtime.jobs. Job
addJobChangeListener, belongsTo, cancel, canceling, done, getJobManager, 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
 

Constructor Detail

UIJob

public UIJob(
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

UIJob

public UIJob(
Display jobDisplay,
             
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 Detail

errorStatus

public static 
IStatus errorStatus(
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 
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
Parameters:
monitor - the monitor to be used for reporting progress and responding to cancelation. The monitor is never null
Returns:
resulting status of the run. The result must not be null
See Also:
Note: this message is marked final. Implementors should use runInUIThread() instead.

runInUIThread

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

Parameters:
monitor -
Returns:
IStatus

setDisplay

public void setDisplay(
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 
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.

Eclipse Platform
Release 3.5

Guidelines for using Eclipse APIs.

Copyright (c) Eclipse contributors and others 2000, 2008. All rights reserved.


 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire