Vivek
Vivek

Reputation: 11

Control the progress bar using Jobs

I am trying to update the progress bar in my GUI using the IProgressMonitor, which is passed to the run method of job. But i am not able to do the same. Has anyone tried that.

Also i read job.setUser(true); method displays the progress, can anyone help me with the code for the same

Upvotes: 0

Views: 618

Answers (1)

Shashwat
Shashwat

Reputation: 2352

I was also requiring a similar type of feature in which if any job runs in the application then I want to show the progress of that job.

So in my Eclipse 4 application, I added the trim bar and tool control inside it. In which I added the progress bar in it UI.

By adding the below code done the trick

Job.getJobManager().setProgressProvider(new ProgressProvider() {
        @Override
        public IProgressMonitor createMonitor(Job job) {
            return monitor.addJob(job);
        }
    });

Upvotes: 1

Related Questions