### Eclipse Workspace Patch 1.0 #P org.eclipse.pde.ui Index: src/org/eclipse/pde/internal/ui/refactoring/BundleManifestChange.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/BundleManifestChange.java,v retrieving revision 1.19 diff -u -r1.19 BundleManifestChange.java --- src/org/eclipse/pde/internal/ui/refactoring/BundleManifestChange.java 16 Jan 2008 17:08:01 -0000 1.19 +++ src/org/eclipse/pde/internal/ui/refactoring/BundleManifestChange.java 23 Feb 2008 13:19:40 -0000 @@ -7,6 +7,7 @@ * * Contributors: * IBM Corporation - initial API and implementation + * Benjamin Cabe - bug 219852 *******************************************************************************/ package org.eclipse.pde.internal.ui.refactoring; @@ -101,10 +102,21 @@ BundleModel model = (BundleModel) bundle.getModel(); BundleTextChangeListener listener = new BundleTextChangeListener(model.getDocument()); bundle.getModel().addModelChangedListener(listener); + boolean localizationRenamed = false; for (int i = 0; i < elements.length; i++) { Object element = elements[i]; String newText = newTexts[i]; - if (element instanceof IType) { + if (element instanceof IFile) { + String fileName = ((IFile) element).getName(); + if (!localizationRenamed && fileName.endsWith(".properties")) { //$NON-NLS-1$ + String oldText = fileName.substring(0, fileName.lastIndexOf(".")); //$NON-NLS-1$ + String oldLocalization = bundle.getLocalization(); + if (oldLocalization.equals(oldText)) { + renameLocalization(bundle, oldText, newText); + localizationRenamed = true; + } + } + } else if (element instanceof IType) { String oldText = ((IType) element).getFullyQualifiedName('$'); resetHeaderValue(bundle.getManifestHeader(Constants.BUNDLE_ACTIVATOR), false, oldText, newText); resetHeaderValue(bundle.getManifestHeader(ICoreConstants.PLUGIN_CLASS), false, oldText, newText); @@ -140,6 +152,13 @@ return null; } + private static void renameLocalization(Bundle bundle, String oldText, String newText) { + if (newText.endsWith(".properties")) //$NON-NLS-1$ + bundle.setLocalization(newText.substring(0, newText.lastIndexOf("."))); //$NON-NLS-1$ + else + bundle.setLocalization(null); + } + private static void resetHeaderValue(IManifestHeader header, boolean isPackage, String oldText, String newText) { if (header != null) { String value = header.getValue(); @@ -209,5 +228,4 @@ model.load(); return model.isLoaded() ? (Bundle) model.getBundle() : null; } - } Index: src/org/eclipse/pde/internal/ui/refactoring/PDERenameParticipant.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/PDERenameParticipant.java,v retrieving revision 1.10 diff -u -r1.10 PDERenameParticipant.java --- src/org/eclipse/pde/internal/ui/refactoring/PDERenameParticipant.java 16 Jan 2008 17:08:00 -0000 1.10 +++ src/org/eclipse/pde/internal/ui/refactoring/PDERenameParticipant.java 23 Feb 2008 13:19:41 -0000 @@ -41,8 +41,7 @@ if (!getArguments().getUpdateReferences()) return null; CompositeChange result = new CompositeChange(getName()); - if (updateManifest()) - addBundleManifestChange(result, pm); + addBundleManifestChange(result, pm); if (updateBuildProperties()) addBuildPropertiesChange(result, pm); addChange(result, ICoreConstants.PLUGIN_FILENAME_DESCRIPTOR, pm); Index: src/org/eclipse/pde/internal/ui/refactoring/BuildPropertiesChange.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/refactoring/BuildPropertiesChange.java,v retrieving revision 1.5 diff -u -r1.5 BuildPropertiesChange.java --- src/org/eclipse/pde/internal/ui/refactoring/BuildPropertiesChange.java 16 Jan 2008 17:08:00 -0000 1.5 +++ src/org/eclipse/pde/internal/ui/refactoring/BuildPropertiesChange.java 23 Feb 2008 13:19:40 -0000 @@ -48,7 +48,7 @@ if (affectedElements[i] instanceof IJavaElement) continue; IResource res = (IResource) affectedElements[i]; - // if resource instanceof IProject, then the project is being renamed and there is no action to do in the build.properties for the resource// if resource instanceof IProject, then the project is being renamed and there is no action to do in the build.properties for the resource + // if resource instanceof IProject, then the project is being renamed and there is no action to do in the build.properties for the resource if (res instanceof IProject) continue; for (int j = 0; j < entries.length; j++) {