|
|
|
|
|
Re: Long running wizard process [message #467480 is a reply to message #467460] |
Tue, 31 January 2006 20:29 |
Eclipse User |
|
|
|
Originally posted by: pawcio.nonexistent.pl
Konstantin Komissarchik napisał(a):
> Does anyone have any ideas how to free up the UI thread while my process is
> running, while still not dismissing the wizard dialog until the process is
> complete?
Use WizardDialog built-in functionality. There is the thread about it on
eclipse.platform group:
Subject: ProgressMonitor in a Wizard
Date: Sun, 22 Jan 2006 14:29:21 +0100
Message-ID: <dr01b8$n24$1@utils.eclipse.org>
- pw
|
|
|
|
|
Re: Long running wizard process [message #467502 is a reply to message #467482] |
Wed, 01 February 2006 08:04 |
Eclipse User |
|
|
|
Originally posted by: pwalczak.opi.org.pl
Konstantin Komissarchik napisał(a):
> Could you forward me that thread? I don't have local history going that far
> back and eclipse.org archives only go back as far as 01/23.
My post from that thread (give attention to the fist argument of the
run() method - it tells if the runnable should be run in a separate
thread):
> Nick napisał(a):
>
>> hi everybody,
>>
>> can anybody give me a hint how to use the progress monitor
>> in a wizard? are there any tutorials?
>
>
> public class WizardTest extends Wizard {
>
> public WizardTest() {
> this.setNeedsProgressMonitor(true);
> }
>
> public boolean performFinish() {
>
> try {
> getContainer().run(true, false,
> new IRunnableWithProgress() {
>
> public void run(IProgressMonitor monitor)
> throws InvocationTargetException,
> InterruptedException {
>
> monitor.beginTask("Enything. ", 100);
> for (int i = 0; i < 100; ++i) {
> Thread.sleep(100);
> monitor.subTask("Performing task "
> + (i + 1) + ". ");
> monitor.worked(1);
> }
> monitor.done();
>
> }
> });
> } catch (InvocationTargetException e) {
> // TODO Auto-generated catch block
> e.printStackTrace();
> } catch (InterruptedException e) {
> // TODO Auto-generated catch block
> e.printStackTrace();
> }
>
> return true;
> }
> }
|
|
|
|
Re: Long running wizard process [message #467509 is a reply to message #467506] |
Wed, 01 February 2006 09:09 |
Eclipse User |
|
|
|
Originally posted by: pwalczak.opi.org.pl
Alex Blewitt napisał(a):
> That wouldn't solve the problem; the wizard would still disappear after the thread is launched and the performFinish() method returns, wouldn't it?
Did I miss something? The point is to perform lengthy operatation after
wizard Finish button has been clicked, right? What I showed is - I
believe - typical way to do that. The wizard dialog will not disappear
until a job is finished. Otherwise the presense of the progress bar in
the wizard dialog would not have any sense.
- pw
|
|
|
|
Powered by
FUDForum. Page generated in 0.04814 seconds