diff options
author | Karsten Thoms | 2018-02-20 21:23:39 +0000 |
---|---|---|
committer | Karsten Thoms | 2018-03-09 18:40:18 +0000 |
commit | c31121089f93fec170f2944482a4b0ea446d48e4 (patch) | |
tree | 539f49ff53040aba299d94695958561feaef7618 /examples | |
parent | cc763a549b44c68e8e7bc57a9a398407a44b696b (diff) | |
download | eclipse.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>
Diffstat (limited to 'examples')
8 files changed, 31 insertions, 31 deletions
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(); |