interesting, as an alternative to the ProgressMonitorDialog you perhaps call commit() from the eclipse Job api. This produces a ProgressMonitor. The Job can be setUser() so this would also show a dialog, and as a bonus it can run in background, so no UI blocking.
just a thought.
Christophe
But I keep getting an "[ERROR] Invalid thread access" error.
Any ideas on this?
Maybe, you could post the stack trace. It is not clear how that is possible as the code is triggered from the ui thread (DIsplay.syncExec)...
Do you have a commit listener that executes outside the ui thread?
You are using the ProgressMonitorDialog wrong! To run the operation you do
ProgressMonitorDialog d = new ProgressMonitorDialog();
d.run(true,false,new IRunnableWithProgress() {
//....
});
Tom
Am 17.01.13 17:49, schrieb Joao S:
> Hello everyone,
>
> I am trying to show a progress monitor during commits however , I can´t
> find a way of making this work ok.
>
> Does anyone has any experience on this?
>
> I tried something like this:
>
> final ProgressMonitorDialog progressMonitor = new
> ProgressMonitorDialog(
> getShell());
>
> Display.getDefault().syncExec(new Runnable() {
> public void run() {
> progressMonitor.open();
> try {
>
> transaction.commit(progressMonitor.getProgressMonitor());
> } catch (CommitException e) {
> e.printStackTrace();
> }
> progressMonitor.close();
> }
> });
>
>
> But I keep getting an "[ERROR] Invalid thread access" error.
> Any ideas on this?
>
> Thanks in advance,
> João
>
>
BTW: eclipse (3.x) has a IProgressService which should be used instead:
Thanks for the hint!
Quote:
interesting, as an alternative to the ProgressMonitorDialog you perhaps call commit() from the eclipse Job api.
Yes, I will definitely do that =)
Quote:
You are using the ProgressMonitorDialog wrong! To run the operation you do
ProgressMonitorDialog d = new ProgressMonitorDialog();
d.run(true,false,new IRunnableWithProgress() {
//....
});
Yes, you are totaly right. It is working fine now!
One other thing, is it possible to get a little bit more of information in the progress dialog besides de progress bar? Tasks description, maybe subtasks, etc..
Am 22.01.2013 11:41, schrieb Joao S:
> One other thing, is it possible to get a little bit more of information in the progress dialog besides de progress
> bar? Tasks description, maybe subtasks, etc..
Generally yes. But in the context of a commit(monitor) call we must transport all monitoring-relevant information over
the network. I never considered it that important (compared to the induced performance and bandwidth issues).
Generally yes. But in the context of a commit(monitor) call we must transport all monitoring-relevant information over
the network. I never considered it that important (compared to the induced performance and bandwidth issues).