diff options
author | Raphael Moll <ralf@android.com> | 2012-10-09 10:01:53 -0700 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2012-10-09 10:01:53 -0700 |
commit | c5fce2e12268c60332b7011cee8c1081ad424950 (patch) | |
tree | 0962c55ccb365258683dbc6a479a6cdf248f799f /eclipse | |
parent | 9098ccd0b10e17075eaeefe5cac2e69d1456c830 (diff) | |
parent | 969558c8ec2fc99fcfb96c990262fc5cf1267541 (diff) | |
download | sdk-c5fce2e12268c60332b7011cee8c1081ad424950.zip sdk-c5fce2e12268c60332b7011cee8c1081ad424950.tar.gz sdk-c5fce2e12268c60332b7011cee8c1081ad424950.tar.bz2 |
Merge "SDK fix for bug 21589: disable type rename refactoring."
Diffstat (limited to 'eclipse')
-rw-r--r-- | eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/core/AndroidTypeRenameParticipant.java | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/core/AndroidTypeRenameParticipant.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/core/AndroidTypeRenameParticipant.java index 6605394..3a7f6db 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/core/AndroidTypeRenameParticipant.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/core/AndroidTypeRenameParticipant.java @@ -43,9 +43,12 @@ import org.eclipse.jdt.core.IJavaProject; import org.eclipse.jdt.core.IType; import org.eclipse.jdt.core.ITypeHierarchy; import org.eclipse.jdt.core.JavaModelException; +import org.eclipse.jdt.internal.corext.refactoring.rename.RenameCompilationUnitProcessor; +import org.eclipse.jdt.internal.corext.refactoring.rename.RenameTypeProcessor; import org.eclipse.jface.text.IDocument; import org.eclipse.ltk.core.refactoring.Change; import org.eclipse.ltk.core.refactoring.CompositeChange; +import org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor; import org.eclipse.wst.sse.core.StructuredModelManager; import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel; import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument; @@ -84,8 +87,26 @@ public class AndroidTypeRenameParticipant extends AndroidRenameParticipant { if (pm.isCanceled()) { return null; } + + // Only propose this refactoring if the "Update References" checkbox is set. if (!getArguments().getUpdateReferences()) return null; + + RefactoringProcessor p = getProcessor(); + if (p instanceof RenameCompilationUnitProcessor) { + RenameTypeProcessor rtp = ((RenameCompilationUnitProcessor) p).getRenameTypeProcessor(); + if (rtp != null) { + String pattern = rtp.getFilePatterns(); + boolean updQualf = rtp.getUpdateQualifiedNames(); + if (updQualf && pattern != null && pattern.contains("xml")) { //$NON-NLS-1$ + // Do not propose this refactoring if the + // "Update fully qualified names in non-Java files" option is + // checked and the file patterns mention XML. [c.f. SDK bug 21589] + return null; + } + } + } + CompositeChange result = new CompositeChange(getName()); if (mAndroidManifest.exists()) { if (mAndroidElements.size() > 0) { |