diff options
Diffstat (limited to 'bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/InfiniteSubProgressMonitor.java')
-rw-r--r-- | bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/InfiniteSubProgressMonitor.java | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/InfiniteSubProgressMonitor.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/InfiniteSubProgressMonitor.java index cac0c4f78..60347be34 100644 --- a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/InfiniteSubProgressMonitor.java +++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/InfiniteSubProgressMonitor.java @@ -10,20 +10,20 @@ *******************************************************************************/ package org.eclipse.team.internal.core; - + import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.SubProgressMonitor; /** * Provides an infinite progress monitor by subdividing by half repeatedly. - * + * * The ticks parameter represents the number of ticks shown in the progress dialog * (or propogated up to a parent IProgressMonitor). The totalWork parameter provided * in actually a hint used to determine how work is translated into ticks. * The number of totalWork that can actually be worked is n*totalWork/2 where * 2^n = totalWork. What this means is that if you provide a totalWork of 32 (2^5) than * the maximum number of ticks is 5*32/2 = 80. - * + * */ public class InfiniteSubProgressMonitor extends SubProgressMonitor { @@ -32,7 +32,7 @@ public class InfiniteSubProgressMonitor extends SubProgressMonitor { int currentIncrement; int nextProgress; int worked; - + /** * Constructor for InfiniteSubProgressMonitor. * @param monitor @@ -51,7 +51,7 @@ public class InfiniteSubProgressMonitor extends SubProgressMonitor { public InfiniteSubProgressMonitor(IProgressMonitor monitor, int ticks, int style) { super(monitor, ticks, style); } - + public void beginTask(String name, int totalWork) { super.beginTask(name, totalWork); this.totalWork = totalWork; @@ -60,7 +60,7 @@ public class InfiniteSubProgressMonitor extends SubProgressMonitor { this.nextProgress = currentIncrement; this.worked = 0; } - + public void worked(int work) { if (worked >= totalWork) return; if (--nextProgress <= 0) { @@ -70,17 +70,17 @@ public class InfiniteSubProgressMonitor extends SubProgressMonitor { // we have passed the current halfway point, so double the // increment and reset the halfway point. currentIncrement *= 2; - halfWay += (totalWork - halfWay) / 2; + halfWay += (totalWork - halfWay) / 2; } // reset the progress counter to another full increment nextProgress = currentIncrement; - } + } } /** * Don't allow clearing of the subtask. This will stop the flickering * of the subtask in the progress dialogs. - * + * * @see IProgressMonitor#subTask(String) */ public void subTask(String name) { |