Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-team-dev] Re: [platform-cvs-dev] job

> has any information let me more clear of the work flow to create a / 
some 
> job(s) then automatic display task report progress in progress view?

Have a look at the presentation I gave at EclipseCon. 

http://www.eclipsecon.org/EclipseCon_2004_TechnicalTrackPresentations/39_Arthorne-Lemieux.pdf
 
> where/how to keep the new job(s) are created?

The progress view listens to job events and displays the jobs to the 
user. All you have to do to get a job in the progress view is to create
a job that is marked as non-system.

Job job = new Job("Doing something long running") {
  public IStatus run(IProgressMonitor monitor) {
    try {
      monitor.beginTask("Checkout from CVS");
      checkout.run(monitor);
      return Status.OK_STATUS;
    finally {
      monitor.done();
     } catch(CVSException e) {
       return new CVSStatus(IStatus.ERROR, code, "problems checking out", 
e);
     }
  }
};

// Set the icon to associate with this job
job.setProperty(IProgressConstants.ICON_PROPERTY, myIcon);

// Set that the job should be keeped when finished
job.setProperty(IProgressConstants.KEEP_PROPERTY, Boolean.TRUE);

// It is a user invoked job and should use the default progress monitor 
dialog
job.setUser(true);

// Should be shown in the progress view
job.setSystem(false);

// Run it now
job.schedule();

> how progress view detect new job(s) immediately?

It's a job change listener and registered via the 
Platform.getJobManager().addJobChangeListener() method.

> what different between UIJob and job and workbenchjob?

UIJobs provide a runInUIThread() method and the run() is final. As the 
name implies, this is
meant to run something in the UI thread. Note that you should never use a 
UIJob to run anything
long running. The difference between a UIJob and a simple 
Display.asyncExec(Runnable) is that
with a UIJob you can schedule and it is useful for batching UI updates. 
The workbenchJob is a 
UI job that provides protection for not running the job when the workbench 
is closing.

> 
> thanks...
> 
> _________________________________________________________________
> Using a handphone prepaid card? Reload your credit online! 
> http://www.msn.com.my/reloadredir/default.asp
> 
> _______________________________________________
> platform-cvs-dev mailing list
> platform-cvs-dev@xxxxxxxxxxx
> http://dev.eclipse.org/mailman/listinfo/platform-cvs-dev



Back to the top