OSDN Git Service

Fix excludes in the change layout/widget refactoring dialogs
authorTor Norbye <tnorbye@google.com>
Fri, 10 Jun 2011 18:17:16 +0000 (11:17 -0700)
committerTor Norbye <tnorbye@google.com>
Fri, 10 Jun 2011 18:17:16 +0000 (11:17 -0700)
Change-Id: Ib1564f7528d36182071427b795f9e15da64ffc7a

eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ChangeLayoutWizard.java
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ChangeViewWizard.java

index 04da01d..ac920eb 100644 (file)
@@ -18,7 +18,9 @@ package com.android.ide.eclipse.adt.internal.editors.layout.refactoring;
 
 import static com.android.ide.common.layout.LayoutConstants.FQCN_RELATIVE_LAYOUT;
 import static com.android.ide.common.layout.LayoutConstants.RELATIVE_LAYOUT;
+import static com.android.ide.eclipse.adt.internal.editors.layout.descriptors.LayoutDescriptors.VIEW_FRAGMENT;
 import static com.android.ide.eclipse.adt.internal.editors.layout.descriptors.LayoutDescriptors.VIEW_INCLUDE;
+import static com.android.ide.eclipse.adt.internal.editors.layout.descriptors.LayoutDescriptors.VIEW_MERGE;
 
 import com.android.ide.eclipse.adt.internal.editors.layout.LayoutEditor;
 import com.android.ide.eclipse.adt.internal.editors.layout.descriptors.ViewElementDescriptor;
@@ -108,6 +110,8 @@ class ChangeLayoutWizard extends VisualRefactoringWizard {
             // RelativeLayout at the root.
             Set<String> exclude = new HashSet<String>();
             exclude.add(VIEW_INCLUDE);
+            exclude.add(VIEW_MERGE);
+            exclude.add(VIEW_FRAGMENT);
             boolean oldIsRelativeLayout = mOldType.equals(FQCN_RELATIVE_LAYOUT);
             if (oldIsRelativeLayout) {
                 exclude.add(mOldType);
index 1372006..f235cf6 100644 (file)
 
 package com.android.ide.eclipse.adt.internal.editors.layout.refactoring;
 
+import static com.android.ide.eclipse.adt.internal.editors.layout.descriptors.LayoutDescriptors.REQUEST_FOCUS;
+import static com.android.ide.eclipse.adt.internal.editors.layout.descriptors.LayoutDescriptors.VIEW_FRAGMENT;
+import static com.android.ide.eclipse.adt.internal.editors.layout.descriptors.LayoutDescriptors.VIEW_INCLUDE;
+
 import com.android.ide.eclipse.adt.internal.editors.layout.LayoutEditor;
-import com.android.ide.eclipse.adt.internal.editors.layout.descriptors.LayoutDescriptors;
 import com.android.ide.eclipse.adt.internal.editors.layout.descriptors.ViewElementDescriptor;
 import com.android.ide.eclipse.adt.internal.editors.layout.gle2.CustomViewFinder;
 import com.android.ide.eclipse.adt.internal.editors.layout.gre.ViewMetadataRepository;
@@ -152,7 +155,9 @@ class ChangeViewWizard extends VisualRefactoringWizard {
                             targetData.getLayoutDescriptors().getViewDescriptors();
                         for (ViewElementDescriptor d : descriptors) {
                             String className = d.getFullClassName();
-                            if (className.equals(LayoutDescriptors.VIEW_INCLUDE)) {
+                            if (className.equals(VIEW_INCLUDE)
+                                    || className.equals(VIEW_FRAGMENT)
+                                    || className.equals(REQUEST_FOCUS)) {
                                 continue;
                             }
                             combo.add(d.getUiName());