Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-ui-dev] Assigning a ProgressMonitor to a Job

I'm not sure I understand the question, but a progress monitor instance is provided to the Job's run method by the framework. Your job just needs to use that monitor. You don't need to create or pass in your own monitor. If you want a job that shows progress in a dialog by default, along with a "run in background" button, you just need to call Job.setUser(true) before you schedule it. You shouldn't need to implement a custom dialog for this - just schedule the import job when the wizard closes, and if it is a user job it will present its own dialog automatically (unless user has said "always run in background").

John




From:        Mickael Istria <mistria@xxxxxxxxxx>
To:        platform-ui-dev@xxxxxxxxxxx
Date:        05/05/2015 06:27 AM
Subject:        [platform-ui-dev] Assigning a ProgressMonitor to a Job
Sent by:        platform-ui-dev-bounces@xxxxxxxxxxx




Hi all,

I'm working on implementing a dedicated report dialog for a long running job (
https://wiki.eclipse.org/E4/UI/Smart_Import ). I'd like this dialog to have a ProgressMonitor, just like the Wizard Dialog can have, in order to report job execution progress.
However, the job can be detached (there would be a "Run In Background" button), so if I understand correctly it's still necessary to have it implementing Job rather than IRunnableWithContext. However, I don't get how to specify to the job which progress monitor to use, or specify to the progress monitor which job to monitor.
Is this possible? Do you have a hint?

Cheers,

--
Mickael Istria
Eclipse developer at
JBoss, by Red Hat
My blog - My Tweets_______________________________________________
platform-ui-dev mailing list
platform-ui-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/platform-ui-dev

Back to the top