Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/Activator.java13
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clean/CleanRepositoryPage.java11
2 files changed, 14 insertions, 10 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/Activator.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/Activator.java
index 09834a2bca..57a27d36ce 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/Activator.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/Activator.java
@@ -3,6 +3,7 @@
* Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>
* Copyright (C) 2010, Mathias Kinzler <mathias.kinzler@sap.com>
* Copyright (C) 2012, Matthias Sohn <matthias.sohn@sap.com>
+ * Copyright (C) 2015, Philipp Bumann <bumannp@gmail.com>
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -32,7 +33,7 @@ import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.core.runtime.SubMonitor;
import org.eclipse.core.runtime.jobs.ISchedulingRule;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.egit.core.RepositoryCache;
@@ -430,18 +431,20 @@ public class Activator extends AbstractUIPlugin implements DebugOptionsListener
workspace.run(new IWorkspaceRunnable() {
@Override
public void run(IProgressMonitor m) throws CoreException {
- m.beginTask(UIText.Activator_refreshingProjects,
+ SubMonitor subMonitor = SubMonitor.convert(m,
+ UIText.Activator_refreshingProjects,
toRefresh.size());
for (IProject p : toRefresh) {
- if (m.isCanceled()) {
+ if (subMonitor.isCanceled()) {
return;
}
ISchedulingRule rule = p.getWorkspace().getRuleFactory().refreshRule(p);
try {
- getJobManager().beginRule(rule, m);
+ getJobManager().beginRule(rule, subMonitor);
// handle missing projects after branch switch
if (p.isAccessible()) {
- p.refreshLocal(IResource.DEPTH_INFINITE, new SubProgressMonitor(m, 1));
+ p.refreshLocal(IResource.DEPTH_INFINITE,
+ subMonitor.newChild(1));
}
} catch (CoreException e) {
handleError(UIText.Activator_refreshFailed, e, false);
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clean/CleanRepositoryPage.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clean/CleanRepositoryPage.java
index 2b77bb8f19..e9747c2fb4 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clean/CleanRepositoryPage.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clean/CleanRepositoryPage.java
@@ -1,5 +1,6 @@
/*******************************************************************************
* Copyright (C) 2012, Markus Duft <markus.duft@salomon.at>
+ * Copyright (C) 2015, Philipp Bumann <bumannp@gmail.com>
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -16,7 +17,7 @@ import java.util.TreeSet;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.core.runtime.SubMonitor;
import org.eclipse.egit.core.internal.util.ProjectUtil;
import org.eclipse.egit.ui.Activator;
import org.eclipse.egit.ui.internal.UIText;
@@ -258,7 +259,8 @@ public class CleanRepositoryPage extends WizardPage {
@Override
public void run(IProgressMonitor monitor) throws InvocationTargetException,
InterruptedException {
- monitor.beginTask(UIText.CleanRepositoryPage_cleaningItems, IProgressMonitor.UNKNOWN);
+ SubMonitor subMonitor = SubMonitor.convert(monitor,
+ UIText.CleanRepositoryPage_cleaningItems, 1);
Git git = Git.wrap(repository);
CleanCommand command = git.clean().setDryRun(false);
@@ -273,12 +275,11 @@ public class CleanRepositoryPage extends WizardPage {
try {
IProject[] projects = ProjectUtil.getProjectsContaining(repository, itemsToClean);
- ProjectUtil.refreshResources(projects, new SubProgressMonitor(monitor, 1));
+ ProjectUtil.refreshResources(projects,
+ subMonitor.newChild(1));
} catch (CoreException e) {
// could not refresh... not a "real" problem
}
-
- monitor.done();
}
});
} catch (Exception e) {

Back to the top