[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [riena-dev] UI Job with Progress from Handler?
|
Hi Todd,
I'm not terribly familiar with the UIProgress / UIJob stuff. Hopefully somebody else from the team can help.
In RCP one way to show progress is this: (assuming a Handler)
public Object execute(ExecutionEvent event) throws ExecutionException {
IRunnableWithProgress op = new IRunnableWithProgress() {
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
monitor.beginTask("Working", 60);
try {
for (int i = 60; i > 0; i--) {
if (monitor.isCanceled()) {
break;
}
Thread.sleep(500); // do some work here
monitor.worked(1);
}
} finally {
monitor.done();
}
}
};
try {
IProgressService ps = PlatformUI.getWorkbench().getProgressService();
ps.run(true, true, op);
} catch (Exception e1) {
e1.printStackTrace();
}
return null;
}
IProgressService has a few more methods than could be useful.
Kind regards,
Elias.
On Thu, Apr 30, 2009 at 6:40 AM, Todd Lee
<Todd.Lee@xxxxxxxxxx> wrote:
Hi there,
I’m trying to run a job from a Handler (extends
AbstractHandler) and, while the job does run without error, I’m not
seeing any progress (either statusline or dialog etc…)
I’ve tried running it as both a regular eclipse Job
and a UIJob, but still no progress. I see in the UIProcess sample of the
example client that the jobs are run from a view controller and make use of the
getNavigatorNode() call to set a property. Is there someway that I can still
get the progress updates without running from a view controller?
Thanks
Todd
Todd Lee
Member
of Technical Staff
Software
Tools Development
Medical
Division
ON
Semiconductor
todd.lee@xxxxxxxxxx
+1
519 884-9696 ext. 2242
http://onsemi.com
_______________________________________________
riena-dev mailing list
riena-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/riena-dev
--
Elias Volanakis | Technical Lead | EclipseSource Portland
elias@xxxxxxxxxxxxxxxxx | +1 503 929 5537 |
http://eclipsesource.com