Revision 105e5489
Added by Katja Luther almost 6 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/util/ProgressMonitorClientManager.java | ||
---|---|---|
14 | 14 |
import java.util.UUID; |
15 | 15 |
|
16 | 16 |
import org.apache.log4j.Logger; |
17 |
import org.eclipse.core.runtime.IProgressMonitor;
|
|
17 |
import org.eclipse.core.runtime.SubMonitor;
|
|
18 | 18 |
|
19 | 19 |
import eu.etaxonomy.cdm.api.application.CdmApplicationState; |
20 | 20 |
import eu.etaxonomy.cdm.api.service.IProgressMonitorService; |
... | ... | |
54 | 54 |
final int pollInterval, |
55 | 55 |
final IPostMoniteredOperationEnabled postOp, |
56 | 56 |
IFeedbackGenerator feedbackGenerator, |
57 |
IProgressMonitor monitor) throws InterruptedException {
|
|
57 |
SubMonitor monitor) throws InterruptedException {
|
|
58 | 58 |
return pollMonitor(label, uuid, pollInterval, postOp, Arrays.asList(feedbackGenerator), monitor); |
59 | 59 |
} |
60 | 60 |
/** |
... | ... | |
79 | 79 |
final int pollInterval, |
80 | 80 |
final IPostMoniteredOperationEnabled postOp, |
81 | 81 |
List<IFeedbackGenerator> feedbackGenerators, |
82 |
IProgressMonitor monitor) throws InterruptedException {
|
|
82 |
SubMonitor monitor) throws InterruptedException {
|
|
83 | 83 |
IProgressMonitorService progressMonitorService = CdmApplicationState.getCurrentAppConfig().getProgressMonitorService(); |
84 | 84 |
IRemotingProgressMonitor remotingMonitor = progressMonitorService.getRemotingMonitor(uuid); |
85 | 85 |
try { |
... | ... | |
121 | 121 |
|
122 | 122 |
} |
123 | 123 |
// start the client monitor |
124 |
monitor.beginTask(label, remotingMonitor.getTotalWork()); |
|
124 |
// monitor.subTask(remotingMonitor.getTaskName()); |
|
125 |
monitor.beginTask(remotingMonitor.getTaskName(), remotingMonitor.getTotalWork()); |
|
125 | 126 |
logger.info("Work to be done: " + remotingMonitor.getTotalWork()); |
126 | 127 |
int editorTotalWorkDone = 0; |
127 | 128 |
int serverTotalWorkDone = 0; |
... | ... | |
161 | 162 |
|
162 | 163 |
// set dialog text |
163 | 164 |
monitor.setTaskName(label + " " + percentage + "% done "); |
164 |
|
|
165 | 165 |
monitor.subTask(remotingMonitor.getSubTask()); |
166 |
// monitor.setWorkRemaining((int) (remotingMonitor.getTotalWork()-remotingMonitor.getWorkDone())); |
|
167 |
// monitor.subTask(remotingMonitor.getSubTask(), remotingMonitor.getWorkDone()); |
|
166 | 168 |
int worked = 0; |
167 |
if (serverTotalWorkDone!=editorTotalWorkDone){
|
|
169 |
if (serverTotalWorkDone > editorTotalWorkDone){
|
|
168 | 170 |
worked = serverTotalWorkDone - editorTotalWorkDone; |
169 | 171 |
} |
170 | 172 |
if(worked > 0) { |
Also available in: Unified diff
use submonitor for progressmmonitor in longrunning tasks