summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rapicault (JBoss)2013-05-02 01:26:47 (EDT)
committerPascal Rapicault2013-05-02 01:26:47 (EDT)
commit72d4d8ad4ca3e370a4fc2812612b67c13ce9919f (patch)
tree48e590ee2323041a537000128585138a56376e51
parent95151949762679fcc359c29c1e96032be9899be8 (diff)
downloadrt.equinox.p2-72d4d8ad4ca3e370a4fc2812612b67c13ce9919f.zip
rt.equinox.p2-72d4d8ad4ca3e370a4fc2812612b67c13ce9919f.tar.gz
rt.equinox.p2-72d4d8ad4ca3e370a4fc2812612b67c13ce9919f.tar.bz2
Improve progress monitorI20130502-0800
-rw-r--r--bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/internal/p2/operations/RemediationResolutionJob.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/p2/operations/RemediationOperation.java14
2 files changed, 12 insertions, 8 deletions
diff --git a/bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/internal/p2/operations/RemediationResolutionJob.java b/bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/internal/p2/operations/RemediationResolutionJob.java
index 873d7ee..1c10d32 100644
--- a/bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/internal/p2/operations/RemediationResolutionJob.java
+++ b/bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/internal/p2/operations/RemediationResolutionJob.java
@@ -32,9 +32,9 @@ public class RemediationResolutionJob extends PlannerResolutionJob {
}
public IStatus runModal(IProgressMonitor monitor) {
- SubMonitor sub = SubMonitor.convert(monitor);
+ SubMonitor sub = SubMonitor.convert(monitor, 2);
try {
- computeRemediationRunnable.run(sub.newChild(500));
+ computeRemediationRunnable.run(sub.newChild(1));
if (requestHolder.length > 0)
this.request = requestHolder[0];
} catch (OperationCanceledException e) {
@@ -43,7 +43,7 @@ public class RemediationResolutionJob extends PlannerResolutionJob {
// ignore, we don't actually throw this in the supplied runnable
}
if (request != null)
- return super.runModal(sub.newChild(500));
+ return super.runModal(sub.newChild(1));
return operation.getResolutionResult();
}
}
diff --git a/bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/p2/operations/RemediationOperation.java b/bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/p2/operations/RemediationOperation.java
index 13fef8a..df1a4e1 100644
--- a/bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/p2/operations/RemediationOperation.java
+++ b/bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/p2/operations/RemediationOperation.java
@@ -85,15 +85,17 @@ public class RemediationOperation extends ProfileChangeOperation {
@Override
protected void computeProfileChangeRequest(MultiStatus status, IProgressMonitor monitor) {
+ SubMonitor sub = SubMonitor.convert(monitor, 1);
if (currentRemedy != null) {
request = currentRemedy.getRequest();
+ sub.worked(1);
return;
}
try {
if (isCheckForUpdates)
- status.add(computeCheckForUpdates(monitor));
+ status.add(computeCheckForUpdates(sub.newChild(1)));
else
- status.add(computeAllRemediations(monitor));
+ status.add(computeAllRemediations(sub.newChild(1)));
} catch (OperationCanceledException e) {
status.add(Status.CANCEL_STATUS);
}
@@ -231,13 +233,15 @@ public class RemediationOperation extends ProfileChangeOperation {
job = new RemediationResolutionJob(getResolveJobName(), session, profileId, request, getFirstPassProvisioningContext(), getSecondPassEvaluator(), noChangeRequest, new IRunnableWithProgress() {
public void run(IProgressMonitor mon) throws OperationCanceledException {
//Weird hack to get progress reporting to do something in the install wizard....
- if (monitor != null)
- mon = monitor;
+ // if (monitor != null)
+ // mon = monitor;
+ SubMonitor sub = SubMonitor.convert(mon, 2);
// We only check for other jobs running if this job is *not* scheduled
if (job.getState() == Job.NONE && session.hasScheduledOperationsFor(profileId)) {
noChangeRequest.add(PlanAnalyzer.getStatus(IStatusCodes.OPERATION_ALREADY_IN_PROGRESS, null));
} else {
- computeProfileChangeRequest(noChangeRequest, mon);
+ sub.worked(1);
+ computeProfileChangeRequest(noChangeRequest, sub.newChild(1));
requestHolder[0] = RemediationOperation.this.request;
}
}