Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarsten Thoms2018-02-20 21:23:39 +0000
committerKarsten Thoms2018-03-09 18:40:18 +0000
commitc31121089f93fec170f2944482a4b0ea446d48e4 (patch)
tree539f49ff53040aba299d94695958561feaef7618
parentcc763a549b44c68e8e7bc57a9a398407a44b696b (diff)
downloadeclipse.platform.team-c31121089f93fec170f2944482a4b0ea446d48e4.tar.gz
eclipse.platform.team-c31121089f93fec170f2944482a4b0ea446d48e4.tar.xz
eclipse.platform.team-c31121089f93fec170f2944482a4b0ea446d48e4.zip
Bug 531433 - Replace usage of SubProgressMonitor by SubMonitorI20180311-2000I20180310-1500I20180309-2000
Change-Id: I68e635f60614b9a923c8c848c17115b6e9275a30 Signed-off-by: Karsten Thoms <karsten.thoms@itemis.de>
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/AddFromHistoryAction.java4
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/Patcher.java10
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/WorkspacePatcher.java8
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/StructureDiffViewer.java12
-rw-r--r--bundles/org.eclipse.jsch.core/src/org/eclipse/jsch/internal/core/Policy.java4
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/Policy.java4
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSProjectSetCapability.java6
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/Policy.java4
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/filehistory/CVSFileHistory.java12
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/filesystem/CVSFileSystem.java4
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/filesystem/RemoteLogger.java4
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSCompareEditorInput.java4
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSHistoryPage.java4
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSProjectSetSerializer.java6
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/Policy.java4
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/WorkspaceAction.java4
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/TagInRepositoryOperation.java4
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/Policy.java4
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/RemoveSynchronizeParticipantAction.java4
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/patch/ApplyPatchSynchronizationWizard.java4
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ProjectSetExportWizard.java6
-rw-r--r--examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/XMLStructureViewer.java4
-rw-r--r--examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/FileSystemOperations.java16
-rw-r--r--examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/FileSystemOperation.java4
-rw-r--r--examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/NonSyncModelMergeOperation.java6
-rw-r--r--examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/localhistory/RevertAllOperation.java6
-rw-r--r--examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/mapping/ModResourceMapping.java10
-rw-r--r--examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/mapping/ModelMerger.java10
-rw-r--r--examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ui/NewModelProjectWizard.java6
29 files changed, 89 insertions, 89 deletions
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/AddFromHistoryAction.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/AddFromHistoryAction.java
index 1e96f9e42..63a412631 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/AddFromHistoryAction.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/AddFromHistoryAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -126,7 +126,7 @@ public class AddFromHistoryAction extends BaseCompareAction {
IFileState fileState= selected[i].fFileState;
createContainers(file);
- SubProgressMonitor subMonitor= new SubProgressMonitor(pm, 1);
+ SubMonitor subMonitor= SubMonitor.convert(pm, 1);
try {
file.create(fileState.getContents(), false, subMonitor);
} finally {
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/Patcher.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/Patcher.java
index cda13f343..c0fc532a4 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/Patcher.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/Patcher.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2017 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -52,7 +52,7 @@ import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.core.runtime.SubMonitor;
import org.eclipse.core.runtime.preferences.IScopeContext;
import org.eclipse.core.runtime.preferences.InstanceScope;
import org.eclipse.jface.text.TextUtilities;
@@ -290,18 +290,18 @@ public class Patcher implements IHunkFilter {
// patch it and collect rejected hunks
List<String> result= apply(diff, file, true, failed);
if (result != null)
- store(LineReader.createString(isPreserveLineDelimeters(), result), file, new SubProgressMonitor(pm, workTicks));
+ store(LineReader.createString(isPreserveLineDelimeters(), result), file, SubMonitor.convert(pm, workTicks));
workTicks-= WORK_UNIT;
break;
case FilePatch2.DELETION:
- file.delete(true, true, new SubProgressMonitor(pm, workTicks));
+ file.delete(true, true, SubMonitor.convert(pm, workTicks));
workTicks-= WORK_UNIT;
break;
case FilePatch2.CHANGE:
// patch it and collect rejected hunks
result= apply(diff, file, false, failed);
if (result != null)
- store(LineReader.createString(isPreserveLineDelimeters(), result), file, new SubProgressMonitor(pm, workTicks));
+ store(LineReader.createString(isPreserveLineDelimeters(), result), file, SubMonitor.convert(pm, workTicks));
workTicks-= WORK_UNIT;
break;
}
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/WorkspacePatcher.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/WorkspacePatcher.java
index 20f71f3ec..a2a66977d 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/WorkspacePatcher.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/WorkspacePatcher.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2017 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -110,18 +110,18 @@ public class WorkspacePatcher extends Patcher {
// patch it and collect rejected hunks
List<String> result= apply(diff, file, true, failed);
if (result != null)
- store(LineReader.createString(isPreserveLineDelimeters(), result), file, new SubProgressMonitor(pm, workTicks));
+ store(LineReader.createString(isPreserveLineDelimeters(), result), file, SubMonitor.convert(pm, workTicks));
workTicks -= WORK_UNIT;
break;
case FilePatch2.DELETION :
- file.delete(true, true, new SubProgressMonitor(pm, workTicks));
+ file.delete(true, true, SubMonitor.convert(pm, workTicks));
workTicks -= WORK_UNIT;
break;
case FilePatch2.CHANGE :
// patch it and collect rejected hunks
result= apply(diff, file, false, failed);
if (result != null)
- store(LineReader.createString(isPreserveLineDelimeters(), result), file, new SubProgressMonitor(pm, workTicks));
+ store(LineReader.createString(isPreserveLineDelimeters(), result), file, SubMonitor.convert(pm, workTicks));
workTicks -= WORK_UNIT;
break;
}
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/StructureDiffViewer.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/StructureDiffViewer.java
index f6f8ace85..ac970287e 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/StructureDiffViewer.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/StructureDiffViewer.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2017 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -28,7 +28,7 @@ import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.core.runtime.SubMonitor;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.text.BadPositionCategoryException;
import org.eclipse.jface.text.IDocument;
@@ -75,14 +75,14 @@ public class StructureDiffViewer extends DiffTreeViewer {
*/
private IRunnableWithProgress diffTask = monitor -> {
monitor.beginTask(CompareMessages.StructureDiffViewer_0, 100);
- diff(new SubProgressMonitor(monitor, 100));
+ diff(SubMonitor.convert(monitor, 100));
monitor.done();
};
private IRunnableWithProgress inputChangedTask = monitor -> {
monitor.beginTask(CompareMessages.StructureDiffViewer_1, 100);
// TODO: Should we always force
- compareInputChanged((ICompareInput) getInput(), true, new SubProgressMonitor(monitor, 100));
+ compareInputChanged((ICompareInput) getInput(), true, SubMonitor.convert(monitor, 100));
monitor.done();
};
@@ -370,7 +370,7 @@ public class StructureDiffViewer extends DiffTreeViewer {
if (monitor != null) {
if (monitor.isCanceled() || getControl().isDisposed())
throw new OperationCanceledException();
- return new SubProgressMonitor(monitor, work);
+ return SubMonitor.convert(monitor, work);
}
return null;
}
@@ -526,7 +526,7 @@ public class StructureDiffViewer extends DiffTreeViewer {
if (compareConfiguration != null) {
compareConfiguration.getContainer().run(true, true, monitor -> {
monitor.beginTask(CompareMessages.StructureDiffViewer_2, 100);
- diffTask.run(new SubProgressMonitor(monitor, 100));
+ diffTask.run(SubMonitor.convert(monitor, 100));
monitor.done();
});
}
diff --git a/bundles/org.eclipse.jsch.core/src/org/eclipse/jsch/internal/core/Policy.java b/bundles/org.eclipse.jsch.core/src/org/eclipse/jsch/internal/core/Policy.java
index ae2a4fb3d..b3940cc00 100644
--- a/bundles/org.eclipse.jsch.core/src/org/eclipse/jsch/internal/core/Policy.java
+++ b/bundles/org.eclipse.jsch.core/src/org/eclipse/jsch/internal/core/Policy.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -31,7 +31,7 @@ public class Policy{
return new NullProgressMonitor();
if(monitor instanceof NullProgressMonitor)
return monitor;
- return new SubProgressMonitor(monitor, ticks);
+ return SubMonitor.convert(monitor, ticks);
}
}
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/Policy.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/Policy.java
index 66b4b3ac8..d987299ca 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/Policy.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/Policy.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2017 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -50,7 +50,7 @@ public class Policy {
return new NullProgressMonitor();
if (monitor instanceof NullProgressMonitor)
return monitor;
- return new SubProgressMonitor(monitor, ticks);
+ return SubMonitor.convert(monitor, ticks);
}
public static IProgressMonitor infiniteSubMonitorFor(IProgressMonitor monitor, int ticks) {
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSProjectSetCapability.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSProjectSetCapability.java
index 9f035306c..fab9fc47e 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSProjectSetCapability.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSProjectSetCapability.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -33,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.Path;
-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.MultiRule;
import org.eclipse.team.core.ProjectSetCapability;
@@ -256,7 +256,7 @@ public class CVSProjectSetCapability extends ProjectSetCapability {
break;
IProject project = projects[i];
LoadInfo info = (LoadInfo) infoMap.get(project);
- if (info != null && info.checkout(new SubProgressMonitor(monitor, 1000)))
+ if (info != null && info.checkout(SubMonitor.convert(monitor, 1000)))
result.add(project);
}
}
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/Policy.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/Policy.java
index 2806474be..b2cc64bd7 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/Policy.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/Policy.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2014 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -59,7 +59,7 @@ public class Policy {
return new NullProgressMonitor();
if (monitor instanceof NullProgressMonitor)
return monitor;
- return new SubProgressMonitor(monitor, ticks);
+ return SubMonitor.convert(monitor, ticks);
}
public static IProgressMonitor infiniteSubMonitorFor(IProgressMonitor monitor, int ticks) {
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/filehistory/CVSFileHistory.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/filehistory/CVSFileHistory.java
index 2ee46b6dd..953d0a302 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/filehistory/CVSFileHistory.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/filehistory/CVSFileHistory.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -96,7 +96,7 @@ public class CVSFileHistory extends FileHistory {
monitor.beginTask(NLS.bind(CVSMessages.CVSFileHistory_0, cvsFile.getRepositoryRelativePath()), 300);
try {
ILogEntry[] entries = cvsFile
- .getLogEntries(new SubProgressMonitor(monitor, 200));
+ .getLogEntries(SubMonitor.convert(monitor, 200));
if (entries.length == 0){
//Get the parent folder
@@ -169,8 +169,8 @@ public class CVSFileHistory extends FileHistory {
//get the local revisions
IFileState[] localHistoryState;
try {
- localHistoryState = ((IFile) localResource).getHistory(new SubProgressMonitor(monitor, 100));
- localRevisions = convertToFileRevision(localHistoryState, new SubProgressMonitor(monitor, 100));
+ localHistoryState = ((IFile) localResource).getHistory(SubMonitor.convert(monitor, 100));
+ localRevisions = convertToFileRevision(localHistoryState, SubMonitor.convert(monitor, 100));
includesExists = (localRevisions.length > 0);
} catch (CoreException e) {
TeamException.asTeamException(e);
@@ -323,8 +323,8 @@ public class CVSFileHistory extends FileHistory {
includesExists = false;
if (localResource != null && localResource instanceof IFile) {
//get the local revisions
- IFileState[] localHistoryState = ((IFile) localResource).getHistory(new SubProgressMonitor(monitor, 100));
- localRevisions = convertToFileRevision(localHistoryState, new SubProgressMonitor(monitor, 100));
+ IFileState[] localHistoryState = ((IFile) localResource).getHistory(SubMonitor.convert(monitor, 100));
+ localRevisions = convertToFileRevision(localHistoryState, SubMonitor.convert(monitor, 100));
includesExists = (localRevisions.length > 0);
}
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/filesystem/CVSFileSystem.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/filesystem/CVSFileSystem.java
index 93b65eee7..19285d60d 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/filesystem/CVSFileSystem.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/filesystem/CVSFileSystem.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -62,7 +62,7 @@ public class CVSFileSystem extends FileSystem {
try {
RemoteLogger logger = new RemoteLogger(folder);
- RemoteFolderTree remoteTree = logger.fetchTree(new SubProgressMonitor(monitor,80));
+ RemoteFolderTree remoteTree = logger.fetchTree(SubMonitor.convert(monitor,80));
HashMap folderMap = logger.getFolderMap();
HashMap logMap = logger.getLogMap();
folderMap.put(folder.getName(), remoteTree);
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/filesystem/RemoteLogger.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/filesystem/RemoteLogger.java
index ef76314ce..0d8917ef7 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/filesystem/RemoteLogger.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/filesystem/RemoteLogger.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
+ * Copyright (c) 2005, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -68,7 +68,7 @@ public class RemoteLogger {
if (tag == null)
tag = CVSTag.DEFAULT;
- getRemoteChildren(tag, new SubProgressMonitor(monitor,70));
+ getRemoteChildren(tag, SubMonitor.convert(monitor,70));
final ICVSRemoteFolder project = this.remoteFolder;
//Get the entry paths
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSCompareEditorInput.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSCompareEditorInput.java
index 9f5b0e46b..8de22e87f 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSCompareEditorInput.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSCompareEditorInput.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -327,7 +327,7 @@ public class CVSCompareEditorInput extends CompareEditorInput {
// do the diff
Object result = null;
monitor.beginTask(CVSUIMessages.CVSCompareEditorInput_comparing, 30);
- IProgressMonitor sub = new SubProgressMonitor(monitor, 30);
+ IProgressMonitor sub = SubMonitor.convert(monitor, 30);
sub.beginTask(CVSUIMessages.CVSCompareEditorInput_comparing, 100);
try {
result = d.findDifferences(threeWay, sub, null, ancestor, left, right);
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSHistoryPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSHistoryPage.java
index 55d7b0535..339c3bad6 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSHistoryPage.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSHistoryPage.java
@@ -577,9 +577,9 @@ public class CVSHistoryPage extends HistoryPage implements IAdaptable, IHistoryC
monitor.beginTask(null, 100);
try {
if(confirmOverwrite() && validateChange()) {
- IStorage currentStorage = currentSelection.getStorage(new SubProgressMonitor(monitor, 50));
+ IStorage currentStorage = currentSelection.getStorage(SubMonitor.convert(monitor, 50));
InputStream in = currentStorage.getContents();
- ((IFile)file.getIResource()).setContents(in, false, true, new SubProgressMonitor(monitor, 50));
+ ((IFile)file.getIResource()).setContents(in, false, true, SubMonitor.convert(monitor, 50));
}
} catch (TeamException e) {
throw new CoreException(e.getStatus());
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSProjectSetSerializer.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSProjectSetSerializer.java
index bd43f1092..4656c2b55 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSProjectSetSerializer.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSProjectSetSerializer.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -18,7 +18,7 @@ import java.util.StringTokenizer;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.core.runtime.SubMonitor;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.osgi.util.NLS;
@@ -156,7 +156,7 @@ public class CVSProjectSetSerializer implements IProjectSetSerializer {
if (locations[i] != null) {
ICVSRemoteFolder remote = new RemoteFolder(null, locations[i], modules[i], tags[i]);
new CheckoutSingleProjectOperation(null /* no part */, remote, projects[i], null /* location */, true)
- .run(new SubProgressMonitor(monitor, 1000));
+ .run(SubMonitor.convert(monitor, 1000));
}
}
} finally {
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/Policy.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/Policy.java
index 6201a9953..f261db8bd 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/Policy.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/Policy.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2014 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -53,7 +53,7 @@ public class Policy {
return new NullProgressMonitor();
if (monitor instanceof NullProgressMonitor)
return monitor;
- return new SubProgressMonitor(monitor, ticks);
+ return SubMonitor.convert(monitor, ticks);
}
public static IProgressMonitor infiniteSubMonitorFor(IProgressMonitor monitor, int ticks) {
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/WorkspaceAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/WorkspaceAction.java
index 2b538d3e1..cf614fbcb 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/WorkspaceAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/WorkspaceAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -435,7 +435,7 @@ public abstract class WorkspaceAction extends CVSAction {
Iterator iterator = keySet.iterator();
while (iterator.hasNext()) {
- IProgressMonitor subMonitor = new SubProgressMonitor(monitor, 1000);
+ IProgressMonitor subMonitor = SubMonitor.convert(monitor, 1000);
CVSTeamProvider provider = (CVSTeamProvider)iterator.next();
List list = (List)table.get(provider);
IResource[] providerResources = (IResource[])list.toArray(new IResource[list.size()]);
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/TagInRepositoryOperation.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/TagInRepositoryOperation.java
index dd6d9c2a5..1e86a0635 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/TagInRepositoryOperation.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/TagInRepositoryOperation.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -40,7 +40,7 @@ public class TagInRepositoryOperation extends RemoteOperation implements ITagOpe
ICVSRemoteResource[] resources = getRemoteResources();
monitor.beginTask(null, 1000 * resources.length);
for (int i = 0; i < resources.length; i++) {
- IStatus status = resources[i].tag(getTag(), getLocalOptions(), new SubProgressMonitor(monitor, 1000));
+ IStatus status = resources[i].tag(getTag(), getLocalOptions(), SubMonitor.convert(monitor, 1000));
collectStatus(status);
}
if (!errorsOccurred()) {
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/Policy.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/Policy.java
index 28c30b8f4..8a189a8b0 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/Policy.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/Policy.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2017 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -66,7 +66,7 @@ public class Policy {
return new NullProgressMonitor();
if (monitor instanceof NullProgressMonitor)
return monitor;
- return new SubProgressMonitor(monitor, ticks);
+ return SubMonitor.convert(monitor, ticks);
}
public static IProgressMonitor monitorFor(IProgressMonitor monitor) {
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/RemoveSynchronizeParticipantAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/RemoveSynchronizeParticipantAction.java
index 1bfc684c4..4dae74987 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/RemoveSynchronizeParticipantAction.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/RemoveSynchronizeParticipantAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2017 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -176,7 +176,7 @@ public class RemoveSynchronizeParticipantAction extends Action {
Saveable model = (Saveable) i.next();
if (model.isDirty()) {
try {
- model.doSave(new SubProgressMonitor(monitor, 1));
+ model.doSave(SubMonitor.convert(monitor, 1));
} catch (CoreException e) {
ErrorDialog.openError(view.getSite().getShell(), null, e.getMessage(), e.getStatus());
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/patch/ApplyPatchSynchronizationWizard.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/patch/ApplyPatchSynchronizationWizard.java
index 509fd2b11..4cf400ef2 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/patch/ApplyPatchSynchronizationWizard.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/patch/ApplyPatchSynchronizationWizard.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2010 IBM Corporation and others.
+ * Copyright (c) 2009, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -163,7 +163,7 @@ public class ApplyPatchSynchronizationWizard extends PatchWizard implements
for (int i = 0; i < projects.length; i++) {
IProject project = projects[i];
try {
- project.open(new SubProgressMonitor(monitor, 1));
+ project.open(SubMonitor.convert(monitor, 1));
} catch (CoreException e) {
errorStatus.add(e.getStatus());
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ProjectSetExportWizard.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ProjectSetExportWizard.java
index 3a972d55c..8c62beb40 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ProjectSetExportWizard.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/wizards/ProjectSetExportWizard.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2017 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -131,7 +131,7 @@ public class ProjectSetExportWizard extends Wizard implements IExportWizard {
ProjectSetCapability serializer = providerType.getProjectSetCapability();
ProjectSetCapability.ensureBackwardsCompatible(providerType, serializer);
if (serializer != null) {
- String[] references = serializer.asReference(projectArray, context, new SubProgressMonitor(monitor, 990));
+ String[] references = serializer.asReference(projectArray, context, SubMonitor.convert(monitor, 990));
for (int i = 0; i < references.length; i++) {
IMemento proj = memento.createChild("project"); //$NON-NLS-1$
proj.putString("reference", references[i]); //$NON-NLS-1$
@@ -175,7 +175,7 @@ public class ProjectSetExportWizard extends Wizard implements IExportWizard {
if (type != null) {
ProjectSetCapability capability = type.getProjectSetCapability();
if (capability != null) {
- capability.projectSetCreated(file, context, new SubProgressMonitor(monitor, 10));
+ capability.projectSetCreated(file, context, SubMonitor.convert(monitor, 10));
}
}
}
diff --git a/examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/XMLStructureViewer.java b/examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/XMLStructureViewer.java
index e792a4d76..9bfa10730 100644
--- a/examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/XMLStructureViewer.java
+++ b/examples/org.eclipse.compare.examples.xml/src/org/eclipse/compare/examples/xml/XMLStructureViewer.java
@@ -539,12 +539,12 @@ public class XMLStructureViewer extends StructureDiffViewer {
left,
ancestor,
true,
- new SubProgressMonitor(monitor, 1));
+ SubMonitor.convert(monitor, 1));
m.match(
right,
ancestor,
true,
- new SubProgressMonitor(monitor, 1));
+ SubMonitor.convert(monitor, 1));
}
// } catch (InterruptedException e) {
// System.out.println("in run");
diff --git a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/FileSystemOperations.java b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/FileSystemOperations.java
index 510fa74bb..c1752e8ac 100644
--- a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/FileSystemOperations.java
+++ b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/FileSystemOperations.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -27,7 +27,7 @@ import org.eclipse.core.resources.IResourceVisitor;
import org.eclipse.core.resources.mapping.ResourceTraversal;
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.team.core.TeamException;
import org.eclipse.team.core.variants.IResourceVariant;
import org.eclipse.team.core.variants.IResourceVariantComparator;
@@ -63,8 +63,8 @@ public class FileSystemOperations {
progress = Policy.monitorFor(progress);
progress.beginTask(Policy.bind("GetAction.working"), 100); //$NON-NLS-1$
// Refresh the subscriber so we have the latest remote state
- FileSystemSubscriber.getInstance().refresh(resources, depth, new SubProgressMonitor(progress, 30));
- internalGet(resources, depth, overrideOutgoing, new SubProgressMonitor(progress, 70));
+ FileSystemSubscriber.getInstance().refresh(resources, depth, SubMonitor.convert(progress, 30));
+ internalGet(resources, depth, overrideOutgoing, SubMonitor.convert(progress, 70));
} finally {
progress.done();
}
@@ -86,7 +86,7 @@ public class FileSystemOperations {
monitor.beginTask(null, 100* traversals.length);
for (int i = 0; i < traversals.length; i++) {
ResourceTraversal traversal = traversals[i];
- get(traversal.getResources(), traversal.getDepth(), overrideOutgoing, new SubProgressMonitor(monitor, 100));
+ get(traversal.getResources(), traversal.getDepth(), overrideOutgoing, SubMonitor.convert(monitor, 100));
}
} finally {
monitor.done();
@@ -140,8 +140,8 @@ public class FileSystemOperations {
progress = Policy.monitorFor(progress);
progress.beginTask(Policy.bind("PutAction.working"), 100); //$NON-NLS-1$
// Refresh the subscriber so we have the latest remote state
- FileSystemSubscriber.getInstance().refresh(resources, depth, new SubProgressMonitor(progress, 30));
- internalPut(resources, depth, overrideIncoming, new SubProgressMonitor(progress, 70));
+ FileSystemSubscriber.getInstance().refresh(resources, depth, SubMonitor.convert(progress, 30));
+ internalPut(resources, depth, overrideIncoming, SubMonitor.convert(progress, 70));
} finally {
progress.done();
}
@@ -162,7 +162,7 @@ public class FileSystemOperations {
monitor.beginTask(null, 100* traversals.length);
for (int i = 0; i < traversals.length; i++) {
ResourceTraversal traversal = traversals[i];
- checkin(traversal.getResources(), traversal.getDepth(), overrideIncoming, new SubProgressMonitor(monitor, 100));
+ checkin(traversal.getResources(), traversal.getDepth(), overrideIncoming, SubMonitor.convert(monitor, 100));
}
} finally {
monitor.done();
diff --git a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/FileSystemOperation.java b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/FileSystemOperation.java
index 2991cf679..b48d0b6f4 100644
--- a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/FileSystemOperation.java
+++ b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/FileSystemOperation.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
+ * Copyright (c) 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -61,7 +61,7 @@ public abstract class FileSystemOperation extends ModelOperation {
ResourceTraversal[] traversals = getTraversals(providerToTraversals, provider);
execute(provider,
traversals,
- new SubProgressMonitor(monitor, 100));
+ SubMonitor.convert(monitor, 100));
}
} catch (CoreException e) {
throw new InvocationTargetException(e);
diff --git a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/NonSyncModelMergeOperation.java b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/NonSyncModelMergeOperation.java
index e736d5c11..a1260a3d2 100644
--- a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/NonSyncModelMergeOperation.java
+++ b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/filesystem/ui/NonSyncModelMergeOperation.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation and others.
+ * Copyright (c) 2006, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -62,10 +62,10 @@ public class NonSyncModelMergeOperation extends ModelMergeOperation {
context = new FileSystemMergeContext(getScopeManager());
// Refresh the context to get the latest remote state
context.refresh(getScope().getTraversals(),
- RemoteResourceMappingContext.FILE_CONTENTS_REQUIRED, new SubProgressMonitor(monitor, 75));
+ RemoteResourceMappingContext.FILE_CONTENTS_REQUIRED, SubMonitor.convert(monitor, 75));
// What for the context to asynchronously update the diff tree
try {
- Job.getJobManager().join(context, new SubProgressMonitor(monitor, 25));
+ Job.getJobManager().join(context, SubMonitor.convert(monitor, 25));
} catch (InterruptedException e) {
// Ignore
}
diff --git a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/localhistory/RevertAllOperation.java b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/localhistory/RevertAllOperation.java
index 87dba234e..376aa9d05 100644
--- a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/localhistory/RevertAllOperation.java
+++ b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/localhistory/RevertAllOperation.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -42,10 +42,10 @@ public class RevertAllOperation extends SynchronizeModelOperation {
LocalHistoryVariant state = (LocalHistoryVariant)info.getRemote();
IFile file = (IFile)info.getLocal();
if(file.exists()) {
- file.setContents(state.getFileState(), false, true, new SubProgressMonitor(pm, 100));
+ file.setContents(state.getFileState(), false, true, SubMonitor.convert(pm, 100));
} else {
// TODO: have to pre-create parents if they dont exist
- file.create(state.getFileState().getContents(), false, new SubProgressMonitor(pm, 100));
+ file.create(state.getFileState().getContents(), false, SubMonitor.convert(pm, 100));
}
}
} catch (CoreException e) {
diff --git a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/mapping/ModResourceMapping.java b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/mapping/ModResourceMapping.java
index 02f49fb1e..b444d5522 100644
--- a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/mapping/ModResourceMapping.java
+++ b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/mapping/ModResourceMapping.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation and others.
+ * Copyright (c) 2006, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -35,22 +35,22 @@ public class ModResourceMapping extends ModelResourceMapping {
if (context instanceof RemoteResourceMappingContext) {
monitor.beginTask(null, IProgressMonitor.UNKNOWN);
RemoteResourceMappingContext remoteContext = (RemoteResourceMappingContext) context;
- if (remoteContext.hasRemoteChange(getResource(), new SubProgressMonitor(monitor, IProgressMonitor.UNKNOWN))) {
+ if (remoteContext.hasRemoteChange(getResource(), SubMonitor.convert(monitor, IProgressMonitor.UNKNOWN))) {
IResource[] remoteResources = ModelObjectDefinitionFile.getReferencedResources(
getResource().getProject().getName(),
remoteContext.fetchRemoteContents((IFile)getResource(),
- new SubProgressMonitor(monitor, IProgressMonitor.UNKNOWN)));
+ SubMonitor.convert(monitor, IProgressMonitor.UNKNOWN)));
for (int i = 0; i < remoteResources.length; i++) {
IResource resource = remoteResources[i];
resources.add(resource);
}
}
if (remoteContext.isThreeWay()
- && remoteContext.hasLocalChange(getResource(), new SubProgressMonitor(monitor, IProgressMonitor.UNKNOWN))) {
+ && remoteContext.hasLocalChange(getResource(), SubMonitor.convert(monitor, IProgressMonitor.UNKNOWN))) {
IResource[] remoteResources = ModelObjectDefinitionFile.getReferencedResources(
getResource().getProject().getName(),
remoteContext.fetchBaseContents((IFile)getResource(),
- new SubProgressMonitor(monitor, IProgressMonitor.UNKNOWN)));
+ SubMonitor.convert(monitor, IProgressMonitor.UNKNOWN)));
for (int i = 0; i < remoteResources.length; i++) {
IResource resource = remoteResources[i];
resources.add(resource);
diff --git a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/mapping/ModelMerger.java b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/mapping/ModelMerger.java
index e69a53c72..cfbe61b21 100644
--- a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/mapping/ModelMerger.java
+++ b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/mapping/ModelMerger.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation and others.
+ * Copyright (c) 2006, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -26,7 +26,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.Job;
import org.eclipse.team.core.diff.FastDiffFilter;
import org.eclipse.team.core.diff.IDiff;
@@ -71,7 +71,7 @@ public class ModelMerger extends ResourceMappingMerger {
// Only override the merge for three-way synchronizations
if (mergeContext.getType() == SynchronizationContext.THREE_WAY) {
monitor.beginTask("Merging model elements", 100);
- status = mergeModelElements(mergeContext, new SubProgressMonitor(monitor, 50));
+ status = mergeModelElements(mergeContext, SubMonitor.convert(monitor, 50));
// Stop the merge if there was a failure
if (!status.isOK())
return status;
@@ -79,7 +79,7 @@ public class ModelMerger extends ResourceMappingMerger {
// so the diff tree will be up-to-date when we delegate the rest of the merge
// to the superclass
try {
- Job.getJobManager().join(mergeContext, new SubProgressMonitor(monitor, 50));
+ Job.getJobManager().join(mergeContext, SubMonitor.convert(monitor, 50));
} catch (InterruptedException e) {
// Ignore
}
@@ -104,7 +104,7 @@ public class ModelMerger extends ResourceMappingMerger {
monitor.beginTask(null, 100 * modeDiffs.length);
for (int i = 0; i < modeDiffs.length; i++) {
IDiff diff = modeDiffs[i];
- if (!mergeModelElement(mergeContext, diff, new SubProgressMonitor(monitor, 100))) {
+ if (!mergeModelElement(mergeContext, diff, SubMonitor.convert(monitor, 100))) {
failures.add(diff);
}
}
diff --git a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ui/NewModelProjectWizard.java b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ui/NewModelProjectWizard.java
index b3420deed..58eb83ed5 100644
--- a/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ui/NewModelProjectWizard.java
+++ b/examples/org.eclipse.team.examples.filesystem/src/org/eclipse/team/examples/model/ui/NewModelProjectWizard.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
+ * Copyright (c) 2006, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -111,14 +111,14 @@ public class NewModelProjectWizard extends Wizard implements INewWizard {
try {
monitor.beginTask("", 2000);//$NON-NLS-1$
- projectHandle.create(description, new SubProgressMonitor(monitor,
+ projectHandle.create(description, SubMonitor.convert(monitor,
1000));
if (monitor.isCanceled()) {
throw new OperationCanceledException();
}
- projectHandle.open(IResource.BACKGROUND_REFRESH, new SubProgressMonitor(monitor, 1000));
+ projectHandle.open(IResource.BACKGROUND_REFRESH, SubMonitor.convert(monitor, 1000));
} finally {
monitor.done();

Back to the top