diff --git a/org.eclipse.ltk.core.refactoring/META-INF/MANIFEST.MF b/org.eclipse.ltk.core.refactoring/META-INF/MANIFEST.MF index c9e1308b10c..a05bea453b1 100644 --- a/org.eclipse.ltk.core.refactoring/META-INF/MANIFEST.MF +++ b/org.eclipse.ltk.core.refactoring/META-INF/MANIFEST.MF @@ -3,7 +3,7 @@ Automatic-Module-Name: org.eclipse.ltk.core.refactoring Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.ltk.core.refactoring; singleton:=true -Bundle-Version: 3.12.200.qualifier +Bundle-Version: 3.13.0.qualifier Bundle-Activator: org.eclipse.ltk.internal.core.refactoring.RefactoringCorePlugin Bundle-ActivationPolicy: lazy Bundle-Vendor: %providerName diff --git a/org.eclipse.ltk.core.refactoring/pom.xml b/org.eclipse.ltk.core.refactoring/pom.xml index e844c3456f8..5906188bfc6 100644 --- a/org.eclipse.ltk.core.refactoring/pom.xml +++ b/org.eclipse.ltk.core.refactoring/pom.xml @@ -18,6 +18,6 @@ org.eclipse.ltk org.eclipse.ltk.core.refactoring - 3.12.200-SNAPSHOT + 3.13.0-SNAPSHOT eclipse-plugin diff --git a/org.eclipse.ltk.core.refactoring/src/org/eclipse/ltk/core/refactoring/CompositeChange.java b/org.eclipse.ltk.core.refactoring/src/org/eclipse/ltk/core/refactoring/CompositeChange.java index aaf54e18e6a..dbc84628e34 100644 --- a/org.eclipse.ltk.core.refactoring/src/org/eclipse/ltk/core/refactoring/CompositeChange.java +++ b/org.eclipse.ltk.core.refactoring/src/org/eclipse/ltk/core/refactoring/CompositeChange.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2015 IBM Corporation and others. + * Copyright (c) 2000, 2022 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -503,4 +503,24 @@ public String toString() { } return buff.toString(); } + + /** + * @return Amount of changed files + * @since 3.13 + */ + public int getFilenumber() { + if(fChanges.size()>0) { + if (fChanges.get(0) instanceof CompositeChange) { + CompositeChange obj= (CompositeChange) fChanges.get(0); + return obj.getAmount(); + } + return 1; + } + return 0; + } + + private int getAmount() { + return fChanges.size(); + } + } diff --git a/org.eclipse.ltk.ui.refactoring/META-INF/MANIFEST.MF b/org.eclipse.ltk.ui.refactoring/META-INF/MANIFEST.MF index d5dd0abde26..d6b20994d1d 100644 --- a/org.eclipse.ltk.ui.refactoring/META-INF/MANIFEST.MF +++ b/org.eclipse.ltk.ui.refactoring/META-INF/MANIFEST.MF @@ -3,7 +3,7 @@ Automatic-Module-Name: org.eclipse.ltk.ui.refactoring Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.ltk.ui.refactoring; singleton:=true -Bundle-Version: 3.12.100.qualifier +Bundle-Version: 3.12.200.qualifier Bundle-Activator: org.eclipse.ltk.internal.ui.refactoring.RefactoringUIPlugin Bundle-ActivationPolicy: lazy Bundle-Vendor: %providerName diff --git a/org.eclipse.ltk.ui.refactoring/pom.xml b/org.eclipse.ltk.ui.refactoring/pom.xml index de6a58a85e3..eb2eb2809eb 100644 --- a/org.eclipse.ltk.ui.refactoring/pom.xml +++ b/org.eclipse.ltk.ui.refactoring/pom.xml @@ -18,6 +18,6 @@ org.eclipse.ltk org.eclipse.ltk.ui.refactoring - 3.12.100-SNAPSHOT + 3.12.200-SNAPSHOT eclipse-plugin diff --git a/org.eclipse.ltk.ui.refactoring/src/org/eclipse/ltk/internal/ui/refactoring/PreviewWizardPage.java b/org.eclipse.ltk.ui.refactoring/src/org/eclipse/ltk/internal/ui/refactoring/PreviewWizardPage.java index 41572e7f9ba..f233651d4ed 100644 --- a/org.eclipse.ltk.ui.refactoring/src/org/eclipse/ltk/internal/ui/refactoring/PreviewWizardPage.java +++ b/org.eclipse.ltk.ui.refactoring/src/org/eclipse/ltk/internal/ui/refactoring/PreviewWizardPage.java @@ -14,6 +14,7 @@ package org.eclipse.ltk.internal.ui.refactoring; import java.text.Collator; +import java.text.MessageFormat; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; @@ -292,8 +293,7 @@ public void executed(Action action) { * Creates a new preview wizard page. */ public PreviewWizardPage() { - super(PAGE_NAME); - setDescription(RefactoringUIMessages.PreviewWizardPage_description); + this(false); } /** @@ -305,7 +305,7 @@ public PreviewWizardPage() { */ public PreviewWizardPage(boolean wizard) { super(PAGE_NAME, wizard); - setDescription(RefactoringUIMessages.PreviewWizardPage_description); + setDescription(RefactoringUIMessages.PreviewWizardPage_description_s); } /** @@ -561,6 +561,12 @@ protected void setTreeViewerInput() { PreviewNode input= null; if (fTreeViewerInputChange != null) { input= AbstractChangeNode.createNode(null, fTreeViewerInputChange); + int filenumber= fTreeViewerInputChange.getFilenumber(); + String fullDescription= RefactoringUIMessages.PreviewWizardPage_description_s; + if (filenumber > 1) { + fullDescription= MessageFormat.format(RefactoringUIMessages.PreviewWizardPage_description_m, String.valueOf(filenumber)); + } + setDescription(fullDescription); } fTreeViewer.setInput(input); } diff --git a/org.eclipse.ltk.ui.refactoring/src/org/eclipse/ltk/internal/ui/refactoring/RefactoringUIMessages.java b/org.eclipse.ltk.ui.refactoring/src/org/eclipse/ltk/internal/ui/refactoring/RefactoringUIMessages.java index 1ef52953d85..456eabb332b 100644 --- a/org.eclipse.ltk.ui.refactoring/src/org/eclipse/ltk/internal/ui/refactoring/RefactoringUIMessages.java +++ b/org.eclipse.ltk.ui.refactoring/src/org/eclipse/ltk/internal/ui/refactoring/RefactoringUIMessages.java @@ -124,7 +124,9 @@ public final class RefactoringUIMessages extends NLS { public static String PreviewWizardPage_changes_filtered2; - public static String PreviewWizardPage_description; + public static String PreviewWizardPage_description_s; + + public static String PreviewWizardPage_description_m; public static String PreviewWizardPage_filterChanges; diff --git a/org.eclipse.ltk.ui.refactoring/src/org/eclipse/ltk/internal/ui/refactoring/RefactoringUIMessages.properties b/org.eclipse.ltk.ui.refactoring/src/org/eclipse/ltk/internal/ui/refactoring/RefactoringUIMessages.properties index 95e72084aa1..32ed890c708 100644 --- a/org.eclipse.ltk.ui.refactoring/src/org/eclipse/ltk/internal/ui/refactoring/RefactoringUIMessages.properties +++ b/org.eclipse.ltk.ui.refactoring/src/org/eclipse/ltk/internal/ui/refactoring/RefactoringUIMessages.properties @@ -63,8 +63,10 @@ PreviewWizardPage_changes_filter_derived=derived resources hidden PreviewWizardPage_hideDerived_text=&Hide derived resources PreviewWizardPage_refactoring= Refactoring PreviewWizardPage_Internal_error=An unexpected exception while creating a preview. See the error log for more details. -PreviewWizardPage_description= The following changes are necessary to perform the refactoring. +PreviewWizardPage_description_s= The following change to 1 file is necessary to perform the refactoring. +PreviewWizardPage_description_m= The following changes to {0} files are necessary to perform the refactoring. PreviewWizardPage_changeElementLabelProvider_textFormat= {0} - {1} + PreviewWizardPage_no_source_code_change=The refactoring does not change any source code. PreviewWizardPage_showAll_text=&Show All PreviewWizardPage_showAll_description=Show all changes