From 0b0d589e176bf0d52f0c562cff5332c8fd8aa19e Mon Sep 17 00:00:00 2001 From: Lars Vogel Date: Tue, 3 Dec 2024 14:52:20 +0100 Subject: [PATCH 1/2] Use SubMonintor in FileBufferOperationAction done() call not necessary here and convert can also show the label and set the number of work unit. See https://www.eclipse.org/articles/Article-Progress-Monitors/article.html --- .../text/FileBufferOperationAction.java | 21 +++++++------------ 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/bundles/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/FileBufferOperationAction.java b/bundles/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/FileBufferOperationAction.java index a0ca71b2de2..4da2fe4b266 100644 --- a/bundles/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/FileBufferOperationAction.java +++ b/bundles/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/FileBufferOperationAction.java @@ -198,20 +198,15 @@ protected IStatus run(IProgressMonitor monitor) { } protected final IPath[] generateLocations(IFile[] files, IProgressMonitor progressMonitor) { - progressMonitor.beginTask(TextEditorMessages.FileBufferOperationAction_collectionFiles_label, files.length); - try { - Set locations= new HashSet<>(); - for (IFile file : files) { - IPath fullPath = file.getFullPath(); - if (isAcceptableLocation(fullPath)) - locations.add(fullPath); - progressMonitor.worked(1); - } - return locations.toArray(new IPath[locations.size()]); - - } finally { - progressMonitor.done(); + SubMonitor subMonitor= SubMonitor.convert(progressMonitor, TextEditorMessages.FileBufferOperationAction_collectionFiles_label, files.length); + Set locations= new HashSet<>(); + for (IFile file : files) { + IPath fullPath= file.getFullPath(); + if (isAcceptableLocation(fullPath)) + locations.add(fullPath); + subMonitor.worked(1); } + return locations.toArray(new IPath[locations.size()]); } /** From 30b13029ca33964cf7ee5ea7e76491775529b84f Mon Sep 17 00:00:00 2001 From: Eclipse Platform Bot Date: Tue, 3 Dec 2024 13:57:03 +0000 Subject: [PATCH 2/2] Version bump(s) for 4.35 stream --- bundles/org.eclipse.ui.editors/META-INF/MANIFEST.MF | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bundles/org.eclipse.ui.editors/META-INF/MANIFEST.MF b/bundles/org.eclipse.ui.editors/META-INF/MANIFEST.MF index 96c4987c88b..9a63a5630ff 100644 --- a/bundles/org.eclipse.ui.editors/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.ui.editors/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.ui.editors; singleton:=true -Bundle-Version: 3.19.0.qualifier +Bundle-Version: 3.19.100.qualifier Bundle-Activator: org.eclipse.ui.internal.editors.text.EditorsPlugin Bundle-ActivationPolicy: lazy Bundle-Vendor: %providerName