Job can run in background - option [message #118605] |
Mon, 21 November 2005 03:56 |
Eclipse User |
|
|
|
Originally posted by: dheepuks.yahoo.co.in
Hi ,
i have written a code in such a way that some methods are called
inside a progress monitor. it monitors the process but it just displays
the progressbar and user is not given a chance to do other process. i need
my job to run in as a background process without disturbing the current
thread process.
Thanks in advance,
Note:
final IRunnableWithProgress op = new IRunnableWithProgress() {
public void run(IProgressMonitor monitor) throws InvocationTargetException
{
try {
// task is started
monitor.beginTask("ExecutingOperation"), 100);
for (int total = 0; total < 100 && !monitor.isCanceled(); total += 50) {
Thread.sleep(50);
monitor.worked(50);
}
executeMethod1();
executeMethod2();
} } catch (Throwable e) {
e.printStackTrace();
}
monitor.done();
}
};
try {
new ProgressMonitorDialog(null).run(false, false, op);
}
catch (InterruptedException e) {
System.out.println(e);
}
catch (InvocationTargetException e) {
return;
}
}
Task #1 : i need run in background,cancel,details option in a dialog box.
so please answer me with relevant code for the above said aspect.
Thanks,
Dheepu
|
|
|
Powered by
FUDForum. Page generated in 0.08061 seconds