aboutsummaryrefslogtreecommitdiff
path: root/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout
diff options
context:
space:
mode:
Diffstat (limited to 'eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout')
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/LayoutMetadataTest.java109
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/AdtProjectTest.java495
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ChangeLayoutRefactoringTest.java136
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ChangeViewRefactoringTest.java59
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ExtractIncludeRefactoringTest.java170
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ExtractStyleRefactoringTest.java232
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/RefactoringAssistantTest.java128
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/RefactoringTest.java334
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/UnwrapRefactoringTest.java58
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/UseCompoundDrawableRefactoringTest.java114
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/WrapInRefactoringTest.java59
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/TestFragment.java.txt15
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/aapterror1.xml12
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/aapterror2.xml9
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/aapterror3.xml6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/aapterror4.xml7
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/aapterror5.xml6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/aapterror6.xml11
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/aapterror7.xml10
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/anim1-expected-completion53.txt6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/anim1-expected-completion54.txt6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/anim1-expected-completion55.txt16
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/anim1-expected-completion56.txt14
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/anim1-expected-completion57.txt3
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/anim1.xml20
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/animator1-expected-completion58.txt4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/animator1-expected-completion59.txt10
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/animator1-expected-completion60.txt3
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/animator1-expected-completion61.txt19
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/animator1.xml27
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken1-expected-applyCompletion15.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken1-expected-completion20.txt2
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken1.xml12
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken2-expected-applyCompletion16.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken2-expected-completion21.txt7
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken2.xml12
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken3-expected-applyCompletion14.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken3-expected-completion19.txt2
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken3.xml12
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/color1-expected-completion45.txt2
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/color1-expected-completion46a.txt2
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/color1-expected-completion46b.txt20
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/color1.xml6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-actual-applyCompletion1.xml19
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion1.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion10.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion11a.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion11b.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion12.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion2.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion3.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion39.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion4.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion5.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion6.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion7a.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion7b.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion8.diff2
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion9.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion1.txt3
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion10.txt11
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion11.txt67
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion12.txt67
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion2.txt4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion3.txt2
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion39.txt156
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion4.txt7
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion5.txt2
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion6.txt23
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion7a.txt2
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion7b.txt2
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion8.txt2
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion9.txt4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1.xml19
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion10-expected-applyCompletion42.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion10-expected-applyCompletion43.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion10-expected-completion65.txt4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion10.xml10
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion11-expected-applyCompletion46.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion11-expected-complation79.txt10
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion11-expected-completion72.txt3
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion11-expected-completion73.txt16
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion11-expected-completion74.txt2
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion11.xml15
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion12-expected-completion75.txt96
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion12.xml7
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion2-expected-applyCompletion13a.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion2-expected-applyCompletion13b.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion2-expected-applyCompletion13c.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion2-expected-completion13a.txt15
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion2-expected-completion13b.txt4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion2-expected-completion13c.txt14
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion2.xml5
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion3-expected-applyCompletion17.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion3-expected-applyCompletion18.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion3.xml5
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion4-expected-completion22.txt2
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion4.xml11
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion5-expected-applyCompletion19.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion5-expected-applyCompletion20.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion5-expected-applyCompletion21.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion5-expected-applyCompletion40.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion5-expected-completion40.txt156
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion5.xml23
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion6-expected-applyCompletion22.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion6.xml7
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion7-expected-applyCompletion23.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion7.xml7
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion8-expected-applyCompletion41.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion8-expected-completion41.txt9
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion8-expected-completion42.txt4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion8-expected-completion43.txt9
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion8-expected-completion44.txt13
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion8.xml10
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion9-expected-completion62.txt2
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion9-expected-completion63.txt1
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion9-expected-completion64.txt68
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion9.xml10
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion24a.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion24b.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion25.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion26.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion27.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion28.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion29.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion30.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion31.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion32.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion33.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion34.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion35.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion36.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion37.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion38.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion44.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion23.txt7
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion24.txt7
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion25.txt8
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion26.txt2
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion27.txt15
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion28.txt15
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion29.txt3
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion30.txt8
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion31.txt2
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion32.txt317
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion33.txt3
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion34.txt3
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion35.txt3
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion36.txt2
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion37.txt2
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion38.txt6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion66.txt7
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion67.txt7
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion68.txt3
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1.xml20
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues2-expected-applyCompletion45.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues2-expected-completion70.txt3
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues2-expected-completion71.txt2
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues2.xml8
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/drawable1-expected-completion47.txt12
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/drawable1-expected-completion48.txt3
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/drawable1-expected-completion49.txt7
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/drawable1-expected-completion50.txt12
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/drawable1.xml5
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/drawable2-expected-completion51.txt10
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/drawable2-expected-completion52.txt7
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/drawable2.xml5
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/edithandling.xml3
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract1b.diff34
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract1c.diff31
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract1d.diff32
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract2.diff32
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract3.diff32
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract4.diff33
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract5.diff33
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract6.diff6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract8.diff31
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1.info3
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1.xml11
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle2-expected-extract7.diff33
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle2.info3
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle2.xml11
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/fragmentlayout-expected-applyCompletion47.diff4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/fragmentlayout-expected-complation77.txt5
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/fragmentlayout-expected-complation78.txt5
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/fragmentlayout-expected-navigate13.txt12
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/fragmentlayout-expected-navigate14.txt12
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/fragmentlayout.xml19
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-complation80.txt8
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-completion14.txt10
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-completion15.txt3
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-completion16.txt15
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-completion17.txt8
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-completion18.txt29
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-completion69.txt18
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-navigate10.txt6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-navigate11a.txt6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-navigate11g.txt6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-navigate9a.txt6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest.xml19
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/metadata.xml10
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1-expected-complation76.txt76
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1-expected-navigate1.txt7
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1-expected-navigate12.txt6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1-expected-navigate15.txt7
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1-expected-navigate16.txt7
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1-expected-navigate2.txt7
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1-expected-navigate3.txt7
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1-expected-navigate4.txt89
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1.xml18
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigationstyles-expected-extract2.diff5
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigationstyles-expected-navigate5.txt7
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigationstyles-expected-navigate6.txt7
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigationstyles-expected-navigate7.txt7
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigationstyles-expected-navigate8.txt7
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigationstyles.xml28
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newlayout1-expected-extract1.xml2
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newlayout2-expected-extract2.xml6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newlayout3-expected-extract3.xml2
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newlayout3-expected-extract4.xml2
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newlayout3-expected-extract5.xml6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newlayout6-expected-extract6.diff12
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newlayout6-expected-extract7.diff29
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles-expected-extract1.diff10
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles2-expected-extract1b.diff10
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles3-expected-extract1c.diff10
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles3-expected-extract8.diff10
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles4-expected-extract1d.diff10
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles4-expected-extract3.diff10
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles5-expected-extract4.diff9
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles6-expected-extract5.diff9
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles7-expected-extract6.diff13
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles8-expected-extract7.diff10
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/quickfix1-expected-quickFix1.xml7
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/quickfix1-expected-quickFix2.xml4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/quickfix1-expected-quickFix3.xml8
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/quickfix1.xml16
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/quickfix2-expected-quickFix4.xml4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/quickfix2.xml5
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound1-expected-1.xml16
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound1.info4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound1.xml25
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound2-expected-2.xml16
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound2.info5
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound2.xml25
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound3-expected-3.xml16
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound3.info4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound3.xml25
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound4-expected-4.xml16
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound4.info4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound4.xml25
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound5-expected-7.xml9
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound5.info3
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound5.xml18
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound6-expected-8.xml17
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound6.info4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound6.xml25
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound7-expected-9.xml17
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound7.info4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound7.xml27
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound_all-expected-5.xml73
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound_all-expected-6.xml74
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound_all.info13
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound_all.xml83
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample10-expected-convertFromGrid.xml35
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample10-expected-initialAttributes.xml35
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample10.info5
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample10.xml28
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample11-expected-insertSpacer.xml59
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample11.info11
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample11.xml92
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-assistant1.txt3
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-assistant2.txt7
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-assistant3.txt7
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-assistant4.txt3
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-changeLayout1a.xml75
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-changeView1.xml21
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-extract6.diff9
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-extract7.diff84
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-gridLayout1.xml61
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a.info13
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a.xml21
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1b-expected-changeLayout1b.xml75
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1b.info14
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1b.xml70
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample2-expected-changeLayout2.xml62
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample2-expected-changeView2.xml13
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample2-expected-extract3.xml13
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample2-expected-gridLayout2.xml67
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample2.info9
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample2.xml13
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-expected-changeLayout3.xml38
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-expected-extract1.xml7
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-expected-extract2.xml6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-expected-extract4.xml7
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-expected-extract5.xml6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-expected-wrapIn1.xml36
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-expected-wrapIn2.xml36
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-expected-wrapIn3.xml36
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-variation1-expected-extract4.xml9
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-variation1-expected-extract5.xml8
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-variation1.xml10
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-variation2-expected-extract4.xml7
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-variation2-expected-extract5.xml6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-variation2.xml8
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3.info5
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3.xml7
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample4-expected-changeLayout4.xml26
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample4.info5
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample4.xml8
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample5-expected-changeLayout5.xml70
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample5-expected-gridLayout5.xml51
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample5.info9
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample5.xml12
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample6-expected-changeLayout6.xml37
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample6.info5
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample6.xml7
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample7-expected-extract6.diff10
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample7-expected-extract7.diff69
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample7.info11
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample7.xml19
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample8-expected-extract6.diff15
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample8-expected-extract7.diff85
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample8.info12
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample8.xml40
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample9-expected-convertToGrid.xml37
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample9.info6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample9.xml39
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/unwrap-expected-unwrap1.xml20
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/unwrap-expected-unwrap2.xml20
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/unwrap-expected-unwrap3.xml19
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/unwrap.info4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/unwrap.xml26
333 files changed, 7184 insertions, 0 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/LayoutMetadataTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/LayoutMetadataTest.java
new file mode 100644
index 000000000..c71064eba
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/LayoutMetadataTest.java
@@ -0,0 +1,109 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Eclipse Public License, Version 1.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/org/documents/epl-v10.php
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.ide.eclipse.adt.internal.editors.layout.gle2;
+
+import static com.android.SdkConstants.ATTR_ID;
+import static com.android.SdkConstants.ID_PREFIX;
+import static com.android.SdkConstants.NEW_ID_PREFIX;
+import static com.android.SdkConstants.TOOLS_PREFIX;
+import static com.android.SdkConstants.TOOLS_URI;
+
+import com.android.ide.common.layout.BaseLayoutRule;
+import com.android.ide.eclipse.adt.AdtPlugin;
+import com.android.ide.eclipse.adt.AdtUtils;
+import com.android.ide.eclipse.adt.internal.editors.AndroidXmlEditor;
+import com.android.ide.eclipse.adt.internal.editors.layout.refactoring.AdtProjectTest;
+import com.android.ide.eclipse.adt.internal.editors.uimodel.UiElementNode;
+import com.android.utils.Pair;
+import com.android.utils.XmlUtils;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+/**
+ *
+ */
+@SuppressWarnings({"restriction", "javadoc", "deprecation"}) // XML DOM model
+public class LayoutMetadataTest extends AdtProjectTest {
+
+ public void testMetadata1() throws Exception {
+ Pair<IDocument, UiElementNode> pair = getNode("metadata.xml", "listView1");
+ UiElementNode uiNode = pair.getSecond();
+ Node node = uiNode.getXmlNode();
+
+ assertNull(LayoutMetadata.getProperty(node, "foo"));
+
+ Element element = (Element) node;
+ String prefix = XmlUtils.lookupNamespacePrefix(element, TOOLS_URI, null, false);
+ if (prefix == null) {
+ // Add in new prefix...
+ prefix = XmlUtils.lookupNamespacePrefix(element,
+ TOOLS_URI, TOOLS_PREFIX, true);
+ }
+ element.setAttribute(prefix + ':' + "foo", "bar");
+ }
+
+ // ==== Test utilities ====
+
+ private static String getText(IDocument document, Node node) throws Exception {
+ IndexedRegion region = (IndexedRegion) node;
+ // This often returns the wrong value:
+ //int length = region.getLength();
+ int length = region.getEndOffset() - region.getStartOffset();
+ return document.get(region.getStartOffset(), length);
+ }
+
+ private Pair<IDocument, UiElementNode> getNode(String filename, String targetId)
+ throws Exception, PartInitException {
+ IFile file = getLayoutFile(getProject(), filename);
+ AdtPlugin.openFile(file, null);
+ IEditorPart newEditor = AdtUtils.getActiveEditor();
+ assertTrue(newEditor instanceof AndroidXmlEditor);
+ AndroidXmlEditor xmlEditor = (AndroidXmlEditor) newEditor;
+ IStructuredDocument document = xmlEditor.getStructuredDocument();
+ UiElementNode root = xmlEditor.getUiRootNode();
+ assertNotNull(root);
+ UiElementNode node = findById(root, targetId);
+ assertNotNull(node);
+ Pair<IDocument, UiElementNode> pair = Pair.<IDocument, UiElementNode>of(document, node);
+ return pair;
+ }
+
+ private static UiElementNode findById(UiElementNode node, String targetId) {
+ assertFalse(targetId.startsWith(NEW_ID_PREFIX));
+ assertFalse(targetId.startsWith(ID_PREFIX));
+
+ String id = node.getAttributeValue(ATTR_ID);
+ if (id != null && targetId.equals(BaseLayoutRule.stripIdPrefix(id))) {
+ return node;
+ }
+
+ for (UiElementNode child : node.getUiChildren()) {
+ UiElementNode result = findById(child, targetId);
+ if (result != null) {
+ return result;
+ }
+ }
+
+ return null;
+ }
+}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/AdtProjectTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/AdtProjectTest.java
new file mode 100644
index 000000000..9c48ccdad
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/AdtProjectTest.java
@@ -0,0 +1,495 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Eclipse Public License, Version 1.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/org/documents/epl-v10.php
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.ide.eclipse.adt.internal.editors.layout.refactoring;
+
+import static com.android.SdkConstants.FD_RES;
+import static com.android.SdkConstants.FD_RES_LAYOUT;
+import static com.android.SdkConstants.FD_RES_VALUES;
+
+import com.android.ide.common.sdk.LoadStatus;
+import com.android.ide.eclipse.adt.AdtPlugin;
+import com.android.ide.eclipse.adt.AdtUtils;
+import com.android.ide.eclipse.adt.internal.editors.common.CommonXmlEditor;
+import com.android.ide.eclipse.adt.internal.editors.descriptors.AttributeDescriptor;
+import com.android.ide.eclipse.adt.internal.editors.descriptors.ElementDescriptor;
+import com.android.ide.eclipse.adt.internal.editors.layout.LayoutEditorDelegate;
+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.uimodel.UiViewElementNode;
+import com.android.ide.eclipse.adt.internal.editors.uimodel.UiDocumentNode;
+import com.android.ide.eclipse.adt.internal.preferences.AdtPrefs;
+import com.android.ide.eclipse.adt.internal.project.BaseProjectHelper;
+import com.android.ide.eclipse.adt.internal.sdk.AndroidTargetData;
+import com.android.ide.eclipse.adt.internal.sdk.Sdk;
+import com.android.ide.eclipse.adt.internal.wizards.newproject.NewProjectCreator;
+import com.android.ide.eclipse.adt.internal.wizards.newproject.NewProjectWizardState;
+import com.android.ide.eclipse.adt.internal.wizards.newproject.NewProjectWizardState.Mode;
+import com.android.ide.eclipse.tests.SdkLoadingTestCase;
+import com.android.sdklib.IAndroidTarget;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jface.operation.IRunnableContext;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.jface.text.source.ISourceViewer;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
+
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.InputStream;
+import java.lang.reflect.InvocationTargetException;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+@SuppressWarnings({"restriction", "javadoc"})
+public abstract class AdtProjectTest extends SdkLoadingTestCase {
+ private static final int TARGET_API_LEVEL = 16;
+ public static final String TEST_PROJECT_PACKAGE = "com.android.eclipse.tests"; //$NON-NLS-1$
+ private static final long TESTS_START_TIME = System.currentTimeMillis();
+ private static final String PROJECTNAME_PREFIX = "testproject-";
+
+ /**
+ * We don't stash the project used by each test case as a field such that test cases
+ * can share a single project instance (which is typically much faster).
+ * However, see {@link #getProjectName()} for exceptions to this sharing scheme.
+ */
+ private static Map<String, IProject> sProjectMap = new HashMap<String, IProject>();
+
+ @Override
+ protected String getTestDataRelPath() {
+ return "eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/"
+ + "internal/editors/layout/refactoring/testdata";
+ }
+
+ @Override
+ protected InputStream getTestResource(String relativePath, boolean expectExists) {
+ String path = "testdata" + File.separator + relativePath; //$NON-NLS-1$
+ InputStream stream =
+ AdtProjectTest.class.getResourceAsStream(path);
+ if (!expectExists && stream == null) {
+ return null;
+ }
+ return stream;
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ // Prevent preview icon computation during plugin test to make test faster
+ if (AdtPlugin.getDefault() == null) {
+ fail("This test must be run as an Eclipse plugin test, not a plain JUnit test!");
+ }
+ AdtPrefs.getPrefs().setPaletteModes("ICON_TEXT"); //$NON-NLS-1$
+
+ getProject();
+
+ Sdk current = Sdk.getCurrent();
+ assertNotNull(current);
+ LoadStatus sdkStatus = AdtPlugin.getDefault().getSdkLoadStatus();
+ assertSame(LoadStatus.LOADED, sdkStatus);
+ IAndroidTarget target = current.getTarget(getProject());
+ IJavaProject javaProject = BaseProjectHelper.getJavaProject(getProject());
+ assertNotNull(javaProject);
+ int iterations = 0;
+ while (true) {
+ if (iterations == 100) {
+ fail("Couldn't load target; ran out of time");
+ }
+ LoadStatus status = current.checkAndLoadTargetData(target, javaProject);
+ if (status == LoadStatus.FAILED) {
+ fail("Couldn't load target " + target);
+ }
+ if (status != LoadStatus.LOADING) {
+ break;
+ }
+ Thread.sleep(250);
+ iterations++;
+ }
+ AndroidTargetData targetData = current.getTargetData(target);
+ assertNotNull(targetData);
+ LayoutDescriptors layoutDescriptors = targetData.getLayoutDescriptors();
+ assertNotNull(layoutDescriptors);
+ List<ViewElementDescriptor> viewDescriptors = layoutDescriptors.getViewDescriptors();
+ assertNotNull(viewDescriptors);
+ assertTrue(viewDescriptors.size() > 0);
+ List<ViewElementDescriptor> layoutParamDescriptors =
+ layoutDescriptors.getLayoutDescriptors();
+ assertNotNull(layoutParamDescriptors);
+ assertTrue(layoutParamDescriptors.size() > 0);
+ }
+
+ /** Set to true if the subclass test case should use a per-instance project rather
+ * than a shared project. This is needed by projects which modify the project in such
+ * a way that it affects what other tests see (for example, the quickfix resource creation
+ * tests will add in new resources, which the code completion tests will then list as
+ * possible matches if the code completion test is run after the quickfix test.)
+ * @return true to create a per-instance project instead of the default shared project
+ */
+ protected boolean testCaseNeedsUniqueProject() {
+ return false;
+ }
+
+ protected boolean testNeedsUniqueProject() {
+ return false;
+ }
+
+ @Override
+ protected boolean validateSdk(IAndroidTarget target) {
+ // Not quite working yet. When enabled will make tests run faster.
+ //if (target.getVersion().getApiLevel() < TARGET_API_LEVEL) {
+ // return false;
+ //}
+
+ return true;
+ }
+
+ /** Returns a name to use for the project used in this test. Subclasses do not need to
+ * override this if they can share a project with others - which is the case if they do
+ * not modify the project in a way that does not affect other tests. For example
+ * the resource quickfix test will create new resources which affect what shows up
+ * in the code completion results, so the quickfix tests will override this method
+ * to produce a unique project for its own tests.
+ */
+ private String getProjectName() {
+ if (testNeedsUniqueProject()) {
+ return PROJECTNAME_PREFIX + getClass().getSimpleName() + "-" + getName();
+ } else if (testCaseNeedsUniqueProject()) {
+ return PROJECTNAME_PREFIX + getClass().getSimpleName();
+ } else {
+ return PROJECTNAME_PREFIX + TESTS_START_TIME;
+ }
+ }
+
+ protected IProject getProject() {
+ String projectName = getProjectName();
+ IProject project = sProjectMap.get(projectName);
+ if (project == null) {
+ project = createProject(projectName);
+ assertNotNull(project);
+ sProjectMap.put(projectName, project);
+ }
+ if (!testCaseNeedsUniqueProject() && !testNeedsUniqueProject()) {
+ addCleanupDir(AdtUtils.getAbsolutePath(project).toFile());
+ }
+ addCleanupDir(project.getFullPath().toFile());
+ return project;
+ }
+
+ protected IFile getTestDataFile(IProject project, String name) throws Exception {
+ return getTestDataFile(project, name, name);
+ }
+
+ protected IFile getLayoutFile(IProject project, String name) throws Exception {
+ return getTestDataFile(project, name, FD_RES + "/" + FD_RES_LAYOUT + "/" + name);
+ }
+
+ protected IFile getValueFile(IProject project, String name) throws Exception {
+ return getTestDataFile(project, name, FD_RES + "/" + FD_RES_VALUES + "/" + name);
+ }
+
+ protected IFile getTestDataFile(IProject project, String sourceName,
+ String destPath) throws Exception {
+ return getTestDataFile(project, sourceName, destPath, false);
+ }
+
+ protected IFile getTestDataFile(IProject project, String sourceName,
+ String destPath, boolean overwrite) throws Exception {
+ String[] split = destPath.split("/"); //$NON-NLS-1$
+ IContainer parent;
+ String name;
+ if (split.length == 1) {
+ parent = project;
+ name = destPath;
+ } else {
+ IFolder folder = project.getFolder(split[0]);
+ NullProgressMonitor monitor = new NullProgressMonitor();
+ if (!folder.exists()) {
+ folder.create(true /* force */, true /* local */, monitor);
+ }
+ for (int i = 1, n = split.length; i < n -1; i++) {
+ IFolder subFolder = folder.getFolder(split[i]);
+ if (!subFolder.exists()) {
+ subFolder.create(true /* force */, true /* local */, monitor);
+ }
+ folder = subFolder;
+ }
+ name = split[split.length - 1];
+ parent = folder;
+ }
+ IFile file = parent.getFile(new Path(name));
+ if (overwrite && file.exists()) {
+ String currentContents = AdtPlugin.readFile(file);
+ String newContents = readTestFile(sourceName, true);
+ if (currentContents == null || !currentContents.equals(newContents)) {
+ file.delete(true, new NullProgressMonitor());
+ } else {
+ return file;
+ }
+ }
+ if (!file.exists()) {
+ String xml = readTestFile(sourceName, true);
+ InputStream bstream = new ByteArrayInputStream(xml.getBytes("UTF-8")); //$NON-NLS-1$
+ NullProgressMonitor monitor = new NullProgressMonitor();
+ file.create(bstream, false /* force */, monitor);
+ }
+
+ return file;
+ }
+
+ protected IProject createProject(String name) {
+ IAndroidTarget target = null;
+
+ IAndroidTarget[] targets = getSdk().getTargets();
+ for (IAndroidTarget t : targets) {
+ if (!t.isPlatform()) {
+ continue;
+ }
+ if (t.getVersion().getApiLevel() >= TARGET_API_LEVEL) {
+ target = t;
+ break;
+ }
+ }
+ assertNotNull(target);
+
+ IRunnableContext context = new IRunnableContext() {
+ @Override
+ public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable)
+ throws InvocationTargetException, InterruptedException {
+ runnable.run(new NullProgressMonitor());
+ }
+ };
+ NewProjectWizardState state = new NewProjectWizardState(Mode.ANY);
+ state.projectName = name;
+ state.target = target;
+ state.packageName = TEST_PROJECT_PACKAGE;
+ state.activityName = name;
+ state.applicationName = name;
+ state.createActivity = false;
+ state.useDefaultLocation = true;
+ if (getMinSdk() != -1) {
+ state.minSdk = Integer.toString(getMinSdk());
+ }
+
+ NewProjectCreator creator = new NewProjectCreator(state, context);
+ creator.createAndroidProjects();
+ return validateProjectExists(name);
+ }
+
+ protected int getMinSdk() {
+ return -1;
+ }
+
+ public void createTestProject() {
+ IAndroidTarget target = null;
+
+ IAndroidTarget[] targets = getSdk().getTargets();
+ for (IAndroidTarget t : targets) {
+ if (t.getVersion().getApiLevel() >= TARGET_API_LEVEL) {
+ target = t;
+ break;
+ }
+ }
+ assertNotNull(target);
+ }
+
+ protected static IProject validateProjectExists(String name) {
+ IProject iproject = getProject(name);
+ assertTrue(String.format("%s project not created", name), iproject.exists());
+ assertTrue(String.format("%s project not opened", name), iproject.isOpen());
+ return iproject;
+ }
+
+ private static IProject getProject(String name) {
+ IProject iproject = ResourcesPlugin.getWorkspace().getRoot().getProject(name);
+ return iproject;
+ }
+
+ protected int getCaretOffset(IFile file, String caretLocation) {
+ assertTrue(caretLocation, caretLocation.contains("^"));
+
+ String fileContent = AdtPlugin.readFile(file);
+ return getCaretOffset(fileContent, caretLocation);
+ }
+
+ /**
+ * If the given caret location string contains a selection range, select that range in
+ * the given viewer
+ *
+ * @param viewer the viewer to contain the selection
+ * @param caretLocation the location string
+ */
+ protected int updateCaret(ISourceViewer viewer, String caretLocation) {
+ assertTrue(caretLocation, caretLocation.contains("^")); //$NON-NLS-1$
+
+ int caretDelta = caretLocation.indexOf("^"); //$NON-NLS-1$
+ assertTrue(caretLocation, caretDelta != -1);
+ String text = viewer.getTextWidget().getText();
+
+ int length = 0;
+
+ // String around caret/range without the range and caret marker characters
+ String caretContext;
+
+ if (caretLocation.contains("[^")) { //$NON-NLS-1$
+ caretDelta--;
+ assertTrue(caretLocation, caretLocation.startsWith("[^", caretDelta)); //$NON-NLS-1$
+
+ int caretRangeEnd = caretLocation.indexOf(']', caretDelta + 2);
+ assertTrue(caretLocation, caretRangeEnd != -1);
+ length = caretRangeEnd - caretDelta - 2;
+ assertTrue(length > 0);
+ caretContext = caretLocation.substring(0, caretDelta)
+ + caretLocation.substring(caretDelta + 2, caretRangeEnd)
+ + caretLocation.substring(caretRangeEnd + 1);
+ } else {
+ caretContext = caretLocation.substring(0, caretDelta)
+ + caretLocation.substring(caretDelta + 1); // +1: skip "^"
+ }
+
+ int caretContextIndex = text.indexOf(caretContext);
+
+ assertTrue("Caret content " + caretContext + " not found in file",
+ caretContextIndex != -1);
+
+ int offset = caretContextIndex + caretDelta;
+ viewer.setSelectedRange(offset, length);
+
+ return offset;
+ }
+
+ protected String addSelection(String newFileContents, Point selectedRange) {
+ int selectionBegin = selectedRange.x;
+ int selectionEnd = selectionBegin + selectedRange.y;
+ return addSelection(newFileContents, selectionBegin, selectionEnd);
+ }
+
+ @Override
+ protected String removeSessionData(String data) {
+ data = super.removeSessionData(data);
+ if (getProject() != null) {
+ data = data.replace(getProject().getName(), "PROJECTNAME");
+ }
+
+ return data;
+ }
+
+ public static ViewElementDescriptor createDesc(String name, String fqn, boolean hasChildren) {
+ if (hasChildren) {
+ return new ViewElementDescriptor(name, name, fqn, "", "", new AttributeDescriptor[0],
+ new AttributeDescriptor[0], new ElementDescriptor[1], false);
+ } else {
+ return new ViewElementDescriptor(name, fqn);
+ }
+ }
+
+ public static UiViewElementNode createNode(UiViewElementNode parent, String fqn,
+ boolean hasChildren) {
+ String name = fqn.substring(fqn.lastIndexOf('.') + 1);
+ ViewElementDescriptor descriptor = createDesc(name, fqn, hasChildren);
+ if (parent == null) {
+ // All node hierarchies should be wrapped inside a document node at the root
+ parent = new UiViewElementNode(createDesc("doc", "doc", true));
+ }
+ return (UiViewElementNode) parent.appendNewUiChild(descriptor);
+ }
+
+ public static UiViewElementNode createNode(String fqn, boolean hasChildren) {
+ return createNode(null, fqn, hasChildren);
+ }
+
+ /** Special editor context set on the model to be rendered */
+ protected static class TestLayoutEditorDelegate extends LayoutEditorDelegate {
+
+ public TestLayoutEditorDelegate(
+ IFile file,
+ IStructuredDocument structuredDocument,
+ UiDocumentNode uiRootNode) {
+ super(new TestAndroidXmlCommonEditor(file, structuredDocument, uiRootNode));
+ }
+
+ static class TestAndroidXmlCommonEditor extends CommonXmlEditor {
+
+ private final IFile mFile;
+ private final IStructuredDocument mStructuredDocument;
+ private UiDocumentNode mUiRootNode;
+
+ TestAndroidXmlCommonEditor(
+ IFile file,
+ IStructuredDocument structuredDocument,
+ UiDocumentNode uiRootNode) {
+ mFile = file;
+ mStructuredDocument = structuredDocument;
+ mUiRootNode = uiRootNode;
+ }
+
+ @Override
+ public IFile getInputFile() {
+ return mFile;
+ }
+
+ @Override
+ public IProject getProject() {
+ return mFile.getProject();
+ }
+
+ @Override
+ public IStructuredDocument getStructuredDocument() {
+ return mStructuredDocument;
+ }
+
+ @Override
+ public UiDocumentNode getUiRootNode() {
+ return mUiRootNode;
+ }
+
+ @Override
+ public void editorDirtyStateChanged() {
+ }
+
+ @Override
+ public IStructuredModel getModelForRead() {
+ IModelManager mm = StructuredModelManager.getModelManager();
+ if (mm != null) {
+ try {
+ return mm.getModelForRead(mFile);
+ } catch (Exception e) {
+ fail(e.toString());
+ }
+ }
+
+ return null;
+ }
+ }
+ }
+
+ public void testDummy() {
+ // This class contains shared test functionality for testcase subclasses,
+ // but without an actual test in the class JUnit complains (even if we make
+ // it abstract)
+ }
+}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ChangeLayoutRefactoringTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ChangeLayoutRefactoringTest.java
new file mode 100644
index 000000000..a716a75a3
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ChangeLayoutRefactoringTest.java
@@ -0,0 +1,136 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Eclipse Public License, Version 1.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/org/documents/epl-v10.php
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.ide.eclipse.adt.internal.editors.layout.refactoring;
+
+import static com.android.SdkConstants.FQCN_GRID_LAYOUT;
+import static com.android.SdkConstants.FQCN_LINEAR_LAYOUT;
+import static com.android.SdkConstants.FQCN_RELATIVE_LAYOUT;
+
+import com.android.ide.eclipse.adt.internal.editors.layout.gle2.CanvasViewInfo;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.ltk.core.refactoring.Change;
+import org.w3c.dom.Element;
+
+import java.util.Collections;
+import java.util.List;
+
+@SuppressWarnings("javadoc")
+public class ChangeLayoutRefactoringTest extends RefactoringTest {
+
+ public void testChangeLayout1a() throws Exception {
+ // Test a basic layout which performs some nesting -- tests basic grid layout conversion
+ checkRefactoring("sample1a.xml", true);
+ }
+
+ public void testChangeLayout1b() throws Exception {
+ // Same as 1a, but with different formatting to look for edit handling to for example
+ // remove a line that is made empty when its only attribute is removed
+ checkRefactoring("sample1b.xml", true);
+ }
+
+ public void testChangeLayout2() throws Exception {
+ // Test code which analyzes an embedded RelativeLayout
+ checkRefactoring("sample2.xml", true);
+ }
+
+ public void testChangeLayout3() throws Exception {
+ // Test handling of LinearLayout "weight" attributes on its children: the child with
+ // weight > 0 should fill and subsequent children attach on the bottom/right
+ checkRefactoring("sample3.xml", true);
+ }
+
+ public void testChangeLayout4() throws Exception {
+ checkRefactoring("sample4.xml", true);
+ }
+
+ public void testChangeLayout5() throws Exception {
+ // Test handling of LinearLayout "gravity" attributes on its children
+ checkRefactoring("sample5.xml", true);
+ }
+
+ public void testChangeLayout6() throws Exception {
+ // Check handling of the LinearLayout "baseline" attribute
+ checkRefactoring("sample6.xml", true);
+ }
+
+ public void testGridLayout1() throws Exception {
+ checkRefactoring(FQCN_GRID_LAYOUT, "sample1a.xml", true);
+ }
+
+ public void testGridLayout2() throws Exception {
+ // Test code which analyzes an embedded RelativeLayout
+ checkRefactoring(FQCN_GRID_LAYOUT, "sample2.xml", true);
+ }
+
+ public void testGridLayout5() throws Exception {
+ // Test handling of LinearLayout "gravity" attributes on its children
+ checkRefactoring(FQCN_GRID_LAYOUT, "sample5.xml", true);
+ }
+
+ public void testConvertToGrid() throws Exception {
+ checkRefactoring(FQCN_GRID_LAYOUT, "sample9.xml", true);
+ }
+
+ public void testConvertFromGrid() throws Exception {
+ checkRefactoring(FQCN_LINEAR_LAYOUT, "sample10.xml", true);
+ }
+
+ private void checkRefactoring(String basename, boolean flatten) throws Exception {
+ checkRefactoring(FQCN_RELATIVE_LAYOUT, basename, flatten);
+ }
+
+ public void testInitialAttributes() throws Exception {
+ checkRefactoring(FQCN_LINEAR_LAYOUT, "sample10.xml", true, "android:orientation=vertical");
+ }
+
+ public void testInsertSpacer() throws Exception {
+ checkRefactoring(FQCN_GRID_LAYOUT, "sample11.xml", true);
+ }
+
+ private void checkRefactoring(String newLayoutType, String basename,
+ boolean flatten) throws Exception {
+ checkRefactoring(newLayoutType, basename, flatten, null);
+ }
+
+ @Override
+ protected int getMinSdk() {
+ return 14;
+ }
+
+ private void checkRefactoring(String newLayoutType, String basename,
+ boolean flatten, String initialAttributes) throws Exception {
+ IFile file = getLayoutFile(getProject(), basename);
+ TestContext info = setupTestContext(file, basename);
+ TestLayoutEditorDelegate layoutEditor = info.mLayoutEditorDelegate;
+ CanvasViewInfo rootView = info.mRootView;
+ Element element = info.mElement;
+
+ List<Element> selectedElements = Collections.singletonList(element);
+ ChangeLayoutRefactoring refactoring = new ChangeLayoutRefactoring(selectedElements,
+ layoutEditor);
+ refactoring.setFlatten(flatten);
+ refactoring.setType(newLayoutType);
+ if (initialAttributes != null) {
+ refactoring.setInitializedAttributes(initialAttributes);
+ }
+ refactoring.setRootView(rootView);
+
+ List<Change> changes = refactoring.computeChanges(new NullProgressMonitor());
+ checkEdits(basename, changes);
+ }
+}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ChangeViewRefactoringTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ChangeViewRefactoringTest.java
new file mode 100644
index 000000000..582ed0f27
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ChangeViewRefactoringTest.java
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Eclipse Public License, Version 1.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/org/documents/epl-v10.php
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.ide.eclipse.adt.internal.editors.layout.refactoring;
+
+import static com.android.SdkConstants.FQCN_RADIO_BUTTON;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.ltk.core.refactoring.Change;
+import org.w3c.dom.Element;
+
+import java.util.List;
+
+public class ChangeViewRefactoringTest extends RefactoringTest {
+
+ public void testChangeView1() throws Exception {
+ checkRefactoring("sample1a.xml", FQCN_RADIO_BUTTON, "@+id/button1", "@+id/button6");
+ }
+
+ public void testChangeView2() throws Exception {
+ // Tests (1) updating references to the renamed id of the changed widgets
+ // (e.g. button3 is renamed to imageButton1 and layout references to button3
+ // must be updated), and (2) removal of attributes not available in the new type
+ // (the text property is removed since it is not available on the new widget
+ // type ImageButton)
+ checkRefactoring("sample2.xml", "android.widget.ImageButton",
+ "@+id/button3", "@+id/button5");
+ }
+
+ private void checkRefactoring(String basename, String newType,
+ String... ids) throws Exception {
+ assertTrue(ids.length > 0);
+
+ IFile file = getLayoutFile(getProject(), basename);
+ TestContext info = setupTestContext(file, basename);
+ TestLayoutEditorDelegate layoutEditor = info.mLayoutEditorDelegate;
+ List<Element> selectedElements = getElements(info.mElement, ids);
+
+ ChangeViewRefactoring refactoring = new ChangeViewRefactoring(selectedElements,
+ layoutEditor);
+ refactoring.setType(newType);
+
+ List<Change> changes = refactoring.computeChanges(new NullProgressMonitor());
+ checkEdits(basename, changes);
+ }
+}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ExtractIncludeRefactoringTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ExtractIncludeRefactoringTest.java
new file mode 100644
index 000000000..1667649c5
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ExtractIncludeRefactoringTest.java
@@ -0,0 +1,170 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Eclipse Public License, Version 1.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/org/documents/epl-v10.php
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.ide.eclipse.adt.internal.editors.layout.refactoring;
+
+import static com.android.SdkConstants.DOT_XML;
+
+import com.android.ide.eclipse.adt.AdtPlugin;
+import com.android.ide.eclipse.adt.internal.preferences.AdtPrefs;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.ltk.core.refactoring.Change;
+import org.eclipse.ltk.core.refactoring.TextFileChange;
+import org.w3c.dom.Element;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class ExtractIncludeRefactoringTest extends RefactoringTest {
+
+ @Override
+ protected boolean autoFormat() {
+ return false;
+ }
+
+ @Override
+ protected boolean testCaseNeedsUniqueProject() {
+ // Because some of these tests look at ALL layouts in the project
+ // to identify matches
+ return true;
+ }
+
+ public void testExtract1() throws Exception {
+ // Basic: Extract a single button
+ checkRefactoring("sample3.xml", "newlayout1", false, null, 2, false /* diffs */,
+ "@+id/button2");
+ }
+
+ public void testExtract2() throws Exception {
+ // Extract a couple of elements
+ checkRefactoring("sample3.xml", "newlayout2", false, null, 2, false /* diffs */,
+ "@+id/button2", "@+id/android_logo");
+ }
+
+ public void testExtract3() throws Exception {
+ // Test to make sure layout attributes are updated
+ checkRefactoring("sample2.xml", "newlayout3", false, null, 2, false /* diffs */,
+ "@+id/button3");
+ }
+
+ public void testExtract4() throws Exception {
+ // Tests extracting from -multiple- files (as well as with custom android namespace
+ // prefix)
+
+ // Make sure the variation-files exist
+ Map<IPath, String> extraFiles = new HashMap<IPath, String>();
+ extraFiles.put(getTestDataFile(getProject(), "sample3-variation1.xml",
+ "res/layout-land/sample3.xml").getProjectRelativePath(),
+ "sample3-variation1.xml");
+ extraFiles.put(getTestDataFile(getProject(), "sample3-variation2.xml",
+ "res/layout-xlarge-land/sample3.xml").getProjectRelativePath(),
+ "sample3-variation2.xml");
+
+ checkRefactoring("sample3.xml", "newlayout3", true, extraFiles, 4, false /* diffs */,
+ "@+id/android_logo");
+ }
+
+ public void testExtract5() throws Exception {
+ // Tests extracting from multiple files with -contiguous regions-.
+
+ // Make sure the variation-files exist
+ Map<IPath, String> extraFiles = new HashMap<IPath, String>();
+ extraFiles.put(getTestDataFile(getProject(), "sample3-variation1.xml",
+ "res/layout-land/sample3.xml").getProjectRelativePath(),
+ "sample3-variation1.xml");
+ extraFiles.put(getTestDataFile(getProject(), "sample3-variation2.xml",
+ "res/layout-xlarge-land/sample3.xml").getProjectRelativePath(),
+ "sample3-variation2.xml");
+
+ checkRefactoring("sample3.xml", "newlayout3", true, extraFiles, 4, false /* diffs */,
+ "@+id/android_logo", "@+id/button1");
+ }
+
+ public void testExtract6() throws Exception {
+ // Tests extracting from multiple files where the layouts are completely
+ // different/unrelated files
+
+ // Create the duplicate files
+ Map<IPath, String> extraFiles = new HashMap<IPath, String>();
+ extraFiles.put(getTestDataFile(getProject(), "sample1a.xml",
+ "res/layout/sample1a.xml").getProjectRelativePath(),
+ "sample1a.xml");
+ extraFiles.put(getTestDataFile(getProject(), "sample7.xml", "res/layout/sample7.xml")
+ .getProjectRelativePath(), "sample7.xml");
+ extraFiles.put(getTestDataFile(getProject(), "sample8.xml", "res/layout/sample8.xml")
+ .getProjectRelativePath(), "sample8.xml");
+
+ checkRefactoring("sample7.xml", "newlayout6", true, extraFiles, 4, true /* diffs */,
+ "@+id/linearLayout4");
+ }
+
+ public void testExtract7() throws Exception {
+ // Just like testExtract6, except we turn on auto-formatting
+ IPreferenceStore store = AdtPlugin.getDefault().getPreferenceStore();
+ AdtPrefs.init(store);
+ AdtPrefs prefs = AdtPrefs.getPrefs();
+ prefs.initializeStoreWithDefaults(store);
+ store.setValue(AdtPrefs.PREFS_FORMAT_GUI_XML, true);
+ prefs.loadValues(null);
+
+ assertTrue(AdtPrefs.getPrefs().getFormatGuiXml());
+
+ testExtract6();
+ }
+
+
+ private void checkRefactoring(String basename, String layoutName,
+ boolean replaceOccurrences, Map<IPath,String> extraFiles,
+ int expectedModifiedFileCount, boolean createDiffs, String... ids) throws Exception {
+ assertTrue(ids.length > 0);
+
+ IFile file = getLayoutFile(getProject(), basename);
+ TestContext info = setupTestContext(file, basename);
+ TestLayoutEditorDelegate layoutEditor = info.mLayoutEditorDelegate;
+ List<Element> selectedElements = getElements(info.mElement, ids);
+
+ ExtractIncludeRefactoring refactoring = new ExtractIncludeRefactoring(selectedElements,
+ layoutEditor);
+ refactoring.setLayoutName(layoutName);
+ refactoring.setReplaceOccurrences(replaceOccurrences);
+ List<Change> changes = refactoring.computeChanges(new NullProgressMonitor());
+
+ assertTrue(changes.size() >= 3);
+
+ Map<IPath,String> fileToGolden = new HashMap<IPath,String>();
+ IPath sourcePath = file.getProjectRelativePath();
+ fileToGolden.put(sourcePath, basename);
+ IPath newPath = sourcePath.removeLastSegments(1).append(layoutName + DOT_XML);
+ fileToGolden.put(newPath, layoutName + DOT_XML);
+ if (extraFiles != null) {
+ fileToGolden.putAll(extraFiles);
+ }
+
+ checkEdits(changes, fileToGolden, createDiffs);
+
+ int modifiedFileCount = 0;
+ for (Change change : changes) {
+ if (change instanceof TextFileChange) {
+ modifiedFileCount++;
+ }
+ }
+ assertEquals(expectedModifiedFileCount, modifiedFileCount);
+ }
+}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ExtractStyleRefactoringTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ExtractStyleRefactoringTest.java
new file mode 100644
index 000000000..f64555dd6
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ExtractStyleRefactoringTest.java
@@ -0,0 +1,232 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Eclipse Public License, Version 1.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/org/documents/epl-v10.php
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.ide.eclipse.adt.internal.editors.layout.refactoring;
+
+import com.android.utils.Pair;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jface.text.ITextSelection;
+import org.eclipse.jface.text.TextSelection;
+import org.eclipse.ltk.core.refactoring.Change;
+import org.eclipse.ltk.core.refactoring.TextFileChange;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.ide.IDE;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Element;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+public class ExtractStyleRefactoringTest extends RefactoringTest {
+ @Override
+ protected boolean testCaseNeedsUniqueProject() {
+ return true;
+ }
+
+ public void testExtract1() throws Exception {
+ // Test extracting into a new style file
+ checkRefactoring("extractstyle1.xml", "newstyles.xml", "newstyle",
+ false /* removeExtracted */, false /* applyStyle */, null, 1, "@+id/button2");
+ }
+
+ public void testExtract1b() throws Exception {
+ // Extract and apply new style
+ checkRefactoring("extractstyle1.xml", "newstyles2.xml", "newstyle",
+ false /* removeExtracted */, true /* applyStyle */, null, 2, "@+id/button2");
+ }
+
+ public void testExtract1c() throws Exception {
+ // Extract and remove extracted
+ checkRefactoring("extractstyle1.xml", "newstyles3.xml", "newstyle",
+ true /* removeExtracted */, false /* applyStyle */, null, 2, "@+id/button2");
+ }
+
+ public void testExtract1d() throws Exception {
+ // Extract and apply style and remove extracted
+ checkRefactoring("extractstyle1.xml", "newstyles4.xml", "newstyle",
+ true /* removeExtracted */, true /* applyStyle */, null, 2, "@+id/button2");
+ }
+
+ public void testExtract2() throws Exception {
+ getTestDataFile(getProject(), "navigationstyles.xml", "res/values/navigationstyles.xml");
+
+ // -Modify- the existing styles.xml file
+ checkRefactoring("extractstyle1.xml", "navigationstyles.xml", "newstyle",
+ true /* removeExtracted */, true /* applyStyle */, null, 2, "@+id/button2");
+ }
+
+ public void testExtract3() throws Exception {
+ // Select multiple elements - overlap in values.
+ checkRefactoring("extractstyle1.xml", "newstyles4.xml", "newstyle",
+ true /* removeExtracted */, true /* applyStyle */, null, 2,
+ "@+id/button1", "@+id/button2");
+ }
+
+ // This test fails for some reason - not in the refactoring (checked manually)
+ // but the DOM model returns null when run in a test context.
+ public void testExtract4() throws Exception {
+ // Test extracting on a single caret position over an attribute: Should extract
+ // just that one attribute
+ checkRefactoringByOffset("extractstyle1.xml", "newstyles5.xml", "newstyle",
+ true /* removeExtracted */, true /* applyStyle */, null, 2,
+ "android:text^Color=\"#FF00FF\"", "android:text^Color=\"#FF00FF\"");
+ }
+
+ public void testExtract5() throws Exception {
+ // Test extracting on a range selection inside an element: should extract just
+ // the attributes that overlap the selection
+ checkRefactoringByOffset("extractstyle1.xml", "newstyles6.xml", "newstyle",
+ true /* removeExtracted */, true /* applyStyle */, null, 2,
+ "android:^textSize=\"20pt",
+ "android:id=\"@+id/button1\" android:layout_a^lignParentBottom");
+ }
+
+ public void testExtract6() throws Exception {
+ // Test extracting on a single caret position which is not over any attributes:
+ checkRefactoringByOffset("extractstyle1.xml", "newstyles7.xml", "newstyle",
+ true /* removeExtracted */, true /* applyStyle */, null, 0,
+ "<Bu^tton", "<Bu^tton");
+ }
+
+ public void testExtract7() throws Exception {
+ // Verify that even with a different namespace prefix we end up with android:
+ // in the extracted style
+ checkRefactoring("extractstyle2.xml", "newstyles8.xml", "newstyle",
+ true /* removeExtracted */, true /* applyStyle */, null, 2,
+ "@+id/button1", "@+id/button2");
+ }
+
+ public void testExtract8() throws Exception {
+ // Test setting parent style
+ checkRefactoring("extractstyle1.xml", "newstyles3.xml", "newstyle",
+ true /* removeExtracted */, false /* applyStyle */, "android:Widget.Button",
+ 2, "@+id/button2");
+ }
+
+ // Check extract style on a selection of elements
+ private void checkRefactoring(String basename, String styleFileName, String newStyleName,
+ boolean removeExtracted, boolean applyStyle, String parentStyle,
+ int expectedModifiedFileCount, String... ids) throws Exception {
+ assertTrue(ids.length > 0);
+
+ IFile file = getLayoutFile(getProject(), basename);
+ TestContext info = setupTestContext(file, basename);
+ TestLayoutEditorDelegate layoutEditor = info.mLayoutEditorDelegate;
+ List<Element> selectedElements = getElements(info.mElement, ids);
+
+ // Open the file such that ModelManager.getExistingModelForRead() in DomUtilities
+ // will succeed
+ IWorkbench workbench = PlatformUI.getWorkbench();
+ IWorkbenchWindow activeWorkbenchWindow = workbench.getActiveWorkbenchWindow();
+ IWorkbenchPage page = activeWorkbenchWindow.getActivePage();
+ IDE.openEditor(page, file);
+
+ ExtractStyleRefactoring refactoring = new ExtractStyleRefactoring(selectedElements,
+ layoutEditor);
+ checkRefactoring(basename, styleFileName, newStyleName, removeExtracted, applyStyle,
+ parentStyle, expectedModifiedFileCount, file, refactoring);
+ }
+
+ // Check extract style against a set of editor text locations
+ private void checkRefactoringByOffset(String basename, String styleFileName,
+ String newStyleName, boolean removeExtracted, boolean applyStyle,
+ String parentStyle,
+ int expectedModifiedFileCount, String beginCaretLocation, String endCaretLocation)
+ throws Exception {
+ IFile file = getLayoutFile(getProject(), basename);
+ int beginOffset = getCaretOffset(file, beginCaretLocation);
+ int endOffset = getCaretOffset(file, endCaretLocation);
+
+ TestContext info = setupTestContext(file, basename);
+ TestLayoutEditorDelegate layoutEditor = info.mLayoutEditorDelegate;
+
+ // Open the file such that ModelManager.getExistingModelForRead() in DomUtilities
+ // will succeed
+ IWorkbench workbench = PlatformUI.getWorkbench();
+ IWorkbenchWindow activeWorkbenchWindow = workbench.getActiveWorkbenchWindow();
+ IWorkbenchPage page = activeWorkbenchWindow.getActivePage();
+ IDE.openEditor(page, file);
+
+ ITextSelection selection = new TextSelection(beginOffset, endOffset - beginOffset);
+ ExtractStyleRefactoring refactoring = new ExtractStyleRefactoring(file,
+ layoutEditor, selection, null);
+ checkRefactoring(basename, styleFileName, newStyleName, removeExtracted, applyStyle,
+ parentStyle, expectedModifiedFileCount, file, refactoring);
+ }
+
+ // Common test code used by the other two check methods
+ private void checkRefactoring(String basename, String styleFileName, String newStyleName,
+ boolean removeExtracted, boolean applyStyle, String parentStyle,
+ int expectedModifiedFileCount, IFile file,
+ ExtractStyleRefactoring refactoring) throws Exception {
+ refactoring.setStyleName(newStyleName);
+ refactoring.setApplyStyle(applyStyle);
+ refactoring.setRemoveExtracted(removeExtracted);
+ refactoring.setStyleFileName(styleFileName);
+ refactoring.setParent(parentStyle);
+
+ // Pick the attributes to extract -- for now everything (and where there are
+ // conflicting values, pick the first one)
+ Pair<Map<String, List<Attr>>, Set<Attr>> result = refactoring.getAvailableAttributes();
+ Map<String, List<Attr>> availableAttributes = result.getFirst();
+ Set<Attr> selected = result.getSecond();
+ List<Attr> chosenAttributes = new ArrayList<Attr>();
+ for (List<Attr> list : availableAttributes.values()) {
+ Collections.sort(list, new Comparator<Attr>() {
+ @Override
+ public int compare(Attr a1, Attr a2) {
+ return a1.getValue().compareTo(a2.getValue());
+ }
+ });
+ Attr attr = list.get(0);
+ if (selected.contains(attr)) {
+ chosenAttributes.add(attr);
+ }
+ }
+ refactoring.setChosenAttributes(chosenAttributes);
+
+ List<Change> changes = refactoring.computeChanges(new NullProgressMonitor());
+ assertEquals(expectedModifiedFileCount, changes.size());
+
+ Map<IPath,String> fileToGolden = new HashMap<IPath,String>();
+ IPath sourcePath = file.getProjectRelativePath();
+ fileToGolden.put(sourcePath, basename);
+ IPath newPath = refactoring.getStyleFile(getProject()).getProjectRelativePath();
+ fileToGolden.put(newPath, styleFileName);
+
+ checkEdits(changes, fileToGolden, true);
+
+ int modifiedFileCount = 0;
+ for (Change change : changes) {
+ if (change instanceof TextFileChange) {
+ modifiedFileCount++;
+ }
+ }
+ assertEquals(expectedModifiedFileCount, modifiedFileCount);
+ }
+
+}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/RefactoringAssistantTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/RefactoringAssistantTest.java
new file mode 100644
index 000000000..b22717991
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/RefactoringAssistantTest.java
@@ -0,0 +1,128 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Eclipse Public License, Version 1.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/org/documents/epl-v10.php
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.ide.eclipse.adt.internal.editors.layout.refactoring;
+
+import static com.android.SdkConstants.FD_RES;
+import static com.android.SdkConstants.FD_RES_LAYOUT;
+
+import com.android.ide.eclipse.adt.AdtPlugin;
+import com.android.ide.eclipse.adt.internal.editors.AndroidXmlEditor;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.jface.text.quickassist.IQuickAssistInvocationContext;
+import org.eclipse.jface.text.source.ISourceViewer;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.ide.IDE;
+
+public class RefactoringAssistantTest extends AdtProjectTest {
+ public void testAssistant1() throws Exception {
+ // "Extract String"
+ checkFixes("sample1a.xml", "<Button android:text=\"Fir^stButton\"");
+ }
+
+ public void testAssistant2() throws Exception {
+ // Visual refactoring operations
+ checkFixes("sample1a.xml", "<Bu^tton android:text");
+ }
+
+ public void testAssistant3() throws Exception {
+ checkFixes("sample1a.xml", "<Button andr^oid:text=\"FirstButton\"");
+ }
+
+ public void testAssistant4() throws Exception {
+ // Check for resource rename refactoring (and don't offer extract string)
+ checkFixes("sample1a.xml", "android:id=\"@+id/Linea^rLayout2\"");
+ }
+
+ private void checkFixes(String name, String caretLocation)
+ throws Exception {
+ IProject project = getProject();
+ IFile file = getTestDataFile(project, name, FD_RES + "/" + FD_RES_LAYOUT + "/" + name);
+
+ // Determine the offset
+ String fileContent = AdtPlugin.readFile(file);
+ int caretDelta = caretLocation.indexOf("^");
+ assertTrue(caretLocation, caretDelta != -1);
+ String caretContext = caretLocation.substring(0, caretDelta)
+ + caretLocation.substring(caretDelta + "^".length());
+ int caretContextIndex = fileContent.indexOf(caretContext);
+ assertTrue("Caret content " + caretContext + " not found in file",
+ caretContextIndex != -1);
+ final int offset = caretContextIndex + caretDelta;
+
+
+ RefactoringAssistant refactoringAssistant = new RefactoringAssistant();
+
+ // Open file
+ IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ assertNotNull(page);
+ IEditorPart editor = IDE.openEditor(page, file);
+ assertTrue(editor instanceof AndroidXmlEditor);
+ AndroidXmlEditor layoutEditor = (AndroidXmlEditor) editor;
+ final ISourceViewer viewer = layoutEditor.getStructuredSourceViewer();
+
+ IQuickAssistInvocationContext invocationContext = new IQuickAssistInvocationContext() {
+ @Override
+ public int getLength() {
+ return 0;
+ }
+
+ @Override
+ public int getOffset() {
+ return offset;
+ }
+
+ @Override
+ public ISourceViewer getSourceViewer() {
+ return viewer;
+ }
+ };
+ ICompletionProposal[] proposals = refactoringAssistant
+ .computeQuickAssistProposals(invocationContext);
+
+ if (proposals != null) {
+ for (ICompletionProposal proposal : proposals) {
+ assertNotNull(proposal.getAdditionalProposalInfo());
+ assertNotNull(proposal.getImage());
+ }
+ }
+
+ StringBuilder sb = new StringBuilder(1000);
+ sb.append("Quick assistant in " + name + " for " + caretLocation + ":\n");
+ if (proposals != null) {
+ for (ICompletionProposal proposal : proposals) {
+ sb.append(proposal.getDisplayString());
+ String help = proposal.getAdditionalProposalInfo();
+ if (help != null && help.trim().length() > 0) {
+ sb.append(" : ");
+ sb.append(help.replace('\n', ' '));
+ }
+ sb.append('\n');
+ }
+ } else {
+ sb.append("None found.\n");
+ }
+ assertEqualsGolden(name, sb.toString(), "txt");
+
+ // No "apply" test on these assists since they are interactive. Refactoring
+ // is tested elsewhere.
+ }
+}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/RefactoringTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/RefactoringTest.java
new file mode 100644
index 000000000..9565183bc
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/RefactoringTest.java
@@ -0,0 +1,334 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Eclipse Public License, Version 1.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/org/documents/epl-v10.php
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.ide.eclipse.adt.internal.editors.layout.refactoring;
+
+import static com.android.SdkConstants.ANDROID_WIDGET_PREFIX;
+import static com.android.SdkConstants.DOT_XML;
+
+import com.android.ide.common.rendering.api.ViewInfo;
+import com.android.ide.eclipse.adt.AdtPlugin;
+import com.android.ide.eclipse.adt.internal.editors.layout.gle2.CanvasViewInfo;
+import com.android.ide.eclipse.adt.internal.editors.layout.gle2.DomUtilities;
+import com.android.ide.eclipse.adt.internal.editors.layout.uimodel.UiViewElementNode;
+import com.android.ide.eclipse.adt.internal.editors.uimodel.UiElementNode;
+import com.android.ide.eclipse.adt.internal.preferences.AdtPrefs;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.Document;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.ltk.core.refactoring.Change;
+import org.eclipse.ltk.core.refactoring.TextFileChange;
+import org.eclipse.text.edits.MultiTextEdit;
+import org.eclipse.text.edits.TextEdit;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+import org.w3c.dom.Element;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+@SuppressWarnings("restriction")
+public class RefactoringTest extends AdtProjectTest {
+
+ protected boolean autoFormat() {
+ return true;
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+
+ // Ensure that the defaults are initialized so for example formatting options are
+ // initialized properly
+ IPreferenceStore store = AdtPlugin.getDefault().getPreferenceStore();
+ AdtPrefs.init(store);
+ AdtPrefs prefs = AdtPrefs.getPrefs();
+ prefs.initializeStoreWithDefaults(store);
+
+ store.setValue(AdtPrefs.PREFS_FORMAT_GUI_XML, autoFormat());
+
+ prefs.loadValues(null);
+
+ super.setUp();
+ }
+
+ protected static Element findElementById(Element root, String id) {
+ if (id.equals(VisualRefactoring.getId(root))) {
+ return root;
+ }
+
+ for (Element child : DomUtilities.getChildren(root)) {
+ Element result = findElementById(child, id);
+ if (result != null) {
+ return result;
+ }
+ }
+
+ return null;
+ }
+
+ protected static List<Element> getElements(Element root, String... ids) {
+ List<Element> selectedElements = new ArrayList<Element>();
+ for (String id : ids) {
+ Element element = findElementById(root, id);
+ assertNotNull(element);
+ selectedElements.add(element);
+ }
+ return selectedElements;
+ }
+
+ protected void checkEdits(String basename, List<Change> changes) throws BadLocationException,
+ IOException {
+ IDocument document = new Document();
+
+ String xml = readTestFile(basename, false);
+ if (xml == null) { // New file
+ xml = ""; //$NON-NLS-1$
+ }
+ document.set(xml);
+
+ for (Change change : changes) {
+ if (change instanceof TextFileChange) {
+ TextFileChange tf = (TextFileChange) change;
+ TextEdit edit = tf.getEdit();
+ IFile file = tf.getFile();
+ String contents = AdtPlugin.readFile(file);
+ assertEquals(contents, xml);
+ if (edit instanceof MultiTextEdit) {
+ MultiTextEdit edits = (MultiTextEdit) edit;
+ edits.apply(document);
+ } else {
+ edit.apply(document);
+ }
+ } else {
+ System.out.println("Ignoring non-textfilechange in refactoring result");
+ }
+ }
+
+ String actual = document.get();
+
+ // Ensure that the document is still valid to make sure the edits don't
+ // mangle it:
+ org.w3c.dom.Document doc = DomUtilities.parseDocument(actual, true);
+ assertNotNull(actual, doc);
+
+ assertEqualsGolden(basename, actual);
+ }
+
+ protected void checkEdits(List<Change> changes,
+ Map<IPath, String> fileToGoldenName) throws BadLocationException, IOException {
+ checkEdits(changes, fileToGoldenName, false);
+ }
+
+ protected void checkEdits(List<Change> changes,
+ Map<IPath, String> fileToGoldenName, boolean createDiffs)
+ throws BadLocationException, IOException {
+ for (Change change : changes) {
+ if (change instanceof TextFileChange) {
+ TextFileChange tf = (TextFileChange) change;
+ IFile file = tf.getFile();
+ assertNotNull(file);
+ IPath path = file.getProjectRelativePath();
+ String goldenName = fileToGoldenName.get(path);
+ assertNotNull("Not found: " + path.toString(), goldenName);
+
+ String xml = readTestFile(goldenName, false);
+ if (xml == null) { // New file
+ xml = ""; //$NON-NLS-1$
+ }
+ IDocument document = new Document();
+ document.set(xml);
+
+ String before = document.get();
+
+ TextEdit edit = tf.getEdit();
+ if (edit instanceof MultiTextEdit) {
+ MultiTextEdit edits = (MultiTextEdit) edit;
+ edits.apply(document);
+ } else {
+ edit.apply(document);
+ }
+
+ String actual = document.get();
+
+ if (createDiffs) {
+ // Use a diff as the golden file instead of the after
+ actual = getDiff(before, actual);
+ if (goldenName.endsWith(DOT_XML)) {
+ goldenName = goldenName.substring(0,
+ goldenName.length() - DOT_XML.length())
+ + ".diff";
+ }
+ }
+
+ assertEqualsGolden(goldenName, actual);
+ } else {
+ System.out.println("Ignoring non-textfilechange in refactoring result");
+ assertNull(change.getAffectedObjects());
+ }
+ }
+ }
+
+ protected UiViewElementNode createModel(UiViewElementNode parent, Element element) {
+ List<Element> children = DomUtilities.getChildren(element);
+ String fqcn = ANDROID_WIDGET_PREFIX + element.getTagName();
+ boolean hasChildren = children.size() > 0;
+ UiViewElementNode node = createNode(parent, fqcn, hasChildren);
+ node.setXmlNode(element);
+ for (Element child : children) {
+ createModel(node, child);
+ }
+
+ return node;
+ }
+
+ /**
+ * Builds up a ViewInfo hierarchy for the given model. This is done by
+ * reading .info dump files which record the exact pixel sizes of each
+ * ViewInfo object. These files are assumed to match up exactly with the
+ * model objects. This is done rather than rendering an actual layout
+ * hierarchy to insulate the test from pixel difference (in say font size)
+ * among platforms, as well as tying the test to particulars about relative
+ * sizes of things which may change with theme adjustments etc.
+ * <p>
+ * Each file can be generated by the dump method in the ViewHierarchy.
+ */
+ protected ViewInfo createInfos(UiElementNode model, String relativePath) throws IOException {
+ String basename = relativePath.substring(0, relativePath.lastIndexOf('.') + 1);
+ String relative = basename + "info"; //$NON-NLS-1$
+ String info = readTestFile(relative, true);
+ // Parse the info file and build up a model from it
+ // Each line contains a new info.
+ // If indented it is a child of the parent.
+ String[] lines = info.split("\n"); //$NON-NLS-1$
+
+ // Iteration order for the info file should match exactly the UI model so
+ // we can just advance the line index sequentially as we traverse
+
+ return create(model, Arrays.asList(lines).iterator());
+ }
+
+ protected ViewInfo create(UiElementNode node, Iterator<String> lineIterator) {
+ // android.widget.LinearLayout [0,36,240,320]
+ Pattern pattern = Pattern.compile("(\\s*)(\\S+) \\[(\\d+),(\\d+),(\\d+),(\\d+)\\].*");
+ assertTrue(lineIterator.hasNext());
+ String description = lineIterator.next();
+ Matcher matcher = pattern.matcher(description);
+ assertTrue(matcher.matches());
+ //String indent = matcher.group(1);
+ //String fqcn = matcher.group(2);
+ String left = matcher.group(3);
+ String top = matcher.group(4);
+ String right = matcher.group(5);
+ String bottom = matcher.group(6);
+
+ ViewInfo view = new ViewInfo(node.getXmlNode().getLocalName(), node,
+ Integer.parseInt(left), Integer.parseInt(top),
+ Integer.parseInt(right), Integer.parseInt(bottom));
+
+ List<UiElementNode> childNodes = node.getUiChildren();
+ if (childNodes.size() > 0) {
+ List<ViewInfo> children = new ArrayList<ViewInfo>();
+ for (UiElementNode child : childNodes) {
+ children.add(create(child, lineIterator));
+ }
+ view.setChildren(children);
+ }
+
+ return view;
+ }
+
+ protected TestContext setupTestContext(IFile file, String relativePath) throws Exception {
+ IStructuredModel structuredModel = null;
+ org.w3c.dom.Document domDocument = null;
+ IStructuredDocument structuredDocument = null;
+ Element element = null;
+
+ try {
+ IModelManager modelManager = StructuredModelManager.getModelManager();
+ structuredModel = modelManager.getModelForRead(file);
+ if (structuredModel instanceof IDOMModel) {
+ IDOMModel domModel = (IDOMModel) structuredModel;
+ domDocument = domModel.getDocument();
+ element = domDocument.getDocumentElement();
+ structuredDocument = structuredModel.getStructuredDocument();
+ }
+ } finally {
+ if (structuredModel != null) {
+ structuredModel.releaseFromRead();
+ }
+ }
+
+ assertNotNull(structuredModel);
+ assertNotNull(domDocument);
+ assertNotNull(element);
+ assertNotNull(structuredDocument);
+ assertTrue(element instanceof IndexedRegion);
+
+ UiViewElementNode model = createModel(null, element);
+ ViewInfo info = createInfos(model, relativePath);
+ CanvasViewInfo rootView = CanvasViewInfo.create(info, true /* layoutlib5 */).getFirst();
+ TestLayoutEditorDelegate layoutEditor =
+ new TestLayoutEditorDelegate(file, structuredDocument, null);
+
+ TestContext testInfo = createTestContext();
+ testInfo.mFile = file;
+ testInfo.mStructuredModel = structuredModel;
+ testInfo.mStructuredDocument = structuredDocument;
+ testInfo.mElement = element;
+ testInfo.mDomDocument = domDocument;
+ testInfo.mUiModel = model;
+ testInfo.mViewInfo = info;
+ testInfo.mRootView = rootView;
+ testInfo.mLayoutEditorDelegate = layoutEditor;
+
+ return testInfo;
+ }
+
+ protected TestContext createTestContext() {
+ return new TestContext();
+ }
+
+ protected static class TestContext {
+ protected IFile mFile;
+ protected IStructuredModel mStructuredModel;
+ protected IStructuredDocument mStructuredDocument;
+ protected org.w3c.dom.Document mDomDocument;
+ protected Element mElement;
+ protected UiViewElementNode mUiModel;
+ protected ViewInfo mViewInfo;
+ protected CanvasViewInfo mRootView;
+ protected TestLayoutEditorDelegate mLayoutEditorDelegate;
+ }
+
+ @Override
+ public void testDummy() {
+ // To avoid JUnit warning that this class contains no tests, even though
+ // this is an abstract class and JUnit shouldn't try
+ }
+}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/UnwrapRefactoringTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/UnwrapRefactoringTest.java
new file mode 100644
index 000000000..e03ea9e06
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/UnwrapRefactoringTest.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Eclipse Public License, Version 1.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/org/documents/epl-v10.php
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.ide.eclipse.adt.internal.editors.layout.refactoring;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.ltk.core.refactoring.Change;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+import org.w3c.dom.Element;
+
+import java.util.List;
+
+public class UnwrapRefactoringTest extends RefactoringTest {
+
+ public void testUnwrap1() throws Exception {
+ // Unwrap view with parent, no children - this will unwrap the parent (frame layout)
+ checkRefactoring("unwrap.xml", "@+id/button");
+ }
+
+ public void testUnwrap2() throws Exception {
+ // Unwrap view with parent and children; this should unwrap the element itself
+ checkRefactoring("unwrap.xml", "@+id/frame");
+ }
+
+ public void testUnwrap3() throws Exception {
+ // Unwrap root: should transfer namespace
+ checkRefactoring("unwrap.xml", "@+id/linear");
+ }
+
+ private void checkRefactoring(String basename, String id) throws Exception {
+ IFile file = getLayoutFile(getProject(), basename);
+ TestContext info = setupTestContext(file, basename);
+ TestLayoutEditorDelegate layoutEditor = info.mLayoutEditorDelegate;
+ List<Element> selectedElements = getElements(info.mElement, id);
+ assertEquals(1, selectedElements.size());
+
+ UnwrapRefactoring refactoring = new UnwrapRefactoring(selectedElements,
+ layoutEditor);
+
+ RefactoringStatus status = refactoring.checkInitialConditions(new NullProgressMonitor());
+ assertFalse(status.hasError());
+ List<Change> changes = refactoring.computeChanges(new NullProgressMonitor());
+ checkEdits(basename, changes);
+ }
+}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/UseCompoundDrawableRefactoringTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/UseCompoundDrawableRefactoringTest.java
new file mode 100644
index 000000000..01a0e1e7d
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/UseCompoundDrawableRefactoringTest.java
@@ -0,0 +1,114 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Eclipse Public License, Version 1.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/org/documents/epl-v10.php
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.ide.eclipse.adt.internal.editors.layout.refactoring;
+
+import static com.android.ide.eclipse.adt.internal.editors.layout.refactoring.UseCompoundDrawableRefactoring.combine;
+
+import com.android.ide.eclipse.adt.AdtUtils;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.ltk.core.refactoring.Change;
+import org.eclipse.ltk.core.refactoring.CompositeChange;
+import org.w3c.dom.Element;
+
+import java.util.List;
+
+@SuppressWarnings("javadoc")
+public class UseCompoundDrawableRefactoringTest extends RefactoringTest {
+ public void testCombine() throws Exception {
+ assertNull(combine(null, null));
+ assertNull(combine("@dimen/foo", "@dimen/bar"));
+ assertNull(combine("@dimen/foo", "@dimen/bar"));
+ assertNull(combine("1sp", "@dimen/bar"));
+ assertNull(combine("1sp", "2dp"));
+ assertNull(combine(null, ""));
+ assertNull(combine("", null));
+
+ assertEquals("@dimen/foo", combine(null, "@dimen/foo"));
+ assertEquals("@dimen/foo", combine("@dimen/foo", null));
+ assertEquals("5sp", combine("5sp", null));
+
+ assertEquals("10sp", combine("8sp", "2sp"));
+ assertEquals("50dp", combine("30dp", "20dp"));
+ }
+
+ public void test1() throws Exception {
+ // Test converting an image above a text view
+ checkRefactoring("refactoring/usecompound/compound1.xml", "@+id/layout1");
+ }
+
+ public void test2() throws Exception {
+ // Test converting an image below a text view
+ checkRefactoring("refactoring/usecompound/compound2.xml", "@+id/layout2");
+ }
+
+ public void test3() throws Exception {
+ // Test converting an image to the left of a text view
+ checkRefactoring("refactoring/usecompound/compound3.xml", "@+id/layout3");
+ }
+
+ public void test4() throws Exception {
+ // Test converting an image to the right of a text view
+ checkRefactoring("refactoring/usecompound/compound4.xml", "@+id/layout4");
+ }
+
+ public void test5() throws Exception {
+ // Test converting an image where the LinearLayout is referenced (in a relative layout)
+ // and the text view has an id
+ checkRefactoring("refactoring/usecompound/compound_all.xml", "@+id/layout2");
+ }
+
+ public void test6() throws Exception {
+ // Test converting an image where the LinearLayout is referenced (in a relative layout)
+ // and the text view does not have an id
+ checkRefactoring("refactoring/usecompound/compound_all.xml", "@+id/layout3");
+ }
+
+ public void test7() throws Exception {
+ // Test converting where a namespace needs to be migrated
+ checkRefactoring("refactoring/usecompound/compound5.xml", "@+id/layout");
+ }
+
+ public void test8() throws Exception {
+ // Test padding handling
+ checkRefactoring("refactoring/usecompound/compound6.xml", "@+id/layout1");
+ }
+
+ public void test9() throws Exception {
+ // Test margin combination
+ checkRefactoring("refactoring/usecompound/compound7.xml", "@+id/layout1");
+ }
+
+ private void checkRefactoring(String basename, String id)
+ throws Exception {
+ IFile file = getLayoutFile(getProject(), basename);
+ TestContext info = setupTestContext(file, basename);
+ TestLayoutEditorDelegate layoutEditor = info.mLayoutEditorDelegate;
+ List<Element> selectedElements = getElements(info.mElement, new String[] { id });
+
+ UseCompoundDrawableRefactoring refactoring = new UseCompoundDrawableRefactoring(
+ selectedElements, layoutEditor);
+ List<Change> changes = refactoring.computeChanges(new NullProgressMonitor());
+
+ CompositeChange cc = new CompositeChange("Combined from unit test",
+ changes.toArray(new Change[changes.size()]));
+ cc.markAsSynthetic();
+ addCleanupDir(AdtUtils.getAbsolutePath(getProject()).toFile());
+
+ checkEdits(basename, changes);
+ }
+}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/WrapInRefactoringTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/WrapInRefactoringTest.java
new file mode 100644
index 000000000..2dc6744e6
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/WrapInRefactoringTest.java
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Eclipse Public License, Version 1.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.eclipse.org/org/documents/epl-v10.php
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.ide.eclipse.adt.internal.editors.layout.refactoring;
+
+import static com.android.SdkConstants.FQCN_GESTURE_OVERLAY_VIEW;
+import static com.android.SdkConstants.FQCN_LINEAR_LAYOUT;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.ltk.core.refactoring.Change;
+import org.w3c.dom.Element;
+
+import java.util.List;
+
+public class WrapInRefactoringTest extends RefactoringTest {
+
+ public void testWrapIn1() throws Exception {
+ // Test wrapping view: should indent view
+ checkRefactoring("sample3.xml", FQCN_LINEAR_LAYOUT, "@+id/button2");
+ }
+
+ public void testWrapIn2() throws Exception {
+ // Test wrapping the root: should move namespace
+ checkRefactoring("sample3.xml", FQCN_GESTURE_OVERLAY_VIEW, "@+id/newlinear");
+ }
+
+ public void testWrapIn3() throws Exception {
+ // Test wrap multiple adjacent elements - should wrap all as a unit
+ checkRefactoring("sample3.xml", FQCN_LINEAR_LAYOUT, "@+id/button2", "@+id/android_logo");
+ }
+
+ private void checkRefactoring(String basename, String fqcn, String... ids) throws Exception {
+ assertTrue(ids.length > 0);
+
+ IFile file = getLayoutFile(getProject(), basename);
+ TestContext info = setupTestContext(file, basename);
+ TestLayoutEditorDelegate layoutEditor = info.mLayoutEditorDelegate;
+ List<Element> selectedElements = getElements(info.mElement, ids);
+
+ WrapInRefactoring refactoring = new WrapInRefactoring(selectedElements,
+ layoutEditor);
+ refactoring.setType(fqcn);
+ List<Change> changes = refactoring.computeChanges(new NullProgressMonitor());
+ checkEdits(basename, changes);
+ }
+}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/TestFragment.java.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/TestFragment.java.txt
new file mode 100644
index 000000000..0942a19fe
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/TestFragment.java.txt
@@ -0,0 +1,15 @@
+package com.android.eclipse.tests;
+
+import android.app.Fragment;
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+public class TestFragment extends Fragment {
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+ return null;
+ }
+}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/aapterror1.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/aapterror1.xml
new file mode 100644
index 000000000..d72f4ba4c
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/aapterror1.xml
@@ -0,0 +1,12 @@
+<FrameLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent">
+ <TextView
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="50pt"
+ android:layout_marginLeft="50dp"
+ android:layout_marginBottom="50"
+ />
+</FrameLayout>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/aapterror2.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/aapterror2.xml
new file mode 100644
index 000000000..b720daac8
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/aapterror2.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources xmlns:android="http://schemas.android.com/apk/res/android">
+ <style name="repeatedStyle1">
+ <item name="android:gravity">left</item>
+ </style>
+ <style name="repeatedStyle1">
+ <item name="android:gravity">bottom</item>
+ </style>
+</resources>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/aapterror3.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/aapterror3.xml
new file mode 100644
index 000000000..bc9c134c7
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/aapterror3.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources xmlns:android="http://schemas.android.com/apk/res/android">
+ <style name="wrongAttribute">
+ <item name="nonexistent">5</item>
+ </style>
+</resources>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/aapterror4.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/aapterror4.xml
new file mode 100644
index 000000000..28dd46786
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/aapterror4.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <style>
+ <item />
+ </style>
+ <item></item>
+</resources>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/aapterror5.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/aapterror5.xml
new file mode 100644
index 000000000..ee89ac4be
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/aapterror5.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <style name="test">
+ <item name="android:layout_width"></item>
+ </style>
+</resources>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/aapterror6.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/aapterror6.xml
new file mode 100644
index 000000000..e552ff797
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/aapterror6.xml
@@ -0,0 +1,11 @@
+<FrameLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent">
+ <TextView
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginTop=""
+ android:layout_marginLeft=''
+ />
+</FrameLayout>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/aapterror7.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/aapterror7.xml
new file mode 100644
index 000000000..d47f4ae83
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/aapterror7.xml
@@ -0,0 +1,10 @@
+<FrameLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent">
+ <TextView
+ android:id=""
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ />
+</FrameLayout>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/anim1-expected-completion53.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/anim1-expected-completion53.txt
new file mode 100644
index 000000000..3e44918d9
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/anim1-expected-completion53.txt
@@ -0,0 +1,6 @@
+Code completion in anim1.xml for ^<set xmlns:
+<alpha />
+<rotate />
+<scale />
+<set ></set>
+<translate />
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/anim1-expected-completion54.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/anim1-expected-completion54.txt
new file mode 100644
index 000000000..f5e5cba69
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/anim1-expected-completion54.txt
@@ -0,0 +1,6 @@
+Code completion in anim1.xml for ^<translate android:id=:
+<alpha />
+<rotate />
+<scale />
+<set ></set>
+<translate />
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/anim1-expected-completion55.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/anim1-expected-completion55.txt
new file mode 100644
index 000000000..385f4761b
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/anim1-expected-completion55.txt
@@ -0,0 +1,16 @@
+Code completion in anim1.xml for android:^fromXDelta=:
+android:fromXDelta : [float, fraction]
+android:toXDelta : [float, fraction]
+android:fromYDelta : [float, fraction]
+android:toYDelta : [float, fraction]
+android:interpolator : Defines the interpolator used to smooth the animation movement in time. [reference]
+android:fillEnabled : When set to true, the value of fillBefore is taken into account. [boolean]
+android:fillBefore : When set to true or when fillEnabled is not set to true, the animation transformation is applied before the animation has started. [boolean]
+android:fillAfter : When set to true, the animation transformation is applied after the animation is over. [boolean]
+android:duration : Amount of time (in milliseconds) for the animation to run. [integer]
+android:startOffset : Delay in milliseconds before the animation runs, once start time is reached. [integer]
+android:repeatCount : Defines how many times the animation should repeat. [integer, enum]
+android:repeatMode : Defines the animation behavior when it reaches the end and the repeat count is greater than 0 or infinite. [enum]
+android:zAdjustment : Allows for an adjustment of the Z ordering of the content being animated for the duration of the animation. [enum]
+android:background : Special background behind animation. [color, reference]
+android:detachWallpaper : Special option for window animations: if this window is on top of a wallpaper, don't animate the wallpaper with it. [boolean]
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/anim1-expected-completion56.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/anim1-expected-completion56.txt
new file mode 100644
index 000000000..e12a66fa5
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/anim1-expected-completion56.txt
@@ -0,0 +1,14 @@
+Code completion in anim1.xml for android:^fromAlpha=:
+android:fromAlpha : [float]
+android:toAlpha : [float]
+android:interpolator : Defines the interpolator used to smooth the animation movement in time. [reference]
+android:fillEnabled : When set to true, the value of fillBefore is taken into account. [boolean]
+android:fillBefore : When set to true or when fillEnabled is not set to true, the animation transformation is applied before the animation has started. [boolean]
+android:fillAfter : When set to true, the animation transformation is applied after the animation is over. [boolean]
+android:duration : Amount of time (in milliseconds) for the animation to run. [integer]
+android:startOffset : Delay in milliseconds before the animation runs, once start time is reached. [integer]
+android:repeatCount : Defines how many times the animation should repeat. [integer, enum]
+android:repeatMode : Defines the animation behavior when it reaches the end and the repeat count is greater than 0 or infinite. [enum]
+android:zAdjustment : Allows for an adjustment of the Z ordering of the content being animated for the duration of the animation. [enum]
+android:background : Special background behind animation. [color, reference]
+android:detachWallpaper : Special option for window animations: if this window is on top of a wallpaper, don't animate the wallpaper with it. [boolean]
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/anim1-expected-completion57.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/anim1-expected-completion57.txt
new file mode 100644
index 000000000..9225dac46
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/anim1-expected-completion57.txt
@@ -0,0 +1,3 @@
+Code completion in anim1.xml for android:fromXDelta="100^%p":
+100% : <b>Fraction</b> - a percentage of the base size
+100%p : <b>Fraction</b> - a percentage relative to parent container
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/anim1.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/anim1.xml
new file mode 100644
index 000000000..48fefc2ba
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/anim1.xml
@@ -0,0 +1,20 @@
+<set xmlns:android="http://schemas.android.com/apk/res/android">
+ <translate android:id="@+id/test1"
+ android:fromXDelta="100%p"
+ android:pivotY="60%p"
+ android:toXDelta="40%p"
+ android:toYDelta="33%p"
+ android:fillBefore="true"
+ android:fillAfter="true"
+ android:startOffset="1000"
+ android:duration="1000" />
+ <alpha
+ android:id="@+id/test2"
+ android:fromAlpha="1.0"
+ android:toAlpha="0.0"
+ android:startOffset="3000"
+ android:duration="250"
+ android:fillBefore="true"
+ android:fillAfter="false"
+ />
+</set>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/animator1-expected-completion58.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/animator1-expected-completion58.txt
new file mode 100644
index 000000000..075941502
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/animator1-expected-completion58.txt
@@ -0,0 +1,4 @@
+Code completion in animator1.xml for ^<set xmlns:
+<animator ></animator>
+<objectAnimator ></objectAnimator>
+<set ></set>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/animator1-expected-completion59.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/animator1-expected-completion59.txt
new file mode 100644
index 000000000..474fe7761
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/animator1-expected-completion59.txt
@@ -0,0 +1,10 @@
+Code completion in animator1.xml for android:^duration="2000":
+android:propertyName : Name of the property being animated. [string]
+android:interpolator : Defines the interpolator used to smooth the animation movement in time. [reference]
+android:duration : Amount of time (in milliseconds) for the animation to run. [integer]
+android:startOffset : Delay in milliseconds before the animation runs, once start time is reached. [integer]
+android:repeatCount : Defines how many times the animation should repeat. [integer, enum]
+android:repeatMode : Defines the animation behavior when it reaches the end and the repeat count is greater than 0 or infinite. [enum]
+android:valueFrom : Value the animation starts from. [integer, float, color, dimension]
+android:valueTo : Value the animation animates to. [integer, float, color, dimension]
+android:valueType : The type of valueFrom and valueTo. [enum]
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/animator1-expected-completion60.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/animator1-expected-completion60.txt
new file mode 100644
index 000000000..3e5e6b127
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/animator1-expected-completion60.txt
@@ -0,0 +1,3 @@
+Code completion in animator1.xml for android:propertyName="scal^eX"/>:
+scaleX : scale of the view in the x direction.
+scaleY : scale of the view in the y direction.
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/animator1-expected-completion61.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/animator1-expected-completion61.txt
new file mode 100644
index 000000000..b298ac0b4
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/animator1-expected-completion61.txt
@@ -0,0 +1,19 @@
+Code completion in animator1.xml for android:interpolator="^@android:anim/bounce_interpolator":
+@android:anim/accelerate_decelerate_interpolator
+@android:anim/accelerate_interpolator
+@android:anim/decelerate_interpolator
+@android:anim/anticipate_interpolator
+@android:anim/overshoot_interpolator
+@android:anim/anticipate_overshoot_interpolator
+@android:anim/bounce_interpolator
+@android:anim/linear_interpolator
+@android:anim/cycle_interpolator
+@android:
+@+id/
+@anim/
+@color/
+@drawable/
+@id/
+@layout/
+@string/
+@style/
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/animator1.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/animator1.xml
new file mode 100644
index 000000000..bdf10dced
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/animator1.xml
@@ -0,0 +1,27 @@
+<!-- Simple bounce animation -->
+<set xmlns:android="http://schemas.android.com/apk/res/android"
+ android:ordering="sequentially">
+ <set>
+ <objectAnimator
+ android:duration="2000"
+ android:valueTo="310"
+ android:propertyName="x"/>
+ <objectAnimator
+ android:duration="2000"
+ android:valueTo="130"
+ android:propertyName="y"
+ android:interpolator="@android:anim/bounce_interpolator"/>
+ <objectAnimator
+ android:duration="2000"
+ android:valueTo=".4"
+ android:propertyName="scaleX"/>
+ <objectAnimator
+ android:duration="2000"
+ android:valueTo=".4"
+ android:propertyName="scaleY"/>
+ </set>
+ <objectAnimator
+ android:duration="500"
+ android:valueTo="0"
+ android:propertyName="alpha"/>
+</set>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken1-expected-applyCompletion15.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken1-expected-applyCompletion15.diff
new file mode 100644
index 000000000..4ce3540da
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken1-expected-applyCompletion15.diff
@@ -0,0 +1,4 @@
+Code completion in broken1.xml for android:textColorHigh^ selecting android:textColorHighlight:
+@@ -8 +8
+- android:textColorHigh^
++ android:textColorHighlight="^"
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken1-expected-completion20.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken1-expected-completion20.txt
new file mode 100644
index 000000000..063dc8c4b
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken1-expected-completion20.txt
@@ -0,0 +1,2 @@
+Code completion in broken1.xml for android:textColorHigh^:
+android:textColorHighlight : Color of the text selection highlight. [color, reference]
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken1.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken1.xml
new file mode 100644
index 000000000..161b9818c
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken1.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+ <Button
+ android:text="@string/app_name"
+ android:textColorHigh
+ android:layout_marginLeft="@android:dimen/app_icon_size"
+ android:id="@+id/button1"
+ ></Button>
+</LinearLayout>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken2-expected-applyCompletion16.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken2-expected-applyCompletion16.diff
new file mode 100644
index 000000000..3337ad265
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken2-expected-applyCompletion16.diff
@@ -0,0 +1,4 @@
+Code completion in broken2.xml for style=^ selecting "@android:":
+@@ -9 +9
+- style=^
++ style="@android:^"
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken2-expected-completion21.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken2-expected-completion21.txt
new file mode 100644
index 000000000..1ee2585cd
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken2-expected-completion21.txt
@@ -0,0 +1,7 @@
+Code completion in broken2.xml for style=^:
+"@android:"
+"@+id/"
+"@drawable/"
+"@id/"
+"@layout/"
+"@string/"
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken2.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken2.xml
new file mode 100644
index 000000000..60644b90c
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken2.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+ <Button
+ android:text="@string/app_name"
+ android:layout_marginLeft="@android:dimen/app_icon_size"
+ style=
+ android:id="@+id/button1"
+ ></Button>
+</LinearLayout>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken3-expected-applyCompletion14.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken3-expected-applyCompletion14.diff
new file mode 100644
index 000000000..2787380ee
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken3-expected-applyCompletion14.diff
@@ -0,0 +1,4 @@
+Code completion in broken3.xml for <EditT^ selecting EditText />:
+@@ -6 +6
+- <EditT^
++ <EditText ^/>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken3-expected-completion19.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken3-expected-completion19.txt
new file mode 100644
index 000000000..ccc6a4c66
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken3-expected-completion19.txt
@@ -0,0 +1,2 @@
+Code completion in broken3.xml for <EditT^:
+EditText />
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken3.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken3.xml
new file mode 100644
index 000000000..b8b168586
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken3.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+ <EditT
+ <Button
+ android:text="@string/app_name"
+ android:layout_marginLeft="@android:dimen/app_icon_size"
+ android:id="@+id/button1"
+ ></Button>
+</LinearLayout>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/color1-expected-completion45.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/color1-expected-completion45.txt
new file mode 100644
index 000000000..c799b8094
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/color1-expected-completion45.txt
@@ -0,0 +1,2 @@
+Code completion in color1.xml for ^<selector:
+<selector ></selector> : Required. This must be the root element. Contains one or more <item> elements.
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/color1-expected-completion46a.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/color1-expected-completion46a.txt
new file mode 100644
index 000000000..32f0066b6
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/color1-expected-completion46a.txt
@@ -0,0 +1,2 @@
+Code completion in color1.xml for ^<item android:
+<item /> : Drawable states.
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/color1-expected-completion46b.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/color1-expected-completion46b.txt
new file mode 100644
index 000000000..def6d13b1
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/color1-expected-completion46b.txt
@@ -0,0 +1,20 @@
+Code completion in color1.xml for <item ^android:state_focused="true"/>:
+android:state_focused : State value for StateListDrawable, set when a view has input focus. [boolean]
+android:state_window_focused : State value for StateListDrawable, set when a view's window has input focus. [boolean]
+android:state_enabled : State value for StateListDrawable, set when a view is enabled. [boolean]
+android:state_checkable : State identifier indicating that the object <var>may</var> display a check mark. [boolean]
+android:state_checked : State identifier indicating that the object is currently checked. [boolean]
+android:state_selected : State value for StateListDrawable, set when a view (or one of its parents) is currently selected. [boolean]
+android:state_pressed : State value for StateListDrawable, set when the user is pressing down in a view. [boolean]
+android:state_activated : State value for StateListDrawable, set when a view or its parent has been "activated" meaning the user has currently marked it as being of interest. [boolean]
+android:state_active : State value for StateListDrawable. [boolean]
+android:state_single : State value for StateListDrawable. [boolean]
+android:state_first : State value for StateListDrawable. [boolean]
+android:state_middle : State value for StateListDrawable. [boolean]
+android:state_last : State value for StateListDrawable. [boolean]
+android:state_accelerated : State value for StateListDrawable, indicating that the Drawable is in a view that is hardware accelerated. [boolean]
+android:state_hovered : State value for StateListDrawable, set when a pointer is hovering over the view. [boolean]
+android:state_drag_can_accept : State for StateListDrawable indicating that the Drawable is in a view that is capable of accepting a drop of the content currently being manipulated in a drag-and-drop operation. [boolean]
+android:state_drag_hovered : State for StateListDrawable indicating that a drag operation (for which the Drawable's view is a valid recipient) is currently positioned over the Drawable. [boolean]
+android:state_accessibility_focused : State for StateListDrawable indicating that a View has accessibility focus. [boolean]
+android:color : Hexadeximal color. Required. The color is specified with an RGB value and optional alpha channel. The value always begins with a pound (#) character and then followed by the Alpha-Red-Green-Blue information in one of the following formats: * RGB * ARGB * RRGGBB * AARRGGBB
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/color1.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/color1.xml
new file mode 100644
index 000000000..a8482abac
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/color1.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector
+ xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:state_focused="true"/>
+ <item />
+</selector>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-actual-applyCompletion1.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-actual-applyCompletion1.xml
new file mode 100644
index 000000000..2413658a7
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-actual-applyCompletion1.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android">
+<!--
+ This file deliberately contains errors - it represents partial keyboard
+ typing for interactive code completion
+-->
+ <TextView
+ android:layout_weight^="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="@android:dimen/app_icon_size"
+ android:layout_marginLeft="50dp"
+ android:layout_marginBottom="50"
+ android:textColor="#000000"
+ style="@android:style/Widget.Button"
+ android:gravity="left|bottom"
+ android:text="@string/hello"
+ android:hint="hint" />
+ <FrameLayout android:foreground="@android:drawable/btn_default"></FrameLayout>
+</LinearLayout>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion1.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion1.diff
new file mode 100644
index 000000000..6b0556615
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion1.diff
@@ -0,0 +1,4 @@
+Code completion in completion1.xml for layout_w^idth="fill_parent" selecting android:layout_weight:
+@@ -8 +8
+- android:layout_w^idth="fill_parent"
++ android:layout_weight^="fill_parent"
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion10.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion10.diff
new file mode 100644
index 000000000..7b448c29f
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion10.diff
@@ -0,0 +1,4 @@
+Code completion in completion1.xml for <T^extView selecting TableLayout:
+@@ -7 +7
+- <T^extView
++ <TableLayout^
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion11a.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion11a.diff
new file mode 100644
index 000000000..1a5f24d6c
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion11a.diff
@@ -0,0 +1,4 @@
+Code completion in completion1.xml for ^<TextView selecting <RadioGroup ></RadioGroup>:
+@@ -7 +7
+- ^<TextView
++ <RadioGroup ^></RadioGroup><TextView
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion11b.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion11b.diff
new file mode 100644
index 000000000..9010bf60c
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion11b.diff
@@ -0,0 +1,4 @@
+Code completion in completion1.xml for ^<TextView selecting <CheckBox />:
+@@ -7 +7
+- ^<TextView
++ <CheckBox ^/><TextView
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion12.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion12.diff
new file mode 100644
index 000000000..a7a463877
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion12.diff
@@ -0,0 +1,4 @@
+Code completion in completion1.xml for btn_default">^</FrameLayout> selecting <FrameLayout ></FrameLayout>:
+@@ -18 +18
+- <FrameLayout android:foreground="@android:drawable/btn_default">^</FrameLayout>
++ <FrameLayout android:foreground="@android:drawable/btn_default"><FrameLayout ^></FrameLayout></FrameLayout>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion2.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion2.diff
new file mode 100644
index 000000000..77761316d
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion2.diff
@@ -0,0 +1,4 @@
+Code completion in completion1.xml for layout_width="^fill_parent" selecting match_parent:
+@@ -8 +8
+- android:layout_width="^fill_parent"
++ android:layout_width="match_parent"^
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion3.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion3.diff
new file mode 100644
index 000000000..e67a3369d
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion3.diff
@@ -0,0 +1,4 @@
+Code completion in completion1.xml for layout_width="fi^ll_parent" selecting fill_parent:
+@@ -8 +8
+- android:layout_width="fi^ll_parent"
++ android:layout_width="fill_parent"^
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion39.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion39.diff
new file mode 100644
index 000000000..fe63acd22
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion39.diff
@@ -0,0 +1,4 @@
+Code completion in completion1.xml for marginBottom="50"^ selecting android:maxEms:
+@@ -12 +12
+- android:layout_marginBottom="50"^
++ android:layout_marginBottom="50" android:maxEms="^"
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion4.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion4.diff
new file mode 100644
index 000000000..2d229f3c4
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion4.diff
@@ -0,0 +1,4 @@
+Code completion in completion1.xml for marginBottom="50^" selecting 50mm:
+@@ -12 +12
+- android:layout_marginBottom="50^"
++ android:layout_marginBottom="50mm"^
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion5.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion5.diff
new file mode 100644
index 000000000..5a2b413d1
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion5.diff
@@ -0,0 +1,4 @@
+Code completion in completion1.xml for layout_marginLeft="50d^p" selecting 50dp:
+@@ -11 +11
+- android:layout_marginLeft="50d^p"
++ android:layout_marginLeft="50dp"^
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion6.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion6.diff
new file mode 100644
index 000000000..d3a8c1120
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion6.diff
@@ -0,0 +1,4 @@
+Code completion in completion1.xml for style="@android:^style/Widget.Button" selecting @android:drawable/:
+@@ -14 +14
+- style="@android:^style/Widget.Button"
++ style="@android:drawable/^"
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion7a.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion7a.diff
new file mode 100644
index 000000000..afd7e21e0
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion7a.diff
@@ -0,0 +1,4 @@
+Code completion in completion1.xml for android:gravity="l^eft|bottom" selecting left:
+@@ -15 +15
+- android:gravity="l^eft|bottom"
++ android:gravity="left^"
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion7b.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion7b.diff
new file mode 100644
index 000000000..73f2bd48a
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion7b.diff
@@ -0,0 +1,4 @@
+Code completion in completion1.xml for android:gravity="left|b^ottom" selecting bottom:
+@@ -15 +15
+- android:gravity="left|b^ottom"
++ android:gravity="left|bottom^"
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion8.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion8.diff
new file mode 100644
index 000000000..655afc529
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion8.diff
@@ -0,0 +1,2 @@
+Code completion in completion1.xml for layout_width^="fill_parent" selecting android:layout_width:
+No changes \ No newline at end of file
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion9.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion9.diff
new file mode 100644
index 000000000..1b4198e43
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion9.diff
@@ -0,0 +1,4 @@
+Code completion in completion1.xml for layout_width=^"fill_parent" selecting "wrap_content":
+@@ -8 +8
+- android:layout_width=^"fill_parent"
++ android:layout_width="wrap_content"^
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion1.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion1.txt
new file mode 100644
index 000000000..c3e75ad54
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion1.txt
@@ -0,0 +1,3 @@
+Code completion in completion1.xml for layout_w^idth="fill_parent":
+android:layout_width : Specifies the basic width of the view. [dimension, enum]
+android:layout_weight : [float]
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion10.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion10.txt
new file mode 100644
index 000000000..973d95eff
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion10.txt
@@ -0,0 +1,11 @@
+Code completion in completion1.xml for <T^extView:
+TabHost
+TabWidget
+TableLayout
+TableRow
+TextSwitcher
+TextView
+TextureView
+TimePicker
+ToggleButton
+TwoLineListItem
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion11.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion11.txt
new file mode 100644
index 000000000..20dad3a53
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion11.txt
@@ -0,0 +1,67 @@
+Code completion in completion1.xml for ^<TextView:
+<AbsoluteLayout ></AbsoluteLayout>
+<AdapterViewFlipper ></AdapterViewFlipper>
+<AnalogClock />
+<AutoCompleteTextView />
+<Button />
+<CalendarView />
+<CheckBox />
+<CheckedTextView />
+<Chronometer />
+<DatePicker />
+<DialerFilter ></DialerFilter>
+<DigitalClock />
+<EditText />
+<ExpandableListView ></ExpandableListView>
+<FrameLayout ></FrameLayout>
+<Gallery />
+<GridLayout ></GridLayout>
+<GridView ></GridView>
+<HorizontalScrollView ></HorizontalScrollView>
+<ImageButton />
+<ImageSwitcher ></ImageSwitcher>
+<ImageView />
+<LinearLayout ></LinearLayout>
+<ListView ></ListView>
+<MediaController ></MediaController>
+<MultiAutoCompleteTextView />
+<NumberPicker />
+<ProgressBar />
+<QuickContactBadge />
+<RadioButton />
+<RadioGroup ></RadioGroup>
+<RatingBar />
+<RelativeLayout ></RelativeLayout>
+<ScrollView ></ScrollView>
+<SearchView ></SearchView>
+<SeekBar />
+<SlidingDrawer ></SlidingDrawer> : SlidingDrawer specific attributes.
+<Space />
+<Spinner />
+<StackView ></StackView>
+<SurfaceView />
+<Switch />
+<TabHost ></TabHost>
+<TabWidget ></TabWidget>
+<TableLayout ></TableLayout>
+<TableRow ></TableRow>
+<TextSwitcher ></TextSwitcher>
+<TextView />
+<TextureView />
+<TimePicker />
+<ToggleButton />
+<TwoLineListItem />
+<VideoView />
+<View /> : Attributes that can be used with android.view.View or any of its subclasses.
+<ViewAnimator ></ViewAnimator>
+<ViewFlipper ></ViewFlipper>
+<ViewStub /> : A android.view.ViewStub lets you lazily include other XML layouts inside your application at runtime.
+<ViewSwitcher ></ViewSwitcher>
+<WebView />
+<ZoomButton />
+<ZoomControls />
+<android.gesture.GestureOverlayView ></android.gesture.GestureOverlayView> : GestureOverlayView specific attributes.
+<fragment /> : A Fragment is a piece of an application's user interface or behavior that can be placed in an Activity
+<include /> : Lets you statically include XML layouts inside other XML layouts.
+<requestFocus /> : Requests focus for the parent element or one of its descendants
+<view /> : A view tag whose class attribute names the class to be instantiated
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion12.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion12.txt
new file mode 100644
index 000000000..8da18db43
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion12.txt
@@ -0,0 +1,67 @@
+Code completion in completion1.xml for btn_default">^</FrameLayout>:
+<AbsoluteLayout ></AbsoluteLayout>
+<AdapterViewFlipper ></AdapterViewFlipper>
+<AnalogClock />
+<AutoCompleteTextView />
+<Button />
+<CalendarView />
+<CheckBox />
+<CheckedTextView />
+<Chronometer />
+<DatePicker />
+<DialerFilter ></DialerFilter>
+<DigitalClock />
+<EditText />
+<ExpandableListView ></ExpandableListView>
+<FrameLayout ></FrameLayout>
+<Gallery />
+<GridLayout ></GridLayout>
+<GridView ></GridView>
+<HorizontalScrollView ></HorizontalScrollView>
+<ImageButton />
+<ImageSwitcher ></ImageSwitcher>
+<ImageView />
+<LinearLayout ></LinearLayout>
+<ListView ></ListView>
+<MediaController ></MediaController>
+<MultiAutoCompleteTextView />
+<NumberPicker />
+<ProgressBar />
+<QuickContactBadge />
+<RadioButton />
+<RadioGroup ></RadioGroup>
+<RatingBar />
+<RelativeLayout ></RelativeLayout>
+<ScrollView ></ScrollView>
+<SearchView ></SearchView>
+<SeekBar />
+<SlidingDrawer ></SlidingDrawer> : SlidingDrawer specific attributes.
+<Space />
+<Spinner />
+<StackView ></StackView>
+<SurfaceView />
+<Switch />
+<TabHost ></TabHost>
+<TabWidget ></TabWidget>
+<TableLayout ></TableLayout>
+<TableRow ></TableRow>
+<TextSwitcher ></TextSwitcher>
+<TextView />
+<TextureView />
+<TimePicker />
+<ToggleButton />
+<TwoLineListItem />
+<VideoView />
+<View /> : Attributes that can be used with android.view.View or any of its subclasses.
+<ViewAnimator ></ViewAnimator>
+<ViewFlipper ></ViewFlipper>
+<ViewStub /> : A android.view.ViewStub lets you lazily include other XML layouts inside your application at runtime.
+<ViewSwitcher ></ViewSwitcher>
+<WebView />
+<ZoomButton />
+<ZoomControls />
+<android.gesture.GestureOverlayView ></android.gesture.GestureOverlayView> : GestureOverlayView specific attributes.
+<fragment /> : A Fragment is a piece of an application's user interface or behavior that can be placed in an Activity
+<include /> : Lets you statically include XML layouts inside other XML layouts.
+<requestFocus /> : Requests focus for the parent element or one of its descendants
+<view /> : A view tag whose class attribute names the class to be instantiated
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion2.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion2.txt
new file mode 100644
index 000000000..136a6fe4d
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion2.txt
@@ -0,0 +1,4 @@
+Code completion in completion1.xml for layout_width="^fill_parent":
+fill_parent
+match_parent
+wrap_content
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion3.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion3.txt
new file mode 100644
index 000000000..09c27ce2d
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion3.txt
@@ -0,0 +1,2 @@
+Code completion in completion1.xml for layout_width="fi^ll_parent":
+fill_parent
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion39.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion39.txt
new file mode 100644
index 000000000..2ac2d3186
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion39.txt
@@ -0,0 +1,156 @@
+Code completion in completion1.xml for marginBottom="50"^:
+style : A reference to a custom style [reference]
+android:bufferType : Determines the minimum type that getText() will return. [enum]
+android:text : Text to display. [string]
+android:hint : Hint text to display when the text is empty. [string]
+android:textColor : Text color. [color, reference]
+android:textColorHighlight : Color of the text selection highlight. [color, reference]
+android:textColorHint : Color of the hint text. [color, reference]
+android:textAppearance : Base text color, typeface, size, and style. [reference]
+android:textSize : Size of the text. [dimension]
+android:textScaleX : Sets the horizontal scaling factor for the text. [float]
+android:typeface : Typeface (normal, sans, serif, monospace) for the text. [enum]
+android:textStyle : Style (bold, italic, bolditalic) for the text. [flag]
+android:fontFamily : Font family (named by string) for the text. [string]
+android:textColorLink : Text color for links. [color, reference]
+android:cursorVisible : Makes the cursor visible (the default) or invisible. [boolean]
+android:maxLines : Makes the TextView be at most this many lines tall. [integer]
+android:maxHeight : Makes the TextView be at most this many pixels tall. [dimension]
+android:lines : Makes the TextView be exactly this many lines tall. [integer]
+android:height : Makes the TextView be exactly this many pixels tall. [dimension]
+android:minLines : Makes the TextView be at least this many lines tall. [integer]
+android:minHeight : Makes the TextView be at least this many pixels tall. [dimension]
+android:maxEms : Makes the TextView be at most this many ems wide. [integer]
+android:maxWidth : Makes the TextView be at most this many pixels wide. [dimension]
+android:ems : Makes the TextView be exactly this many ems wide. [integer]
+android:width : Makes the TextView be exactly this many pixels wide. [dimension]
+android:minEms : Makes the TextView be at least this many ems wide. [integer]
+android:minWidth : Makes the TextView be at least this many pixels wide. [dimension]
+android:gravity : Specifies how to align the text by the view's x- and/or y-axis when the text is smaller than the view. [flag]
+android:scrollHorizontally : Whether the text is allowed to be wider than the view (and therefore can be scrolled horizontally). [boolean]
+android:password : Whether the characters of the field are displayed as password dots instead of themselves. * Deprecated: Use inputType instead. [boolean]
+android:singleLine : Constrains the text to a single horizontally scrolling line instead of letting it wrap onto multiple lines, and advances focus instead of inserting a newline when you press the enter key. * Deprecated: This attribute is deprecated. Use "maxLines" instead to change the layo...
+android:enabled : Specifies whether the widget is enabled. [boolean]
+android:selectAllOnFocus : If the text is selectable, select it all when the view takes focus. [boolean]
+android:includeFontPadding : Leave enough room for ascenders and descenders instead of using the font ascent and descent strictly. [boolean]
+android:maxLength : Set an input filter to constrain the text length to the specified number. [integer]
+android:shadowColor : Place a shadow of the specified color behind the text. [color]
+android:shadowDx : Horizontal offset of the shadow. [float]
+android:shadowDy : Vertical offset of the shadow. [float]
+android:shadowRadius : Radius of the shadow. [float]
+android:autoLink : Controls whether links such as urls and email addresses are automatically found and converted to clickable links. [flag]
+android:linksClickable : If set to false, keeps the movement method from being set to the link movement method even if autoLink causes links to be found. [boolean]
+android:numeric : If set, specifies that this TextView has a numeric input method. * Deprecated: Use inputType instead. [flag]
+android:digits : If set, specifies that this TextView has a numeric input method and that these specific characters are the ones that it will accept. [string]
+android:phoneNumber : If set, specifies that this TextView has a phone number input method. * Deprecated: Use inputType instead. [boolean]
+android:inputMethod : If set, specifies that this TextView should use the specified input method (specified by fully-qualified class name). * Deprecated: Use inputType instead. [string]
+android:capitalize : If set, specifies that this TextView has a textual input method and should automatically capitalize what the user types. * Deprecated: Use inputType instead. [enum]
+android:autoText : If set, specifies that this TextView has a textual input method and automatically corrects some common spelling errors. * Deprecated: Use inputType instead. [boolean]
+android:editable : If set, specifies that this TextView has an input method. * Deprecated: Use inputType instead. [boolean]
+android:freezesText : If set, the text view will include its current complete text inside of its frozen icicle in addition to meta-data such as the current cursor position. [boolean]
+android:ellipsize : If set, causes words that are longer than the view is wide to be ellipsized instead of broken in the middle. [enum]
+android:drawableTop : The drawable to be drawn above the text. [color, reference]
+android:drawableBottom : The drawable to be drawn below the text. [color, reference]
+android:drawableLeft : The drawable to be drawn to the left of the text. [color, reference]
+android:drawableRight : The drawable to be drawn to the right of the text. [color, reference]
+android:drawableStart : The drawable to be drawn to the start of the text. [color, reference]
+android:drawableEnd : The drawable to be drawn to the end of the text. [color, reference]
+android:drawablePadding : The padding between the drawables and the text. [dimension]
+android:lineSpacingExtra : Extra spacing between lines of text. [dimension]
+android:lineSpacingMultiplier : Extra spacing between lines of text, as a multiplier. [float]
+android:marqueeRepeatLimit : The number of times to repeat the marquee animation. [integer, enum]
+android:inputType : The type of data being placed in a text field, used to help an input method decide how to let the user enter text. [flag]
+android:imeOptions : Additional features you can enable in an IME associated with an editor to improve the integration with your application. [flag]
+android:privateImeOptions : An addition content type description to supply to the input method attached to the text view, which is private to the implementation of the input method. [string]
+android:imeActionLabel : Supply a value for EditorInfo.actionLabel used when an input method is connected to the text view. [string]
+android:imeActionId : Supply a value for EditorInfo.actionId used when an input method is connected to the text view. [integer]
+android:editorExtras : Reference to an "input-extras" XML resource containing additional data to supply to an input method, which is private to the implementation of the input method. [reference]
+android:textSelectHandleLeft : Reference to a drawable that will be used to display a text selection anchor on the left side of a selection region. [reference]
+android:textSelectHandleRight : Reference to a drawable that will be used to display a text selection anchor on the right side of a selection region. [reference]
+android:textSelectHandle : Reference to a drawable that will be used to display a text selection anchor for positioning the cursor within text. [reference]
+android:textEditPasteWindowLayout : The layout of the view that is displayed on top of the cursor to paste inside a TextEdit field. [reference]
+android:textEditNoPasteWindowLayout : Variation of textEditPasteWindowLayout displayed when the clipboard is empty. [reference]
+android:textEditSidePasteWindowLayout : Used instead of textEditPasteWindowLayout when the window is moved on the side of the insertion cursor because it would be clipped if it were positioned on top. [reference]
+android:textEditSideNoPasteWindowLayout : Variation of textEditSidePasteWindowLayout displayed when the clipboard is empty. [reference]
+android:textEditSuggestionItemLayout : Layout of the TextView item that will populate the suggestion popup window. [reference]
+android:textCursorDrawable : Reference to a drawable that will be drawn under the insertion cursor. [reference]
+android:textIsSelectable : Indicates that the content of a non-editable text can be selected. [boolean]
+android:textAllCaps : Present the text in ALL CAPS. [boolean]
+android:id : Supply an identifier name for this view, to later retrieve it with View.findViewById() or Activity.findViewById(). [reference]
+android:tag : Supply a tag for this view containing a String, to be retrieved later with View.getTag() or searched for with View.findViewWithTag() . [string]
+android:scrollX : The initial horizontal scroll offset, in pixels. [dimension]
+android:scrollY : The initial vertical scroll offset, in pixels. [dimension]
+android:background : A drawable to use as the background. [color, reference]
+android:padding : Sets the padding, in pixels, of all four edges. [dimension]
+android:paddingLeft : Sets the padding, in pixels, of the left edge; see padding. [dimension]
+android:paddingTop : Sets the padding, in pixels, of the top edge; see padding. [dimension]
+android:paddingRight : Sets the padding, in pixels, of the right edge; see padding. [dimension]
+android:paddingBottom : Sets the padding, in pixels, of the bottom edge; see padding. [dimension]
+android:paddingStart : Sets the padding, in pixels, of the start edge; see padding. [dimension]
+android:paddingEnd : Sets the padding, in pixels, of the end edge; see padding. [dimension]
+android:focusable : Boolean that controls whether a view can take focus. [boolean]
+android:focusableInTouchMode : Boolean that controls whether a view can take focus while in touch mode. [boolean]
+android:visibility : Controls the initial visibility of the view. [enum]
+android:fitsSystemWindows : Boolean internal attribute to adjust view layout based on system windows such as the status bar. [boolean]
+android:scrollbars : Defines which scrollbars should be displayed on scrolling or not. [flag]
+android:scrollbarStyle : Controls the scrollbar style and position. [enum]
+android:isScrollContainer : Set this if the view will serve as a scrolling container, meaing that it can be resized to shrink its overall window so that there will be space for an input method. [boolean]
+android:fadeScrollbars : Defines whether to fade out scrollbars when they are not in use. [boolean]
+android:scrollbarFadeDuration : Defines the delay in milliseconds that a scrollbar takes to fade out. [integer]
+android:scrollbarDefaultDelayBeforeFade : Defines the delay in milliseconds that a scrollbar waits before fade out. [integer]
+android:scrollbarSize : Sets the width of vertical scrollbars and height of horizontal scrollbars. [dimension]
+android:scrollbarThumbHorizontal : Defines the horizontal scrollbar thumb drawable. [reference]
+android:scrollbarThumbVertical : Defines the vertical scrollbar thumb drawable. [reference]
+android:scrollbarTrackHorizontal : Defines the horizontal scrollbar track drawable. [reference]
+android:scrollbarTrackVertical : Defines the vertical scrollbar track drawable. [reference]
+android:scrollbarAlwaysDrawHorizontalTrack : Defines whether the horizontal scrollbar track should always be drawn. [boolean]
+android:scrollbarAlwaysDrawVerticalTrack : Defines whether the vertical scrollbar track should always be drawn. [boolean]
+android:fadingEdge : This attribute is deprecated and will be ignored as of API level 14 (ICE_CREAM_SANDWICH). [flag]
+android:requiresFadingEdge : Defines which edges should be faded on scrolling. [flag]
+android:fadingEdgeLength : Defines the length of the fading edges. [dimension]
+android:nextFocusLeft : Defines the next view to give focus to when the next focus is FOCUS_LEFT. [reference]
+android:nextFocusRight : Defines the next view to give focus to when the next focus is FOCUS_RIGHT If the reference refers to a view that does not exist or is part of a hierarchy that is invisible, a java.lang.RuntimeException will result when the reference is accessed. [reference]
+android:nextFocusUp : Defines the next view to give focus to when the next focus is FOCUS_UP If the reference refers to a view that does not exist or is part of a hierarchy that is invisible, a java.lang.RuntimeException will result when the reference is accessed. [reference]
+android:nextFocusDown : Defines the next view to give focus to when the next focus is FOCUS_DOWN If the reference refers to a view that does not exist or is part of a hierarchy that is invisible, a java.lang.RuntimeException will result when the reference is accessed. [reference]
+android:nextFocusForward : Defines the next view to give focus to when the next focus is FOCUS_FORWARD If the reference refers to a view that does not exist or is part of a hierarchy that is invisible, a java.lang.RuntimeException will result when the reference is accessed. [reference]
+android:clickable : Defines whether this view reacts to click events. [boolean]
+android:longClickable : Defines whether this view reacts to long click events. [boolean]
+android:saveEnabled : If unset, no state will be saved for this view when it is being frozen. [boolean]
+android:filterTouchesWhenObscured : Specifies whether to filter touches when the view's window is obscured by another visible window. [boolean]
+android:drawingCacheQuality : Defines the quality of translucent drawing caches. [enum]
+android:keepScreenOn : Controls whether the view's window should keep the screen on while visible. [boolean]
+android:duplicateParentState : When this attribute is set to true, the view gets its drawable state (focused, pressed, etc.) from its direct parent rather than from itself. [boolean]
+android:minHeight : Defines the minimum height of the view.
+android:minWidth : Defines the minimum width of the view.
+android:soundEffectsEnabled : Boolean that controls whether a view should have sound effects enabled for events such as clicking and touching. [boolean]
+android:hapticFeedbackEnabled : Boolean that controls whether a view should have haptic feedback enabled for events such as long presses. [boolean]
+android:contentDescription : Defines text that briefly describes content of the view. [string]
+android:onClick : Name of the method in this View's context to invoke when the view is clicked. [string]
+android:overScrollMode : Defines over-scrolling behavior. [enum]
+android:alpha : alpha property of the view, as a value between 0 (completely transparent) and 1 (completely opaque). [float]
+android:translationX : translation in x of the view. [dimension]
+android:translationY : translation in y of the view. [dimension]
+android:transformPivotX : x location of the pivot point around which the view will rotate and scale. [dimension]
+android:transformPivotY : y location of the pivot point around which the view will rotate and scale. [dimension]
+android:rotation : rotation of the view, in degrees. [float]
+android:rotationX : rotation of the view around the x axis, in degrees. [float]
+android:rotationY : rotation of the view around the y axis, in degrees. [float]
+android:scaleX : scale of the view in the x direction. [float]
+android:scaleY : scale of the view in the y direction. [float]
+android:verticalScrollbarPosition : Determines which side the vertical scroll bar should be placed on. [enum]
+android:layerType : Specifies the type of layer backing this view. [enum]
+android:layoutDirection : Defines the direction of layout drawing. [enum]
+android:textDirection : Direction of the text. [integer, enum]
+android:textAlignment : Alignment of the text. [integer, enum]
+android:importantForAccessibility : Controls how this View is important for accessibility which is if it fires accessibility events and if it is reported to accessibility services that query the screen. [integer, enum]
+android:layout_width : Specifies the basic width of the view. [dimension, enum]
+android:layout_height : Specifies the basic height of the view. [dimension, enum]
+android:layout_weight : [float]
+android:layout_gravity : Standard gravity constant that a child can supply to its parent. [flag]
+android:layout_margin : Specifies extra space on the left, top, right and bottom sides of this view. [dimension]
+android:layout_marginLeft : Specifies extra space on the left side of this view. [dimension]
+android:layout_marginTop : Specifies extra space on the top side of this view. [dimension]
+android:layout_marginRight : Specifies extra space on the right side of this view. [dimension]
+android:layout_marginBottom : Specifies extra space on the bottom side of this view. [dimension]
+android:layout_marginStart : Specifies extra space on the start side of this view. [dimension]
+android:layout_marginEnd : Specifies extra space on the end side of this view. [dimension]
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion4.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion4.txt
new file mode 100644
index 000000000..a9111eb31
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion4.txt
@@ -0,0 +1,7 @@
+Code completion in completion1.xml for marginBottom="50^":
+50dp : <b>Density-independent Pixels</b> - an abstract unit that is based on the physical density of the screen.
+50sp : <b>Scale-independent Pixels</b> - this is like the dp unit, but it is also scaled by the user's font size preference.
+50pt : <b>Points</b> - 1/72 of an inch based on the physical size of the screen.
+50mm : <b>Millimeters</b> - based on the physical size of the screen.
+50in : <b>Inches</b> - based on the physical size of the screen.
+50px : <b>Pixels</b> - corresponds to actual pixels on the screen. Not recommended.
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion5.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion5.txt
new file mode 100644
index 000000000..6b1c99363
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion5.txt
@@ -0,0 +1,2 @@
+Code completion in completion1.xml for layout_marginLeft="50d^p":
+50dp : <b>Density-independent Pixels</b> - an abstract unit that is based on the physical density of the screen.
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion6.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion6.txt
new file mode 100644
index 000000000..99f92b8f3
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion6.txt
@@ -0,0 +1,23 @@
+Code completion in completion1.xml for style="@android:^style/Widget.Button":
+@android:style/
+@android:anim/
+@android:animator/
+@android:array/
+@android:attr/
+@android:bool/
+@android:color/
+@android:declare-styleable/
+@android:dimen/
+@android:drawable/
+@android:fraction/
+@android:id/
+@android:integer/
+@android:interpolator/
+@android:layout/
+@android:menu/
+@android:mipmap/
+@android:plurals/
+@android:public/
+@android:raw/
+@android:string/
+@android:xml/
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion7a.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion7a.txt
new file mode 100644
index 000000000..cf373adde
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion7a.txt
@@ -0,0 +1,2 @@
+Code completion in completion1.xml for android:gravity="l^eft|bottom":
+left
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion7b.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion7b.txt
new file mode 100644
index 000000000..66276d628
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion7b.txt
@@ -0,0 +1,2 @@
+Code completion in completion1.xml for android:gravity="left|b^ottom":
+bottom
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion8.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion8.txt
new file mode 100644
index 000000000..a364bc3ff
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion8.txt
@@ -0,0 +1,2 @@
+Code completion in completion1.xml for layout_width^="fill_parent":
+android:layout_width : Specifies the basic width of the view. [dimension, enum]
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion9.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion9.txt
new file mode 100644
index 000000000..ab6a0d249
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion9.txt
@@ -0,0 +1,4 @@
+Code completion in completion1.xml for layout_width=^"fill_parent":
+"fill_parent"
+"match_parent"
+"wrap_content"
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1.xml
new file mode 100644
index 000000000..d523eeb3d
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android">
+<!--
+ This file deliberately contains errors - it represents partial keyboard
+ typing for interactive code completion
+-->
+ <TextView
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="@android:dimen/app_icon_size"
+ android:layout_marginLeft="50dp"
+ android:layout_marginBottom="50"
+ android:textColor="#000000"
+ style="@android:style/Widget.Button"
+ android:gravity="left|bottom"
+ android:text="@string/hello"
+ android:hint="hint" />
+ <FrameLayout android:foreground="@android:drawable/btn_default"></FrameLayout>
+</LinearLayout>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion10-expected-applyCompletion42.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion10-expected-applyCompletion42.diff
new file mode 100644
index 000000000..af28a1343
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion10-expected-applyCompletion42.diff
@@ -0,0 +1,4 @@
+Code completion in completion10.xml for "[^wrap_content]" selecting fill_parent:
+@@ -9 +9
+- android:layout_height="^wrap_content"/>
++ android:layout_height="fill_parent"^/>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion10-expected-applyCompletion43.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion10-expected-applyCompletion43.diff
new file mode 100644
index 000000000..0a4d338e2
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion10-expected-applyCompletion43.diff
@@ -0,0 +1,4 @@
+Code completion in completion10.xml for "[^wrap_c]ontent" selecting fill_parent:
+@@ -9 +9
+- android:layout_height="^wrap_content"/>
++ android:layout_height="fill_parent"^/>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion10-expected-completion65.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion10-expected-completion65.txt
new file mode 100644
index 000000000..69fae0da3
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion10-expected-completion65.txt
@@ -0,0 +1,4 @@
+Code completion in completion10.xml for "[^wrap_content]":
+fill_parent
+match_parent
+wrap_content
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion10.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion10.xml
new file mode 100644
index 000000000..57b38ee11
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion10.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:gravity="center_vertical">
+<Gallery xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/gallery"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"/>
+</RelativeLayout>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion11-expected-applyCompletion46.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion11-expected-applyCompletion46.diff
new file mode 100644
index 000000000..321deaa46
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion11-expected-applyCompletion46.diff
@@ -0,0 +1,4 @@
+Code completion in completion11.xml for ?android:attr/Textapp^ selecting ?android:attr/textAppearanceLargeInverse:
+@@ -7 +7
+- style="?android:attr/Textapp^"
++ style="?android:attr/textAppearanceLargeInverse^"
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion11-expected-complation79.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion11-expected-complation79.txt
new file mode 100644
index 000000000..3748c77ec
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion11-expected-complation79.txt
@@ -0,0 +1,10 @@
+Code completion in completion11.xml for tools:context="^.MainActivity":
+android.accounts.AccountAuthenticatorActivity : <p>See <code><a href="/reference/android/app/SearchManager.html">android.app.SearchManager</a></code> for more details.</td> </tr> <tr class=" api apilevel-1" > <td class="jd-typecol">int</td> <td class="jd-linkcol"...
+android.app.ActivityGroup : <p> <p class="caution"> <strong>This class was deprecated in API level 13</strong>.<br/> Use the new <code><a href="/reference/android/app/Fragment.html">Fragment</a></code> and <code><a href="/reference/android/app/FragmentManager.html">FragmentManager</...
+android.app.AliasActivity : <p>See <code><a href="/reference/android/app/SearchManager.html">android.app.SearchManager</a></code> for more details.</td> </tr> <tr class=" api apilevel-1" > <td class="jd-typecol">int</td> <td class="jd-linkcol"><a href="/reference...
+android.app.ExpandableListActivity : <p> ExpandableListActivity hosts a <code><a href="/reference/android/widget/ExpandableListView.html">ExpandableListView</a></code> object that can be bound to different data sources that provide a two-levels of data (the top-level is group, and below each ...
+android.app.LauncherActivity : <div id="jd-header"> public abstract class <h1 itemprop="name">LauncherActivity</h1> extends <a href="/reference/android/app/ListActivity.html">ListActivity</a><br/> ...
+android.app.ListActivity : <p> ListActivity hosts a <code><a href="/reference/android/widget/ListView.html">ListView</a></code> object that can be bound to different data sources, typically either an array or a Cursor holding query results. Binding, screen layout, and row layout are discussed ...
+android.app.NativeActivity : <p>A typical manifest would look like: <pre>&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.native_activity" android:versionCode="1" android:versionName="1.0"&gt; &lt;!-- This is the platform ...
+android.app.TabActivity : <p> <p class="caution"> <strong>This class was deprecated in API level 13</strong>.<br/> New applications should use Fragments instead of this class; to continue to run on older devices, you can use the v4 support library which provides a version of the F...
+android.preference.PreferenceActivity : <p>This activity shows one or more headers of preferences, each of which is associated with a <code><a href="/reference/android/preference/PreferenceFragment.html">PreferenceFragment</a></code> to display the preferences of that header. The actual layout...
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion11-expected-completion72.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion11-expected-completion72.txt
new file mode 100644
index 000000000..e4c21f9a4
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion11-expected-completion72.txt
@@ -0,0 +1,3 @@
+Code completion in completion11.xml for ?^android:attr/Textapp:
+?android:attr/
+?attr/
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion11-expected-completion73.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion11-expected-completion73.txt
new file mode 100644
index 000000000..04cbbce93
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion11-expected-completion73.txt
@@ -0,0 +1,16 @@
+Code completion in completion11.xml for ?android:attr/Textapp^:
+?android:attr/textAppearance : Base text color, typeface, size, and style.
+?android:attr/textAppearanceButton
+?android:attr/textAppearanceInverse
+?android:attr/textAppearanceLarge
+?android:attr/textAppearanceLargeInverse
+?android:attr/textAppearanceLargePopupMenu
+?android:attr/textAppearanceListItem
+?android:attr/textAppearanceListItemSmall
+?android:attr/textAppearanceMedium
+?android:attr/textAppearanceMediumInverse
+?android:attr/textAppearanceSearchResultSubtitle
+?android:attr/textAppearanceSearchResultTitle
+?android:attr/textAppearanceSmall
+?android:attr/textAppearanceSmallInverse
+?android:attr/textAppearanceSmallPopupMenu
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion11-expected-completion74.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion11-expected-completion74.txt
new file mode 100644
index 000000000..9579c93db
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion11-expected-completion74.txt
@@ -0,0 +1,2 @@
+Code completion in completion11.xml for ?and^roid:attr/Textapp:
+?android:attr/
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion11.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion11.xml
new file mode 100644
index 000000000..e15b83019
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion11.xml
@@ -0,0 +1,15 @@
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent" >
+
+ <TextView
+ style="?android:attr/Textapp"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_centerHorizontal="true"
+ android:layout_centerVertical="true"
+ android:text="@string/hello_world"
+ tools:context=".MainActivity" />
+
+</RelativeLayout>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion12-expected-completion75.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion12-expected-completion75.txt
new file mode 100644
index 000000000..5ad38e61c
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion12-expected-completion75.txt
@@ -0,0 +1,96 @@
+Code completion in completion12.xml for <include ^/>:
+layout : [reference]. * Required.
+style : A reference to a custom style [reference]
+android:id : Supply an identifier name for this view, to later retrieve it with View.findViewById() or Activity.findViewById(). [reference]
+android:tag : Supply a tag for this view containing a String, to be retrieved later with View.getTag() or searched for with View.findViewWithTag() . [string]
+android:scrollX : The initial horizontal scroll offset, in pixels. [dimension]
+android:scrollY : The initial vertical scroll offset, in pixels. [dimension]
+android:background : A drawable to use as the background. [color, reference]
+android:padding : Sets the padding, in pixels, of all four edges. [dimension]
+android:paddingLeft : Sets the padding, in pixels, of the left edge; see padding. [dimension]
+android:paddingTop : Sets the padding, in pixels, of the top edge; see padding. [dimension]
+android:paddingRight : Sets the padding, in pixels, of the right edge; see padding. [dimension]
+android:paddingBottom : Sets the padding, in pixels, of the bottom edge; see padding. [dimension]
+android:paddingStart : Sets the padding, in pixels, of the start edge; see padding. [dimension]
+android:paddingEnd : Sets the padding, in pixels, of the end edge; see padding. [dimension]
+android:focusable : Boolean that controls whether a view can take focus. [boolean]
+android:focusableInTouchMode : Boolean that controls whether a view can take focus while in touch mode. [boolean]
+android:visibility : Controls the initial visibility of the view. [enum]
+android:fitsSystemWindows : Boolean internal attribute to adjust view layout based on system windows such as the status bar. [boolean]
+android:scrollbars : Defines which scrollbars should be displayed on scrolling or not. [flag]
+android:scrollbarStyle : Controls the scrollbar style and position. [enum]
+android:isScrollContainer : Set this if the view will serve as a scrolling container, meaing that it can be resized to shrink its overall window so that there will be space for an input method. [boolean]
+android:fadeScrollbars : Defines whether to fade out scrollbars when they are not in use. [boolean]
+android:scrollbarFadeDuration : Defines the delay in milliseconds that a scrollbar takes to fade out. [integer]
+android:scrollbarDefaultDelayBeforeFade : Defines the delay in milliseconds that a scrollbar waits before fade out. [integer]
+android:scrollbarSize : Sets the width of vertical scrollbars and height of horizontal scrollbars. [dimension]
+android:scrollbarThumbHorizontal : Defines the horizontal scrollbar thumb drawable. [reference]
+android:scrollbarThumbVertical : Defines the vertical scrollbar thumb drawable. [reference]
+android:scrollbarTrackHorizontal : Defines the horizontal scrollbar track drawable. [reference]
+android:scrollbarTrackVertical : Defines the vertical scrollbar track drawable. [reference]
+android:scrollbarAlwaysDrawHorizontalTrack : Defines whether the horizontal scrollbar track should always be drawn. [boolean]
+android:scrollbarAlwaysDrawVerticalTrack : Defines whether the vertical scrollbar track should always be drawn. [boolean]
+android:fadingEdge : This attribute is deprecated and will be ignored as of API level 14 (ICE_CREAM_SANDWICH). [flag]
+android:requiresFadingEdge : Defines which edges should be faded on scrolling. [flag]
+android:fadingEdgeLength : Defines the length of the fading edges. [dimension]
+android:nextFocusLeft : Defines the next view to give focus to when the next focus is FOCUS_LEFT. [reference]
+android:nextFocusRight : Defines the next view to give focus to when the next focus is FOCUS_RIGHT If the reference refers to a view that does not exist or is part of a hierarchy that is invisible, a java.lang.RuntimeException will result when the reference is accessed. [reference]
+android:nextFocusUp : Defines the next view to give focus to when the next focus is FOCUS_UP If the reference refers to a view that does not exist or is part of a hierarchy that is invisible, a java.lang.RuntimeException will result when the reference is accessed. [reference]
+android:nextFocusDown : Defines the next view to give focus to when the next focus is FOCUS_DOWN If the reference refers to a view that does not exist or is part of a hierarchy that is invisible, a java.lang.RuntimeException will result when the reference is accessed. [reference]
+android:nextFocusForward : Defines the next view to give focus to when the next focus is FOCUS_FORWARD If the reference refers to a view that does not exist or is part of a hierarchy that is invisible, a java.lang.RuntimeException will result when the reference is accessed. [reference]
+android:clickable : Defines whether this view reacts to click events. [boolean]
+android:longClickable : Defines whether this view reacts to long click events. [boolean]
+android:saveEnabled : If unset, no state will be saved for this view when it is being frozen. [boolean]
+android:filterTouchesWhenObscured : Specifies whether to filter touches when the view's window is obscured by another visible window. [boolean]
+android:drawingCacheQuality : Defines the quality of translucent drawing caches. [enum]
+android:keepScreenOn : Controls whether the view's window should keep the screen on while visible. [boolean]
+android:duplicateParentState : When this attribute is set to true, the view gets its drawable state (focused, pressed, etc.) from its direct parent rather than from itself. [boolean]
+android:minHeight : Defines the minimum height of the view.
+android:minWidth : Defines the minimum width of the view.
+android:soundEffectsEnabled : Boolean that controls whether a view should have sound effects enabled for events such as clicking and touching. [boolean]
+android:hapticFeedbackEnabled : Boolean that controls whether a view should have haptic feedback enabled for events such as long presses. [boolean]
+android:contentDescription : Defines text that briefly describes content of the view. [string]
+android:onClick : Name of the method in this View's context to invoke when the view is clicked. [string]
+android:overScrollMode : Defines over-scrolling behavior. [enum]
+android:alpha : alpha property of the view, as a value between 0 (completely transparent) and 1 (completely opaque). [float]
+android:translationX : translation in x of the view. [dimension]
+android:translationY : translation in y of the view. [dimension]
+android:transformPivotX : x location of the pivot point around which the view will rotate and scale. [dimension]
+android:transformPivotY : y location of the pivot point around which the view will rotate and scale. [dimension]
+android:rotation : rotation of the view, in degrees. [float]
+android:rotationX : rotation of the view around the x axis, in degrees. [float]
+android:rotationY : rotation of the view around the y axis, in degrees. [float]
+android:scaleX : scale of the view in the x direction. [float]
+android:scaleY : scale of the view in the y direction. [float]
+android:verticalScrollbarPosition : Determines which side the vertical scroll bar should be placed on. [enum]
+android:layerType : Specifies the type of layer backing this view. [enum]
+android:layoutDirection : Defines the direction of layout drawing. [enum]
+android:textDirection : Direction of the text. [integer, enum]
+android:textAlignment : Alignment of the text. [integer, enum]
+android:importantForAccessibility : Controls how this View is important for accessibility which is if it fires accessibility events and if it is reported to accessibility services that query the screen. [integer, enum]
+android:layout_toLeftOf : Positions the right edge of this view to the left of the given anchor view ID. [reference]
+android:layout_toRightOf : Positions the left edge of this view to the right of the given anchor view ID. [reference]
+android:layout_above : Positions the bottom edge of this view above the given anchor view ID. [reference]
+android:layout_below : Positions the top edge of this view below the given anchor view ID. [reference]
+android:layout_alignBaseline : Positions the baseline of this view on the baseline of the given anchor view ID. [reference]
+android:layout_alignLeft : Makes the left edge of this view match the left edge of the given anchor view ID. [reference]
+android:layout_alignTop : Makes the top edge of this view match the top edge of the given anchor view ID. [reference]
+android:layout_alignRight : Makes the right edge of this view match the right edge of the given anchor view ID. [reference]
+android:layout_alignBottom : Makes the bottom edge of this view match the bottom edge of the given anchor view ID. [reference]
+android:layout_alignParentLeft : If true, makes the left edge of this view match the left edge of the parent. [boolean]
+android:layout_alignParentTop : If true, makes the top edge of this view match the top edge of the parent. [boolean]
+android:layout_alignParentRight : If true, makes the right edge of this view match the right edge of the parent. [boolean]
+android:layout_alignParentBottom : If true, makes the bottom edge of this view match the bottom edge of the parent. [boolean]
+android:layout_centerInParent : If true, centers this child horizontally and vertically within its parent. [boolean]
+android:layout_centerHorizontal : If true, centers this child horizontally within its parent. [boolean]
+android:layout_centerVertical : If true, centers this child vertically within its parent. [boolean]
+android:layout_alignWithParentIfMissing : If set to true, the parent will be used as the anchor when the anchor cannot be be found for layout_toLeftOf, layout_toRightOf, etc. [boolean]
+android:layout_width : Specifies the basic width of the view. [dimension, enum]
+android:layout_height : Specifies the basic height of the view. [dimension, enum]
+android:layout_margin : Specifies extra space on the left, top, right and bottom sides of this view. [dimension]
+android:layout_marginLeft : Specifies extra space on the left side of this view. [dimension]
+android:layout_marginTop : Specifies extra space on the top side of this view. [dimension]
+android:layout_marginRight : Specifies extra space on the right side of this view. [dimension]
+android:layout_marginBottom : Specifies extra space on the bottom side of this view. [dimension]
+android:layout_marginStart : Specifies extra space on the start side of this view. [dimension]
+android:layout_marginEnd : Specifies extra space on the end side of this view. [dimension]
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion12.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion12.xml
new file mode 100644
index 000000000..946a23277
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion12.xml
@@ -0,0 +1,7 @@
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent" >
+
+ <include />
+
+</RelativeLayout>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion2-expected-applyCompletion13a.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion2-expected-applyCompletion13a.diff
new file mode 100644
index 000000000..b36573657
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion2-expected-applyCompletion13a.diff
@@ -0,0 +1,4 @@
+Code completion in completion2.xml for gravity="left|bottom|^cen selecting fill_vertical:
+@@ -4 +4
+- <TextView android:gravity="left|bottom|^cen"></TextView>
++ <TextView android:gravity="left|bottom|fill_vertical^"></TextView>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion2-expected-applyCompletion13b.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion2-expected-applyCompletion13b.diff
new file mode 100644
index 000000000..46268af6d
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion2-expected-applyCompletion13b.diff
@@ -0,0 +1,4 @@
+Code completion in completion2.xml for gravity="left|bottom|cen^ selecting center_horizontal:
+@@ -4 +4
+- <TextView android:gravity="left|bottom|cen^"></TextView>
++ <TextView android:gravity="left|bottom|center_horizontal^"></TextView>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion2-expected-applyCompletion13c.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion2-expected-applyCompletion13c.diff
new file mode 100644
index 000000000..bcac56d16
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion2-expected-applyCompletion13c.diff
@@ -0,0 +1,4 @@
+Code completion in completion2.xml for gravity="left|bottom^|cen selecting bottom|fill_horizontal:
+@@ -4 +4
+- <TextView android:gravity="left|bottom^|cen"></TextView>
++ <TextView android:gravity="left|bottom|fill_horizontal^"></TextView>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion2-expected-completion13a.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion2-expected-completion13a.txt
new file mode 100644
index 000000000..dd28c7365
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion2-expected-completion13a.txt
@@ -0,0 +1,15 @@
+Code completion in completion2.xml for gravity="left|bottom|^cen:
+top
+bottom
+left
+right
+center_vertical
+fill_vertical
+center_horizontal
+fill_horizontal
+center
+fill
+clip_vertical
+clip_horizontal
+start
+end
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion2-expected-completion13b.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion2-expected-completion13b.txt
new file mode 100644
index 000000000..8e6d4d865
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion2-expected-completion13b.txt
@@ -0,0 +1,4 @@
+Code completion in completion2.xml for gravity="left|bottom|cen^:
+center_vertical
+center_horizontal
+center
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion2-expected-completion13c.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion2-expected-completion13c.txt
new file mode 100644
index 000000000..0aebfedea
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion2-expected-completion13c.txt
@@ -0,0 +1,14 @@
+Code completion in completion2.xml for gravity="left|bottom^|cen:
+bottom
+bottom|top
+bottom|right
+bottom|center_vertical
+bottom|fill_vertical
+bottom|center_horizontal
+bottom|fill_horizontal
+bottom|center
+bottom|fill
+bottom|clip_vertical
+bottom|clip_horizontal
+bottom|start
+bottom|end
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion2.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion2.xml
new file mode 100644
index 000000000..0921674cd
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion2.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android">
+ <!-- Test multiple pipes in the flag value -->
+ <TextView android:gravity="left|bottom|cen"></TextView>
+</LinearLayout>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion3-expected-applyCompletion17.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion3-expected-applyCompletion17.diff
new file mode 100644
index 000000000..ef070b28e
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion3-expected-applyCompletion17.diff
@@ -0,0 +1,4 @@
+Code completion in completion3.xml for <EditText ^/> selecting android:textColorHighlight:
+@@ -3 +3
+- <EditText ^/>
++ <EditText android:textColorHighlight="^"/>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion3-expected-applyCompletion18.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion3-expected-applyCompletion18.diff
new file mode 100644
index 000000000..283636b4e
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion3-expected-applyCompletion18.diff
@@ -0,0 +1,4 @@
+Code completion in completion3.xml for <Button ^></Button> selecting android:paddingRight:
+@@ -4 +4
+- <Button ^></Button>
++ <Button android:paddingRight="^"></Button>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion3.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion3.xml
new file mode 100644
index 000000000..afb64b827
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion3.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android">
+ <EditText />
+ <Button ></Button>
+</LinearLayout>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion4-expected-completion22.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion4-expected-completion22.txt
new file mode 100644
index 000000000..c7170dfcc
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion4-expected-completion22.txt
@@ -0,0 +1,2 @@
+Code completion in completion4.xml for <Button^:
+Button
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion4.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion4.xml
new file mode 100644
index 000000000..0047772f5
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion4.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+ <Button
+ android:text="@string/app_name"
+ android:layout_marginLeft="@android:dimen/app_icon_size"
+ android:id="@+id/button1"
+ ></Button>
+</LinearLayout>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion5-expected-applyCompletion19.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion5-expected-applyCompletion19.diff
new file mode 100644
index 000000000..3f7866324
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion5-expected-applyCompletion19.diff
@@ -0,0 +1,4 @@
+Code completion in completion5.xml for android:orientation='^' selecting horizontal:
+@@ -5 +5
+- android:orientation='^'
++ android:orientation='horizontal'^
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion5-expected-applyCompletion20.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion5-expected-applyCompletion20.diff
new file mode 100644
index 000000000..4933d1320
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion5-expected-applyCompletion20.diff
@@ -0,0 +1,4 @@
+Code completion in completion5.xml for android:layout_marginTop='50^dp' selecting 50pt:
+@@ -10 +10
+- android:layout_marginTop='50^dp'
++ android:layout_marginTop='50pt'^
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion5-expected-applyCompletion21.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion5-expected-applyCompletion21.diff
new file mode 100644
index 000000000..a4c88d7fc
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion5-expected-applyCompletion21.diff
@@ -0,0 +1,4 @@
+Code completion in completion5.xml for android:layout_width='^wrap_content' selecting match_parent:
+@@ -11 +11
+- android:layout_width='^wrap_content'
++ android:layout_width='match_parent'^
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion5-expected-applyCompletion40.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion5-expected-applyCompletion40.diff
new file mode 100644
index 000000000..705f865ce
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion5-expected-applyCompletion40.diff
@@ -0,0 +1,4 @@
+Code completion in completion5.xml for android:id='@+id/button2'^ selecting android:maxWidth:
+@@ -15 +15
+- android:id='@+id/button2'^
++ android:id='@+id/button2' android:maxWidth="^"
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion5-expected-completion40.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion5-expected-completion40.txt
new file mode 100644
index 000000000..a4cf0fa45
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion5-expected-completion40.txt
@@ -0,0 +1,156 @@
+Code completion in completion5.xml for android:id='@+id/button2'^:
+style : A reference to a custom style [reference]
+android:bufferType : Determines the minimum type that getText() will return. [enum]
+android:text : Text to display. [string]
+android:hint : Hint text to display when the text is empty. [string]
+android:textColor : Text color. [color, reference]
+android:textColorHighlight : Color of the text selection highlight. [color, reference]
+android:textColorHint : Color of the hint text. [color, reference]
+android:textAppearance : Base text color, typeface, size, and style. [reference]
+android:textSize : Size of the text. [dimension]
+android:textScaleX : Sets the horizontal scaling factor for the text. [float]
+android:typeface : Typeface (normal, sans, serif, monospace) for the text. [enum]
+android:textStyle : Style (bold, italic, bolditalic) for the text. [flag]
+android:fontFamily : Font family (named by string) for the text. [string]
+android:textColorLink : Text color for links. [color, reference]
+android:cursorVisible : Makes the cursor visible (the default) or invisible. [boolean]
+android:maxLines : Makes the TextView be at most this many lines tall. [integer]
+android:maxHeight : Makes the TextView be at most this many pixels tall. [dimension]
+android:lines : Makes the TextView be exactly this many lines tall. [integer]
+android:height : Makes the TextView be exactly this many pixels tall. [dimension]
+android:minLines : Makes the TextView be at least this many lines tall. [integer]
+android:minHeight : Makes the TextView be at least this many pixels tall. [dimension]
+android:maxEms : Makes the TextView be at most this many ems wide. [integer]
+android:maxWidth : Makes the TextView be at most this many pixels wide. [dimension]
+android:ems : Makes the TextView be exactly this many ems wide. [integer]
+android:width : Makes the TextView be exactly this many pixels wide. [dimension]
+android:minEms : Makes the TextView be at least this many ems wide. [integer]
+android:minWidth : Makes the TextView be at least this many pixels wide. [dimension]
+android:gravity : Specifies how to align the text by the view's x- and/or y-axis when the text is smaller than the view. [flag]
+android:scrollHorizontally : Whether the text is allowed to be wider than the view (and therefore can be scrolled horizontally). [boolean]
+android:password : Whether the characters of the field are displayed as password dots instead of themselves. * Deprecated: Use inputType instead. [boolean]
+android:singleLine : Constrains the text to a single horizontally scrolling line instead of letting it wrap onto multiple lines, and advances focus instead of inserting a newline when you press the enter key. * Deprecated: This attribute is deprecated. Use "maxLines" instead to change the layo...
+android:enabled : Specifies whether the widget is enabled. [boolean]
+android:selectAllOnFocus : If the text is selectable, select it all when the view takes focus. [boolean]
+android:includeFontPadding : Leave enough room for ascenders and descenders instead of using the font ascent and descent strictly. [boolean]
+android:maxLength : Set an input filter to constrain the text length to the specified number. [integer]
+android:shadowColor : Place a shadow of the specified color behind the text. [color]
+android:shadowDx : Horizontal offset of the shadow. [float]
+android:shadowDy : Vertical offset of the shadow. [float]
+android:shadowRadius : Radius of the shadow. [float]
+android:autoLink : Controls whether links such as urls and email addresses are automatically found and converted to clickable links. [flag]
+android:linksClickable : If set to false, keeps the movement method from being set to the link movement method even if autoLink causes links to be found. [boolean]
+android:numeric : If set, specifies that this TextView has a numeric input method. * Deprecated: Use inputType instead. [flag]
+android:digits : If set, specifies that this TextView has a numeric input method and that these specific characters are the ones that it will accept. [string]
+android:phoneNumber : If set, specifies that this TextView has a phone number input method. * Deprecated: Use inputType instead. [boolean]
+android:inputMethod : If set, specifies that this TextView should use the specified input method (specified by fully-qualified class name). * Deprecated: Use inputType instead. [string]
+android:capitalize : If set, specifies that this TextView has a textual input method and should automatically capitalize what the user types. * Deprecated: Use inputType instead. [enum]
+android:autoText : If set, specifies that this TextView has a textual input method and automatically corrects some common spelling errors. * Deprecated: Use inputType instead. [boolean]
+android:editable : If set, specifies that this TextView has an input method. * Deprecated: Use inputType instead. [boolean]
+android:freezesText : If set, the text view will include its current complete text inside of its frozen icicle in addition to meta-data such as the current cursor position. [boolean]
+android:ellipsize : If set, causes words that are longer than the view is wide to be ellipsized instead of broken in the middle. [enum]
+android:drawableTop : The drawable to be drawn above the text. [color, reference]
+android:drawableBottom : The drawable to be drawn below the text. [color, reference]
+android:drawableLeft : The drawable to be drawn to the left of the text. [color, reference]
+android:drawableRight : The drawable to be drawn to the right of the text. [color, reference]
+android:drawableStart : The drawable to be drawn to the start of the text. [color, reference]
+android:drawableEnd : The drawable to be drawn to the end of the text. [color, reference]
+android:drawablePadding : The padding between the drawables and the text. [dimension]
+android:lineSpacingExtra : Extra spacing between lines of text. [dimension]
+android:lineSpacingMultiplier : Extra spacing between lines of text, as a multiplier. [float]
+android:marqueeRepeatLimit : The number of times to repeat the marquee animation. [integer, enum]
+android:inputType : The type of data being placed in a text field, used to help an input method decide how to let the user enter text. [flag]
+android:imeOptions : Additional features you can enable in an IME associated with an editor to improve the integration with your application. [flag]
+android:privateImeOptions : An addition content type description to supply to the input method attached to the text view, which is private to the implementation of the input method. [string]
+android:imeActionLabel : Supply a value for EditorInfo.actionLabel used when an input method is connected to the text view. [string]
+android:imeActionId : Supply a value for EditorInfo.actionId used when an input method is connected to the text view. [integer]
+android:editorExtras : Reference to an "input-extras" XML resource containing additional data to supply to an input method, which is private to the implementation of the input method. [reference]
+android:textSelectHandleLeft : Reference to a drawable that will be used to display a text selection anchor on the left side of a selection region. [reference]
+android:textSelectHandleRight : Reference to a drawable that will be used to display a text selection anchor on the right side of a selection region. [reference]
+android:textSelectHandle : Reference to a drawable that will be used to display a text selection anchor for positioning the cursor within text. [reference]
+android:textEditPasteWindowLayout : The layout of the view that is displayed on top of the cursor to paste inside a TextEdit field. [reference]
+android:textEditNoPasteWindowLayout : Variation of textEditPasteWindowLayout displayed when the clipboard is empty. [reference]
+android:textEditSidePasteWindowLayout : Used instead of textEditPasteWindowLayout when the window is moved on the side of the insertion cursor because it would be clipped if it were positioned on top. [reference]
+android:textEditSideNoPasteWindowLayout : Variation of textEditSidePasteWindowLayout displayed when the clipboard is empty. [reference]
+android:textEditSuggestionItemLayout : Layout of the TextView item that will populate the suggestion popup window. [reference]
+android:textCursorDrawable : Reference to a drawable that will be drawn under the insertion cursor. [reference]
+android:textIsSelectable : Indicates that the content of a non-editable text can be selected. [boolean]
+android:textAllCaps : Present the text in ALL CAPS. [boolean]
+android:id : Supply an identifier name for this view, to later retrieve it with View.findViewById() or Activity.findViewById(). [reference]
+android:tag : Supply a tag for this view containing a String, to be retrieved later with View.getTag() or searched for with View.findViewWithTag() . [string]
+android:scrollX : The initial horizontal scroll offset, in pixels. [dimension]
+android:scrollY : The initial vertical scroll offset, in pixels. [dimension]
+android:background : A drawable to use as the background. [color, reference]
+android:padding : Sets the padding, in pixels, of all four edges. [dimension]
+android:paddingLeft : Sets the padding, in pixels, of the left edge; see padding. [dimension]
+android:paddingTop : Sets the padding, in pixels, of the top edge; see padding. [dimension]
+android:paddingRight : Sets the padding, in pixels, of the right edge; see padding. [dimension]
+android:paddingBottom : Sets the padding, in pixels, of the bottom edge; see padding. [dimension]
+android:paddingStart : Sets the padding, in pixels, of the start edge; see padding. [dimension]
+android:paddingEnd : Sets the padding, in pixels, of the end edge; see padding. [dimension]
+android:focusable : Boolean that controls whether a view can take focus. [boolean]
+android:focusableInTouchMode : Boolean that controls whether a view can take focus while in touch mode. [boolean]
+android:visibility : Controls the initial visibility of the view. [enum]
+android:fitsSystemWindows : Boolean internal attribute to adjust view layout based on system windows such as the status bar. [boolean]
+android:scrollbars : Defines which scrollbars should be displayed on scrolling or not. [flag]
+android:scrollbarStyle : Controls the scrollbar style and position. [enum]
+android:isScrollContainer : Set this if the view will serve as a scrolling container, meaing that it can be resized to shrink its overall window so that there will be space for an input method. [boolean]
+android:fadeScrollbars : Defines whether to fade out scrollbars when they are not in use. [boolean]
+android:scrollbarFadeDuration : Defines the delay in milliseconds that a scrollbar takes to fade out. [integer]
+android:scrollbarDefaultDelayBeforeFade : Defines the delay in milliseconds that a scrollbar waits before fade out. [integer]
+android:scrollbarSize : Sets the width of vertical scrollbars and height of horizontal scrollbars. [dimension]
+android:scrollbarThumbHorizontal : Defines the horizontal scrollbar thumb drawable. [reference]
+android:scrollbarThumbVertical : Defines the vertical scrollbar thumb drawable. [reference]
+android:scrollbarTrackHorizontal : Defines the horizontal scrollbar track drawable. [reference]
+android:scrollbarTrackVertical : Defines the vertical scrollbar track drawable. [reference]
+android:scrollbarAlwaysDrawHorizontalTrack : Defines whether the horizontal scrollbar track should always be drawn. [boolean]
+android:scrollbarAlwaysDrawVerticalTrack : Defines whether the vertical scrollbar track should always be drawn. [boolean]
+android:fadingEdge : This attribute is deprecated and will be ignored as of API level 14 (ICE_CREAM_SANDWICH). [flag]
+android:requiresFadingEdge : Defines which edges should be faded on scrolling. [flag]
+android:fadingEdgeLength : Defines the length of the fading edges. [dimension]
+android:nextFocusLeft : Defines the next view to give focus to when the next focus is FOCUS_LEFT. [reference]
+android:nextFocusRight : Defines the next view to give focus to when the next focus is FOCUS_RIGHT If the reference refers to a view that does not exist or is part of a hierarchy that is invisible, a java.lang.RuntimeException will result when the reference is accessed. [reference]
+android:nextFocusUp : Defines the next view to give focus to when the next focus is FOCUS_UP If the reference refers to a view that does not exist or is part of a hierarchy that is invisible, a java.lang.RuntimeException will result when the reference is accessed. [reference]
+android:nextFocusDown : Defines the next view to give focus to when the next focus is FOCUS_DOWN If the reference refers to a view that does not exist or is part of a hierarchy that is invisible, a java.lang.RuntimeException will result when the reference is accessed. [reference]
+android:nextFocusForward : Defines the next view to give focus to when the next focus is FOCUS_FORWARD If the reference refers to a view that does not exist or is part of a hierarchy that is invisible, a java.lang.RuntimeException will result when the reference is accessed. [reference]
+android:clickable : Defines whether this view reacts to click events. [boolean]
+android:longClickable : Defines whether this view reacts to long click events. [boolean]
+android:saveEnabled : If unset, no state will be saved for this view when it is being frozen. [boolean]
+android:filterTouchesWhenObscured : Specifies whether to filter touches when the view's window is obscured by another visible window. [boolean]
+android:drawingCacheQuality : Defines the quality of translucent drawing caches. [enum]
+android:keepScreenOn : Controls whether the view's window should keep the screen on while visible. [boolean]
+android:duplicateParentState : When this attribute is set to true, the view gets its drawable state (focused, pressed, etc.) from its direct parent rather than from itself. [boolean]
+android:minHeight : Defines the minimum height of the view.
+android:minWidth : Defines the minimum width of the view.
+android:soundEffectsEnabled : Boolean that controls whether a view should have sound effects enabled for events such as clicking and touching. [boolean]
+android:hapticFeedbackEnabled : Boolean that controls whether a view should have haptic feedback enabled for events such as long presses. [boolean]
+android:contentDescription : Defines text that briefly describes content of the view. [string]
+android:onClick : Name of the method in this View's context to invoke when the view is clicked. [string]
+android:overScrollMode : Defines over-scrolling behavior. [enum]
+android:alpha : alpha property of the view, as a value between 0 (completely transparent) and 1 (completely opaque). [float]
+android:translationX : translation in x of the view. [dimension]
+android:translationY : translation in y of the view. [dimension]
+android:transformPivotX : x location of the pivot point around which the view will rotate and scale. [dimension]
+android:transformPivotY : y location of the pivot point around which the view will rotate and scale. [dimension]
+android:rotation : rotation of the view, in degrees. [float]
+android:rotationX : rotation of the view around the x axis, in degrees. [float]
+android:rotationY : rotation of the view around the y axis, in degrees. [float]
+android:scaleX : scale of the view in the x direction. [float]
+android:scaleY : scale of the view in the y direction. [float]
+android:verticalScrollbarPosition : Determines which side the vertical scroll bar should be placed on. [enum]
+android:layerType : Specifies the type of layer backing this view. [enum]
+android:layoutDirection : Defines the direction of layout drawing. [enum]
+android:textDirection : Direction of the text. [integer, enum]
+android:textAlignment : Alignment of the text. [integer, enum]
+android:importantForAccessibility : Controls how this View is important for accessibility which is if it fires accessibility events and if it is reported to accessibility services that query the screen. [integer, enum]
+android:layout_width : Specifies the basic width of the view. [dimension, enum]
+android:layout_height : Specifies the basic height of the view. [dimension, enum]
+android:layout_weight : [float]
+android:layout_gravity : Standard gravity constant that a child can supply to its parent. [flag]
+android:layout_margin : Specifies extra space on the left, top, right and bottom sides of this view. [dimension]
+android:layout_marginLeft : Specifies extra space on the left side of this view. [dimension]
+android:layout_marginTop : Specifies extra space on the top side of this view. [dimension]
+android:layout_marginRight : Specifies extra space on the right side of this view. [dimension]
+android:layout_marginBottom : Specifies extra space on the bottom side of this view. [dimension]
+android:layout_marginStart : Specifies extra space on the start side of this view. [dimension]
+android:layout_marginEnd : Specifies extra space on the end side of this view. [dimension]
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion5.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion5.xml
new file mode 100644
index 000000000..757be8b8e
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion5.xml
@@ -0,0 +1,23 @@
+<?xml version='1.0' encoding='utf-8'?>
+<LinearLayout
+ xmlns:android='http://schemas.android.com/apk/res/android'
+ android:layout_width='match_parent'
+ android:orientation=''
+ android:layout_height='match_parent'>
+ <Button
+ android:text="what's up doc?"
+ android:id='@+id/button1'
+ android:layout_marginTop='50dp'
+ android:layout_width='wrap_content'
+ android:layout_height='wrap_content'></Button>
+ <Button
+ android:text="quote='"
+ android:id='@+id/button2'
+ android:layout_width='wrap_content'
+ android:layout_height='wrap_content'></Button>
+ <Button
+ android:text='quote="'
+ android:id='@+id/button2'
+ android:layout_width='wrap_content'
+ android:layout_height='wrap_content'></Button>
+</LinearLayout>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion6-expected-applyCompletion22.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion6-expected-applyCompletion22.diff
new file mode 100644
index 000000000..92cd2f2ab
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion6-expected-applyCompletion22.diff
@@ -0,0 +1,4 @@
+Code completion in completion6.xml for android:orientation="^" selecting horizontal:
+@@ -5 +5
+- android:orientation="^"
++ android:orientation="horizontal"^
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion6.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion6.xml
new file mode 100644
index 000000000..55bfa0c93
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion6.xml
@@ -0,0 +1,7 @@
+<?xml version='1.0' encoding='utf-8'?>
+<LinearLayout
+ xmlns:android='http://schemas.android.com/apk/res/android'
+ android:layout_width='match_parent'
+ android:orientation=""
+ android:layout_height='match_parent'>
+</LinearLayout>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion7-expected-applyCompletion23.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion7-expected-applyCompletion23.diff
new file mode 100644
index 000000000..1aaadc267
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion7-expected-applyCompletion23.diff
@@ -0,0 +1,4 @@
+Code completion in completion7.xml for android:orientation="^ selecting horizontal:
+@@ -5 +5
+- android:orientation="^
++ android:orientation="horizontal^
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion7.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion7.xml
new file mode 100644
index 000000000..30afbaf4f
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion7.xml
@@ -0,0 +1,7 @@
+<?xml version='1.0' encoding='utf-8'?>
+<LinearLayout
+ xmlns:android='http://schemas.android.com/apk/res/android'
+ android:layout_width='match_parent'
+ android:orientation="
+ android:layout_height='match_parent'>
+</LinearLayout>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion8-expected-applyCompletion41.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion8-expected-applyCompletion41.diff
new file mode 100644
index 000000000..7678740d1
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion8-expected-applyCompletion41.diff
@@ -0,0 +1,4 @@
+Code completion in completion8.xml for android:mar^="50dp" selecting android:layout_marginRight:
+@@ -6 +6
+- android:mar^="50dp"
++ android:layout_marginRight^="50dp"
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion8-expected-completion41.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion8-expected-completion41.txt
new file mode 100644
index 000000000..0c2e215ec
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion8-expected-completion41.txt
@@ -0,0 +1,9 @@
+Code completion in completion8.xml for android:mar^="50dp":
+android:layout_margin : Specifies extra space on the left, top, right and bottom sides of this view. [dimension]
+android:layout_marginLeft : Specifies extra space on the left side of this view. [dimension]
+android:layout_marginTop : Specifies extra space on the top side of this view. [dimension]
+android:layout_marginRight : Specifies extra space on the right side of this view. [dimension]
+android:layout_marginBottom : Specifies extra space on the bottom side of this view. [dimension]
+android:layout_marginStart : Specifies extra space on the start side of this view. [dimension]
+android:layout_marginEnd : Specifies extra space on the end side of this view. [dimension]
+android:marqueeRepeatLimit : The number of times to repeat the marquee animation. [integer, enum]
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion8-expected-completion42.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion8-expected-completion42.txt
new file mode 100644
index 000000000..f5b072093
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion8-expected-completion42.txt
@@ -0,0 +1,4 @@
+Code completion in completion8.xml for android:w^i="100":
+android:layout_width : Specifies the basic width of the view. [dimension, enum]
+android:layout_weight : [float]
+android:width : Makes the TextView be exactly this many pixels wide. [dimension]
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion8-expected-completion43.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion8-expected-completion43.txt
new file mode 100644
index 000000000..50f13d18b
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion8-expected-completion43.txt
@@ -0,0 +1,9 @@
+Code completion in completion8.xml for mar^="60dp":
+android:layout_margin : Specifies extra space on the left, top, right and bottom sides of this view. [dimension]
+android:layout_marginLeft : Specifies extra space on the left side of this view. [dimension]
+android:layout_marginTop : Specifies extra space on the top side of this view. [dimension]
+android:layout_marginRight : Specifies extra space on the right side of this view. [dimension]
+android:layout_marginBottom : Specifies extra space on the bottom side of this view. [dimension]
+android:layout_marginStart : Specifies extra space on the start side of this view. [dimension]
+android:layout_marginEnd : Specifies extra space on the end side of this view. [dimension]
+android:marqueeRepeatLimit : The number of times to repeat the marquee animation. [integer, enum]
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion8-expected-completion44.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion8-expected-completion44.txt
new file mode 100644
index 000000000..357814507
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion8-expected-completion44.txt
@@ -0,0 +1,13 @@
+Code completion in completion8.xml for android:layo^ut_width="fill_parent":
+android:layout_width : Specifies the basic width of the view. [dimension, enum]
+android:layout_height : Specifies the basic height of the view. [dimension, enum]
+android:layout_weight : [float]
+android:layout_gravity : Standard gravity constant that a child can supply to its parent. [flag]
+android:layout_margin : Specifies extra space on the left, top, right and bottom sides of this view. [dimension]
+android:layout_marginLeft : Specifies extra space on the left side of this view. [dimension]
+android:layout_marginTop : Specifies extra space on the top side of this view. [dimension]
+android:layout_marginRight : Specifies extra space on the right side of this view. [dimension]
+android:layout_marginBottom : Specifies extra space on the bottom side of this view. [dimension]
+android:layout_marginStart : Specifies extra space on the start side of this view. [dimension]
+android:layout_marginEnd : Specifies extra space on the end side of this view. [dimension]
+android:layoutDirection : Defines the direction of layout drawing. [enum]
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion8.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion8.xml
new file mode 100644
index 000000000..3f9d6b537
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion8.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android">
+ <TextView
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:mar="50dp"
+ android:wi="100"
+ mar="60dp"
+ />
+</LinearLayout>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion9-expected-completion62.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion9-expected-completion62.txt
new file mode 100644
index 000000000..9189a827c
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion9-expected-completion62.txt
@@ -0,0 +1,2 @@
+Code completion in completion9.xml for android:layout_wi^dth=:
+android:layout_width : Specifies the basic width of the view. [dimension, enum]
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion9-expected-completion63.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion9-expected-completion63.txt
new file mode 100644
index 000000000..c6ee31dbe
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion9-expected-completion63.txt
@@ -0,0 +1 @@
+Code completion in completion9.xml for android:drawable^Top:
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion9-expected-completion64.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion9-expected-completion64.txt
new file mode 100644
index 000000000..2085e96da
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion9-expected-completion64.txt
@@ -0,0 +1,68 @@
+Code completion in completion9.xml for ^<Button:
+<AbsoluteLayout ></AbsoluteLayout>
+<AdapterViewFlipper ></AdapterViewFlipper>
+<AnalogClock />
+<AutoCompleteTextView />
+<Button />
+<CalendarView />
+<CheckBox />
+<CheckedTextView />
+<Chronometer />
+<DatePicker />
+<DialerFilter ></DialerFilter>
+<DigitalClock />
+<EditText />
+<ExpandableListView ></ExpandableListView>
+<FrameLayout ></FrameLayout>
+<Gallery />
+<GridLayout ></GridLayout>
+<GridView ></GridView>
+<HorizontalScrollView ></HorizontalScrollView>
+<ImageButton />
+<ImageSwitcher ></ImageSwitcher>
+<ImageView />
+<LinearLayout ></LinearLayout>
+<ListView ></ListView>
+<MediaController ></MediaController>
+<MultiAutoCompleteTextView />
+<NumberPicker />
+<ProgressBar />
+<QuickContactBadge />
+<RadioButton />
+<RadioGroup ></RadioGroup>
+<RatingBar />
+<RelativeLayout ></RelativeLayout>
+<ScrollView ></ScrollView>
+<SearchView ></SearchView>
+<SeekBar />
+<SlidingDrawer ></SlidingDrawer> : SlidingDrawer specific attributes.
+<Space />
+<Spinner />
+<StackView ></StackView>
+<SurfaceView />
+<Switch />
+<TabHost ></TabHost>
+<TabWidget ></TabWidget>
+<TableLayout ></TableLayout>
+<TableRow ></TableRow>
+<TextSwitcher ></TextSwitcher>
+<TextView />
+<TextureView />
+<TimePicker />
+<ToggleButton />
+<TwoLineListItem />
+<VideoView />
+<View /> : Attributes that can be used with android.view.View or any of its subclasses.
+<ViewAnimator ></ViewAnimator>
+<ViewFlipper ></ViewFlipper>
+<ViewStub /> : A android.view.ViewStub lets you lazily include other XML layouts inside your application at runtime.
+<ViewSwitcher ></ViewSwitcher>
+<WebView />
+<ZoomButton />
+<ZoomControls />
+<android.gesture.GestureOverlayView ></android.gesture.GestureOverlayView> : GestureOverlayView specific attributes.
+<fragment /> : A Fragment is a piece of an application's user interface or behavior that can be placed in an Activity
+<include /> : Lets you statically include XML layouts inside other XML layouts.
+<merge ></merge> : A root tag useful for XML layouts inflated using a ViewStub.
+<requestFocus /> : Requests focus for the parent element or one of its descendants
+<view /> : A view tag whose class attribute names the class to be instantiated
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion9.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion9.xml
new file mode 100644
index 000000000..9040d8c1f
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion9.xml
@@ -0,0 +1,10 @@
+<com.google.android.apps.iosched.ui.widget.DashboardLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent">
+
+ <Button android:id="@+id/home_btn_schedule"
+ style="@style/DashboardButton"
+ android:text="@string/btn_schedule"
+ android:drawableTop="@drawable/home_btn_schedule" />
+</com.google.android.apps.iosched.ui.widget.DashboardLayout>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion24a.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion24a.diff
new file mode 100644
index 000000000..d3232190c
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion24a.diff
@@ -0,0 +1,4 @@
+Code completion in completionvalues1.xml for android:textS^ize selecting android:textSelectHandleLeft:
+@@ -4 +4
+- <item name="android:textS^ize">17sp</item>
++ <item name="android:textSelectHandleLeft"^>17sp</item>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion24b.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion24b.diff
new file mode 100644
index 000000000..ac71df7eb
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion24b.diff
@@ -0,0 +1,4 @@
+Code completion in completionvalues1.xml for 17^sp selecting 17mm:
+@@ -4 +4
+- <item name="android:textSize">17^sp</item>
++ <item name="android:textSize">17mm^</item>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion25.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion25.diff
new file mode 100644
index 000000000..df6fceb9e
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion25.diff
@@ -0,0 +1,4 @@
+Code completion in completionvalues1.xml for textColor">^@color/title_color</item> selecting @android::
+@@ -5 +5
+- <item name="android:textColor">^@color/title_color</item>
++ <item name="android:textColor">@android:^</item>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion26.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion26.diff
new file mode 100644
index 000000000..36fce8b9e
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion26.diff
@@ -0,0 +1,4 @@
+Code completion in completionvalues1.xml for <item name="android:shadowColor">@an^</item> selecting @android::
+@@ -6 +6
+- <item name="android:shadowColor">@an^</item>
++ <item name="android:shadowColor">@android:^</item>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion27.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion27.diff
new file mode 100644
index 000000000..6315fc4fd
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion27.diff
@@ -0,0 +1,4 @@
+Code completion in completionvalues1.xml for <item name="android:gravity">^ </item> selecting center_vertical:
+@@ -7 +7
+- <item name="android:gravity">^ </item>
++ <item name="android:gravity">center_vertical^</item>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion28.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion28.diff
new file mode 100644
index 000000000..1db9773a1
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion28.diff
@@ -0,0 +1,4 @@
+Code completion in completionvalues1.xml for <item name="android:gravity"> ^</item> selecting left:
+@@ -7 +7
+- <item name="android:gravity"> ^</item>
++ <item name="android:gravity"> left^</item>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion29.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion29.diff
new file mode 100644
index 000000000..63076464d
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion29.diff
@@ -0,0 +1,4 @@
+Code completion in completionvalues1.xml for <item name="gr^"> selecting android:gravity:
+@@ -8 +8
+- <item name="gr^">@color/title_color</item>
++ <item name="android:gravity"^>@color/title_color</item>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion30.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion30.diff
new file mode 100644
index 000000000..c8a119fd9
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion30.diff
@@ -0,0 +1,4 @@
+Code completion in completionvalues1.xml for <item name="an^"> selecting android:animateOnClick:
+@@ -9 +9
+- <item name="an^">@color/title_color</item>
++ <item name="android:animateOnClick"^>@color/title_color</item>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion31.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion31.diff
new file mode 100644
index 000000000..9b3743807
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion31.diff
@@ -0,0 +1,4 @@
+Code completion in completionvalues1.xml for <item ^></item> selecting name:
+@@ -10 +10
+- <item ^></item>
++ <item name="^"></item>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion32.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion32.diff
new file mode 100644
index 000000000..b34a8ec5c
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion32.diff
@@ -0,0 +1,4 @@
+Code completion in completionvalues1.xml for <item name="^"></item> selecting android:background:
+@@ -11 +11
+- <item name="^"></item>
++ <item name="android:background"^></item>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion33.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion33.diff
new file mode 100644
index 000000000..b78adee5b
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion33.diff
@@ -0,0 +1,4 @@
+Code completion in completionvalues1.xml for <item name="android:allowSingleTap">^</item> selecting true:
+@@ -12 +12
+- <item name="android:allowSingleTap">^</item>
++ <item name="android:allowSingleTap">true^</item>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion34.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion34.diff
new file mode 100644
index 000000000..5af6c92d5
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion34.diff
@@ -0,0 +1,4 @@
+Code completion in completionvalues1.xml for <item name="android:alwaysDrawnWithCache">^ false </item> selecting true:
+@@ -13 +13
+- <item name="android:alwaysDrawnWithCache">^ false </item>
++ <item name="android:alwaysDrawnWithCache">true^</item>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion35.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion35.diff
new file mode 100644
index 000000000..f48f10143
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion35.diff
@@ -0,0 +1,4 @@
+Code completion in completionvalues1.xml for <item name="android:alwaysDrawnWithCache"> ^false </item> selecting true:
+@@ -13 +13
+- <item name="android:alwaysDrawnWithCache"> ^false </item>
++ <item name="android:alwaysDrawnWithCache"> true^</item>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion36.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion36.diff
new file mode 100644
index 000000000..8c246a8ff
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion36.diff
@@ -0,0 +1,4 @@
+Code completion in completionvalues1.xml for <item name="android:alwaysDrawnWithCache"> f^alse </item> selecting false:
+@@ -13 +13
+- <item name="android:alwaysDrawnWithCache"> f^alse </item>
++ <item name="android:alwaysDrawnWithCache"> false^</item>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion37.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion37.diff
new file mode 100644
index 000000000..082f2b25c
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion37.diff
@@ -0,0 +1,4 @@
+Code completion in completionvalues1.xml for <item name="android:orientation">h^</item> selecting horizontal:
+@@ -14 +14
+- <item name="android:orientation">h^</item>
++ <item name="android:orientation">horizontal^</item>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion38.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion38.diff
new file mode 100644
index 000000000..47580e1d8
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion38.diff
@@ -0,0 +1,4 @@
+Code completion in completionvalues1.xml for c^ selecting center:
+@@ -16 +16
+- c^
++ center^
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion44.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion44.diff
new file mode 100644
index 000000000..57fe472e5
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion44.diff
@@ -0,0 +1,4 @@
+Code completion in completionvalues1.xml for [^false] selecting true:
+@@ -13 +13
+- <item name="android:alwaysDrawnWithCache"> ^false </item>
++ <item name="android:alwaysDrawnWithCache"> true^</item>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion23.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion23.txt
new file mode 100644
index 000000000..a2f64dc72
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion23.txt
@@ -0,0 +1,7 @@
+Code completion in completionvalues1.xml for android:textS^ize:
+android:textScaleX : Sets the horizontal scaling factor for the text. [float]
+android:textSelectHandle : Reference to a drawable that will be used to display a text selection anchor for positioning the cursor within text. [reference]
+android:textSelectHandleLeft : Reference to a drawable that will be used to display a text selection anchor on the left side of a selection region. [reference]
+android:textSelectHandleRight : Reference to a drawable that will be used to display a text selection anchor on the right side of a selection region. [reference]
+android:textSize : Size of the text. [dimension]
+android:textStyle : Style (bold, italic, bolditalic) for the text. [flag]
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion24.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion24.txt
new file mode 100644
index 000000000..c1de9ec99
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion24.txt
@@ -0,0 +1,7 @@
+Code completion in completionvalues1.xml for 17^sp:
+17dp : <b>Density-independent Pixels</b> - an abstract unit that is based on the physical density of the screen.
+17sp : <b>Scale-independent Pixels</b> - this is like the dp unit, but it is also scaled by the user's font size preference.
+17pt : <b>Points</b> - 1/72 of an inch based on the physical size of the screen.
+17mm : <b>Millimeters</b> - based on the physical size of the screen.
+17in : <b>Inches</b> - based on the physical size of the screen.
+17px : <b>Pixels</b> - corresponds to actual pixels on the screen. Not recommended.
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion25.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion25.txt
new file mode 100644
index 000000000..b57246dd0
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion25.txt
@@ -0,0 +1,8 @@
+Code completion in completionvalues1.xml for textColor">^@color/title_color</item>:
+@android:
+@+id/
+@drawable/
+@id/
+@layout/
+@string/
+@style/
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion26.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion26.txt
new file mode 100644
index 000000000..b1c541c38
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion26.txt
@@ -0,0 +1,2 @@
+Code completion in completionvalues1.xml for <item name="android:shadowColor">@an^</item>:
+@android:
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion27.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion27.txt
new file mode 100644
index 000000000..22b636ddf
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion27.txt
@@ -0,0 +1,15 @@
+Code completion in completionvalues1.xml for <item name="android:gravity">^ </item>:
+top
+bottom
+left
+right
+center_vertical
+fill_vertical
+center_horizontal
+fill_horizontal
+center
+fill
+clip_vertical
+clip_horizontal
+start
+end
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion28.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion28.txt
new file mode 100644
index 000000000..2a850294d
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion28.txt
@@ -0,0 +1,15 @@
+Code completion in completionvalues1.xml for <item name="android:gravity"> ^</item>:
+top
+bottom
+left
+right
+center_vertical
+fill_vertical
+center_horizontal
+fill_horizontal
+center
+fill
+clip_vertical
+clip_horizontal
+start
+end
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion29.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion29.txt
new file mode 100644
index 000000000..c082ce44b
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion29.txt
@@ -0,0 +1,3 @@
+Code completion in completionvalues1.xml for <item name="gr^">:
+android:gravity : Specifies how to place the content of an object, both on the x- and y-axis, within the object itself. [flag]
+android:groupIndicator : Indicator shown beside the group View. [reference]
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion30.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion30.txt
new file mode 100644
index 000000000..efee2bcf5
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion30.txt
@@ -0,0 +1,8 @@
+Code completion in completionvalues1.xml for <item name="an^">:
+android:
+android:animateFirstView : Defines whether to animate the current View when the ViewAnimation is first displayed. [boolean]
+android:animateLayoutChanges : Defines whether changes in layout (caused by adding and removing items) should cause a LayoutTransition to run. [boolean]
+android:animateOnClick : Indicates whether the drawer should be opened/closed with an animation when the user clicks the handle. [boolean]
+android:animationCache : Defines whether layout animations should create a drawing cache for their children. [boolean]
+android:animationDuration : Sets how long a transition animation should run (in milliseconds) when layout has changed. [integer]
+android:animationResolution : Timeout between frames of animation in milliseconds * Deprecated: Not used by the framework. [integer]
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion31.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion31.txt
new file mode 100644
index 000000000..90441643c
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion31.txt
@@ -0,0 +1,2 @@
+Code completion in completionvalues1.xml for <item ^></item>:
+name : The mandatory name used in referring to this item.
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion32.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion32.txt
new file mode 100644
index 000000000..57684d7ce
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion32.txt
@@ -0,0 +1,317 @@
+Code completion in completionvalues1.xml for <item name="^"></item>:
+android:
+android:addStatesFromChildren : Sets whether this ViewGroup's drawable states also include its children's drawable states. [boolean]
+android:adjustViewBounds : Set this to true if you want the ImageView to adjust its bounds to preserve the aspect ratio of its drawable. [boolean]
+android:alignmentMode : When set to alignMargins, causes alignment to take place between the outer boundary of a view, as defined by its margins. [enum]
+android:allowSingleTap : Indicates whether the drawer can be opened/closed by a single tap on the handle. [boolean]
+android:alpha : alpha property of the view, as a value between 0 (completely transparent) and 1 (completely opaque). [float]
+android:alwaysDrawnWithCache : Defines whether the ViewGroup should always draw its children using their drawing cache or not. [boolean]
+android:animateFirstView : Defines whether to animate the current View when the ViewAnimation is first displayed. [boolean]
+android:animateLayoutChanges : Defines whether changes in layout (caused by adding and removing items) should cause a LayoutTransition to run. [boolean]
+android:animateOnClick : Indicates whether the drawer should be opened/closed with an animation when the user clicks the handle. [boolean]
+android:animationCache : Defines whether layout animations should create a drawing cache for their children. [boolean]
+android:animationDuration : Sets how long a transition animation should run (in milliseconds) when layout has changed. [integer]
+android:animationResolution : Timeout between frames of animation in milliseconds * Deprecated: Not used by the framework. [integer]
+android:autoLink : Controls whether links such as urls and email addresses are automatically found and converted to clickable links. [flag]
+android:autoStart : When true, automatically start animating [boolean]
+android:autoText : If set, specifies that this TextView has a textual input method and automatically corrects some common spelling errors. * Deprecated: Use inputType instead. [boolean]
+android:background : A drawable to use as the background. [color, reference]
+android:baseline : The offset of the baseline within this view. [dimension]
+android:baselineAlignBottom : If true, the image view will be baseline aligned with based on its bottom edge. [boolean]
+android:baselineAligned : When set to false, prevents the layout from aligning its children's baselines. [boolean]
+android:baselineAlignedChildIndex : When a linear layout is part of another layout that is baseline aligned, it can specify which of its children to baseline align to (that is, which child TextView). [integer]
+android:bottomOffset : Extra offset for the handle at the bottom of the SlidingDrawer. [dimension]
+android:bufferType : Determines the minimum type that getText() will return. [enum]
+android:button : Drawable used for the button graphic (e.g. checkbox, radio button, etc). [reference]
+android:cacheColorHint : Indicates that this list will always be drawn on top of solid, single-color opaque background. [color]
+android:calendarViewShown : Whether the calendar view is shown. [boolean]
+android:capitalize : If set, specifies that this TextView has a textual input method and should automatically capitalize what the user types. * Deprecated: Use inputType instead. [enum]
+android:checkMark : Drawable used for the check mark graphic. [reference]
+android:checked : Indicates the initial checked state of this button. [boolean]
+android:checkedButton : The id of the child radio button that should be checked by default within this radio group. [integer]
+android:childDivider : Drawable or color that is used as a divider for children. [color, reference]
+android:childIndicator : Indicator shown beside the child View. [reference]
+android:childIndicatorLeft : The left bound for a child's indicator. [dimension]
+android:childIndicatorRight : The right bound for a child's indicator. [dimension]
+android:choiceMode : Defines the choice behavior for the view. [enum]
+class : Supply the name of the view class to instantiate
+android:clickColor : Color of the outline of click feedback. [color]
+android:clickable : Defines whether this view reacts to click events. [boolean]
+android:clipChildren : Defines whether a child is limited to draw inside of its bounds or not. [boolean]
+android:clipToPadding : Defines whether the ViewGroup will clip its drawing surface so as to exclude the padding area. [boolean]
+android:collapseColumns : The zero-based index of the columns to collapse. [string]
+android:columnCount : The maxmimum number of columns to create when automatically positioning children. [integer]
+android:columnOrderPreserved : When set to true, forces column boundaries to appear in the same order as column indices. [boolean]
+android:columnWidth : Specifies the fixed width for each column. [dimension]
+android:completionHint : Defines the hint displayed in the drop down menu. [string]
+android:completionHintView : Defines the hint view displayed in the drop down menu. [reference]
+android:completionThreshold : Defines the number of characters that the user must type before completion suggestions are displayed in a drop down menu. [integer]
+android:content : Identifier for the child that represents the drawer's content. [reference]
+android:contentDescription : Defines text that briefly describes content of the view. [string]
+android:cropToPadding : If true, the image will be cropped to fit within its padding. [boolean]
+android:cursorVisible : Makes the cursor visible (the default) or invisible. [boolean]
+android:dateTextAppearance : The text appearance for the calendar dates. [reference]
+android:descendantFocusability : Defines the relationship between the ViewGroup and its descendants when looking for a View to take focus. [enum]
+android:dial : [reference]
+android:digits : If set, specifies that this TextView has a numeric input method and that these specific characters are the ones that it will accept. [string]
+android:disableChildrenWhenDisabled : Whether this spinner should mark child views as enabled/disabled when the spinner itself is enabled/disabled. [boolean]
+android:disabledAlpha : The alpha to apply to the indicator when disabled. [float]
+android:divider : Drawable to use as a vertical divider between buttons.
+android:dividerHeight : Height of the divider. [dimension]
+android:dividerPadding : Size of padding on either end of a divider. [dimension]
+android:drawSelectorOnTop : When set to true, the selector will be drawn over the selected item. [boolean]
+android:drawableBottom : The drawable to be drawn below the text. [color, reference]
+android:drawableEnd : The drawable to be drawn to the end of the text. [color, reference]
+android:drawableLeft : The drawable to be drawn to the left of the text. [color, reference]
+android:drawablePadding : The padding between the drawables and the text. [dimension]
+android:drawableRight : The drawable to be drawn to the right of the text. [color, reference]
+android:drawableStart : The drawable to be drawn to the start of the text. [color, reference]
+android:drawableTop : The drawable to be drawn above the text. [color, reference]
+android:drawingCacheQuality : Defines the quality of translucent drawing caches. [enum]
+android:dropDownAnchor : View to anchor the auto-complete dropdown to. [reference]
+android:dropDownHeight : Specifies the basic height of the dropdown. [dimension, enum]
+android:dropDownHorizontalOffset : Horizontal offset from the spinner widget for positioning the dropdown in spinnerMode="dropdown". [dimension]
+android:dropDownSelector : List selector to use for spinnerMode="dropdown" display. [color, reference]
+android:dropDownVerticalOffset : Vertical offset from the spinner widget for positioning the dropdown in spinnerMode="dropdown". [dimension]
+android:dropDownWidth : Width of the dropdown in spinnerMode="dropdown". [dimension, enum]
+android:duplicateParentState : When this attribute is set to true, the view gets its drawable state (focused, pressed, etc.) from its direct parent rather than from itself. [boolean]
+android:editable : If set, specifies that this TextView has an input method. * Deprecated: Use inputType instead. [boolean]
+android:editorExtras : Reference to an "input-extras" XML resource containing additional data to supply to an input method, which is private to the implementation of the input method. [reference]
+android:ellipsize : If set, causes words that are longer than the view is wide to be ellipsized instead of broken in the middle. [enum]
+android:ems : Makes the TextView be exactly this many ems wide. [integer]
+android:enabled : Specifies whether the widget is enabled. [boolean]
+android:endYear : The last year (inclusive), for example "2010". * Deprecated: Use maxDate instead. [integer]
+android:entries : Reference to an array resource that will populate the Spinner. [reference]
+android:eventsInterceptionEnabled : Defines whether the overlay should intercept the motion events when a gesture is recognized. [boolean]
+android:fadeDuration : Duration, in milliseconds, of the fade out effect after the user is done drawing a gesture. [integer]
+android:fadeEnabled : Defines whether the gesture will automatically fade out after being recognized. [boolean]
+android:fadeOffset : Time, in milliseconds, to wait before the gesture fades out after the user is done drawing it. [integer]
+android:fadeScrollbars : Defines whether to fade out scrollbars when they are not in use. [boolean]
+android:fadingEdge : This attribute is deprecated and will be ignored as of API level 14 (ICE_CREAM_SANDWICH). [flag]
+android:fadingEdgeLength : Defines the length of the fading edges. [dimension]
+android:fastScrollAlwaysVisible : When set to true, the list will always show the fast scroll interface. [boolean]
+android:fastScrollEnabled : Enables the fast scroll thumb that can be dragged to quickly scroll through the list. [boolean]
+android:fillViewport : Defines whether the scrollview should stretch its content to fill the viewport. [boolean]
+android:filterTouchesWhenObscured : Specifies whether to filter touches when the view's window is obscured by another visible window. [boolean]
+android:firstDayOfWeek : The first day of week according to java.util.Calendar. [integer]
+android:fitsSystemWindows : Boolean internal attribute to adjust view layout based on system windows such as the status bar. [boolean]
+android:flipInterval : [integer]
+android:focusable : Boolean that controls whether a view can take focus. [boolean]
+android:focusableInTouchMode : Boolean that controls whether a view can take focus while in touch mode. [boolean]
+android:focusedMonthDateColor : The color for the dates of the focused month. [color, reference]
+android:fontFamily : Font family (named by string) for the text. [string]
+android:footerDividersEnabled : When set to false, the ListView will not draw the divider before each footer view. [boolean]
+android:foreground : Defines the drawable to draw over the content. [color, reference]
+android:foregroundGravity : Defines the gravity to apply to the foreground drawable. [flag]
+android:foregroundInsidePadding : Defines whether the foreground drawable should be drawn inside the padding. [boolean]
+android:format : Format string: if specified, the Chronometer will display this string, with the first "%s" replaced by the current timer value in "MM:SS" or "H:MM:SS" form. [string]
+android:freezesText : If set, the text view will include its current complete text inside of its frozen icicle in addition to meta-data such as the current cursor position. [boolean]
+android:gestureColor : Color used to draw a gesture. [color]
+android:gestureStrokeAngleThreshold : Minimum curve angle a stroke must contain before it is recognized as a gesture. [float]
+android:gestureStrokeLengthThreshold : Minimum length of a stroke before it is recognized as a gesture. [float]
+android:gestureStrokeSquarenessThreshold : Squareness threshold of a stroke before it is recognized as a gesture. [float]
+android:gestureStrokeType : Defines the type of strokes that define a gesture. [enum]
+android:gestureStrokeWidth : Width of the stroke used to draw the gesture. [float]
+android:gravity : Specifies how to place the content of an object, both on the x- and y-axis, within the object itself. [flag]
+android:groupIndicator : Indicator shown beside the group View. [reference]
+android:hand_hour : [reference]
+android:hand_minute : [reference]
+android:handle : Identifier for the child that represents the drawer's handle. [reference]
+android:hapticFeedbackEnabled : Boolean that controls whether a view should have haptic feedback enabled for events such as long presses. [boolean]
+android:headerDividersEnabled : When set to false, the ListView will not draw the divider after each header view. [boolean]
+android:height : Makes the TextView be exactly this many pixels tall. [dimension]
+android:hint : Hint text to display when the text is empty. [string]
+android:horizontalSpacing : Defines the default horizontal spacing between columns. [dimension]
+android:iconifiedByDefault : The default state of the SearchView. [boolean]
+android:id : Supply an identifier name for the top-level view, to later retrieve it with View.findViewById() or Activity.findViewById(). [reference]
+android:ignoreGravity : Indicates what view should not be affected by gravity. [reference]
+android:imeActionId : Supply a value for EditorInfo.actionId used when an input method is connected to the text view. [integer]
+android:imeActionLabel : Supply a value for EditorInfo.actionLabel used when an input method is connected to the text view. [string]
+android:imeOptions : Additional features you can enable in an IME associated with an editor to improve the integration with your application. [flag]
+android:importantForAccessibility : Controls how this View is important for accessibility which is if it fires accessibility events and if it is reported to accessibility services that query the screen. [integer, enum]
+android:inAnimation : Identifier for the animation to use when a view is shown. [reference]
+android:includeFontPadding : Leave enough room for ascenders and descenders instead of using the font ascent and descent strictly. [boolean]
+android:indeterminate : Allows to enable the indeterminate mode. [boolean]
+android:indeterminateBehavior : Defines how the indeterminate mode should behave when the progress reaches max. [enum]
+android:indeterminateDrawable : Drawable used for the indeterminate mode. [reference]
+android:indeterminateDuration : Duration of the indeterminate animation. [integer]
+android:indeterminateOnly : Restricts to ONLY indeterminate mode (state-keeping progress mode will not work). [boolean]
+android:indicatorLeft : The left bound for an item's indicator. [dimension]
+android:indicatorRight : The right bound for an item's indicator. [dimension]
+android:inflatedId : Overrides the id of the inflated View with this value. [reference]
+android:inputMethod : If set, specifies that this TextView should use the specified input method (specified by fully-qualified class name). * Deprecated: Use inputType instead. [string]
+android:inputType : The type of data being placed in a text field, used to help an input method decide how to let the user enter text. [flag]
+android:interpolator : [reference]
+android:isIndicator : Whether this rating bar is an indicator (and non-changeable by the user). [boolean]
+android:isScrollContainer : Set this if the view will serve as a scrolling container, meaing that it can be resized to shrink its overall window so that there will be space for an input method. [boolean]
+android:keepScreenOn : Controls whether the view's window should keep the screen on while visible. [boolean]
+android:layerType : Specifies the type of layer backing this view. [enum]
+layout : [reference]. * Required.
+android:layoutAnimation : Defines the layout animation to use the first time the ViewGroup is laid out. [reference]
+android:layoutDirection : Defines the direction of layout drawing. [enum]
+android:lineSpacingExtra : Extra spacing between lines of text. [dimension]
+android:lineSpacingMultiplier : Extra spacing between lines of text, as a multiplier. [float]
+android:lines : Makes the TextView be exactly this many lines tall. [integer]
+android:linksClickable : If set to false, keeps the movement method from being set to the link movement method even if autoLink causes links to be found. [boolean]
+android:listSelector : Drawable used to indicate the currently selected item in the list. [color, reference]
+android:longClickable : Defines whether this view reacts to long click events. [boolean]
+android:loopViews : Defines whether the animator loops to the first view once it has reached the end of the list. [boolean]
+android:marqueeRepeatLimit : The number of times to repeat the marquee animation. [integer, enum]
+android:max : Defines the maximum value the progress can take. [integer]
+android:maxDate : The minimal date shown by this calendar view in mm/dd/yyyy format. [string]
+android:maxEms : Makes the TextView be at most this many ems wide. [integer]
+android:maxHeight : An optional argument to supply a maximum height for this view. [dimension]
+android:maxLength : Set an input filter to constrain the text length to the specified number. [integer]
+android:maxLines : Makes the TextView be at most this many lines tall. [integer]
+android:maxWidth : An optional argument to supply a maximum width for this view. [dimension]
+android:measureAllChildren : Determines whether to measure all children or just those in the VISIBLE or INVISIBLE state when measuring. [boolean]
+android:measureWithLargestChild : When set to true, all children with a weight will be considered having the minimum size of the largest child. [boolean]
+android:minDate : The minimal date shown by this calendar view in mm/dd/yyyy format. [string]
+android:minEms : Makes the TextView be at least this many ems wide. [integer]
+android:minHeight : Defines the minimum height of the view.
+android:minLines : Makes the TextView be at least this many lines tall. [integer]
+android:minWidth : Defines the minimum width of the view.
+android:mode : [enum]
+android:name : Supply the name of the fragment class to instantiate.
+android:nextFocusDown : Defines the next view to give focus to when the next focus is FOCUS_DOWN If the reference refers to a view that does not exist or is part of a hierarchy that is invisible, a java.lang.RuntimeException will result when the reference is accessed. [reference]
+android:nextFocusForward : Defines the next view to give focus to when the next focus is FOCUS_FORWARD If the reference refers to a view that does not exist or is part of a hierarchy that is invisible, a java.lang.RuntimeException will result when the reference is accessed. [reference]
+android:nextFocusLeft : Defines the next view to give focus to when the next focus is FOCUS_LEFT. [reference]
+android:nextFocusRight : Defines the next view to give focus to when the next focus is FOCUS_RIGHT If the reference refers to a view that does not exist or is part of a hierarchy that is invisible, a java.lang.RuntimeException will result when the reference is accessed. [reference]
+android:nextFocusUp : Defines the next view to give focus to when the next focus is FOCUS_UP If the reference refers to a view that does not exist or is part of a hierarchy that is invisible, a java.lang.RuntimeException will result when the reference is accessed. [reference]
+android:numColumns : Defines how many columns to show. [integer, enum]
+android:numStars : The number of stars (or rating items) to show. [integer]
+android:numeric : If set, specifies that this TextView has a numeric input method. * Deprecated: Use inputType instead. [flag]
+android:onClick : Name of the method in this View's context to invoke when the view is clicked. [string]
+android:orientation : Should the layout be a column or a row? Use "horizontal" for a row, "vertical" for a column. [enum]
+android:outAnimation : Identifier for the animation to use when a view is hidden. [reference]
+android:overScrollFooter : Drawable to draw below list content. [color, reference]
+android:overScrollHeader : Drawable to draw above list content. [color, reference]
+android:overScrollMode : Defines over-scrolling behavior. [enum]
+android:padding : Sets the padding, in pixels, of all four edges. [dimension]
+android:paddingBottom : Sets the padding, in pixels, of the bottom edge; see padding. [dimension]
+android:paddingEnd : Sets the padding, in pixels, of the end edge; see padding. [dimension]
+android:paddingLeft : Sets the padding, in pixels, of the left edge; see padding. [dimension]
+android:paddingRight : Sets the padding, in pixels, of the right edge; see padding. [dimension]
+android:paddingStart : Sets the padding, in pixels, of the start edge; see padding. [dimension]
+android:paddingTop : Sets the padding, in pixels, of the top edge; see padding. [dimension]
+android:password : Whether the characters of the field are displayed as password dots instead of themselves. * Deprecated: Use inputType instead. [boolean]
+android:persistentDrawingCache : Defines the persistence of the drawing cache. [flag]
+android:phoneNumber : If set, specifies that this TextView has a phone number input method. * Deprecated: Use inputType instead. [boolean]
+android:popupBackground : Background drawable to use for the dropdown in spinnerMode="dropdown". [color, reference]
+android:popupPromptView : Reference to a layout to use for displaying a prompt in the dropdown for spinnerMode="dropdown". [reference]
+android:privateImeOptions : An addition content type description to supply to the input method attached to the text view, which is private to the implementation of the input method. [string]
+android:progress : Defines the default progress value, between 0 and max. [integer]
+android:progressDrawable : Drawable used for the progress mode. [reference]
+android:prompt : The prompt to display when the spinner's dialog is shown. [reference]
+android:queryHint : An optional query hint string to be displayed in the empty query field. [string]
+android:quickContactWindowSize : [enum]
+android:rating : The rating to set by default. [float]
+android:requiresFadingEdge : Defines which edges should be faded on scrolling. [flag]
+android:resOutColor : Color of the res-out outline. [color]
+android:rotation : rotation of the view, in degrees. [float]
+android:rotationX : rotation of the view around the x axis, in degrees. [float]
+android:rotationY : rotation of the view around the y axis, in degrees. [float]
+android:rowCount : The maxmimum number of rows to create when automatically positioning children. [integer]
+android:rowOrderPreserved : When set to true, forces row boundaries to appear in the same order as row indices. [boolean]
+android:saveEnabled : If unset, no state will be saved for this view when it is being frozen. [boolean]
+android:scaleType : Controls how the image should be resized or moved to match the size of this ImageView. [enum]
+android:scaleX : scale of the view in the x direction. [float]
+android:scaleY : scale of the view in the y direction. [float]
+android:scrollHorizontally : Whether the text is allowed to be wider than the view (and therefore can be scrolled horizontally). [boolean]
+android:scrollX : The initial horizontal scroll offset, in pixels. [dimension]
+android:scrollY : The initial vertical scroll offset, in pixels. [dimension]
+android:scrollbarAlwaysDrawHorizontalTrack : Defines whether the horizontal scrollbar track should always be drawn. [boolean]
+android:scrollbarAlwaysDrawVerticalTrack : Defines whether the vertical scrollbar track should always be drawn. [boolean]
+android:scrollbarDefaultDelayBeforeFade : Defines the delay in milliseconds that a scrollbar waits before fade out. [integer]
+android:scrollbarFadeDuration : Defines the delay in milliseconds that a scrollbar takes to fade out. [integer]
+android:scrollbarSize : Sets the width of vertical scrollbars and height of horizontal scrollbars. [dimension]
+android:scrollbarStyle : Controls the scrollbar style and position. [enum]
+android:scrollbarThumbHorizontal : Defines the horizontal scrollbar thumb drawable. [reference]
+android:scrollbarThumbVertical : Defines the vertical scrollbar thumb drawable. [reference]
+android:scrollbarTrackHorizontal : Defines the horizontal scrollbar track drawable. [reference]
+android:scrollbarTrackVertical : Defines the vertical scrollbar track drawable. [reference]
+android:scrollbars : Defines which scrollbars should be displayed on scrolling or not. [flag]
+android:scrollingCache : When set to true, the list uses a drawing cache during scrolling. [boolean]
+android:secondaryProgress : Defines the secondary progress value, between 0 and max. [integer]
+android:selectAllOnFocus : If the text is selectable, select it all when the view takes focus. [boolean]
+android:selectedDateVerticalBar : Drawable for the vertical bar shown at the beginning and at the end of the selected date. [reference]
+android:selectedWeekBackgroundColor : The background color for the selected week. [color, reference]
+android:shadowColor : Place a shadow of the specified color behind the text. [color]
+android:shadowDx : Horizontal offset of the shadow. [float]
+android:shadowDy : Vertical offset of the shadow. [float]
+android:shadowRadius : Radius of the shadow. [float]
+android:showDividers : Setting for which dividers to show. [flag]
+android:showWeekNumber : Whether do show week numbers. [boolean]
+android:shownWeekCount : The number of weeks to be shown. [integer]
+android:shrinkColumns : The zero-based index of the columns to shrink. [string]
+android:singleLine : Constrains the text to a single horizontally scrolling line instead of letting it wrap onto multiple lines, and advances focus instead of inserting a newline when you press the enter key. * Deprecated: This attribute is deprecated. Use "maxLines" instead to change the layo...
+android:smoothScrollbar : When set to true, the list will use a more refined calculation method based on the pixels height of the items visible on screen. [boolean]
+android:soundEffectsEnabled : Boolean that controls whether a view should have sound effects enabled for events such as clicking and touching. [boolean]
+android:spacing : [dimension]
+android:spinnerMode : Display mode for spinner options. [enum]
+android:spinnersShown : Whether the spinners are shown. [boolean]
+android:splitMotionEvents : Sets whether this ViewGroup should split MotionEvents to separate child views during touch event dispatch. [boolean]
+android:src : Sets a drawable as the content of this ImageView. [color, reference]
+android:stackFromBottom : Used by ListView and GridView to stack their content from the bottom. [boolean]
+android:startYear : The first year (inclusive), for example "1940". * Deprecated: Use minDate instead. [integer]
+android:stepSize : The step size of the rating. [float]
+android:stretchColumns : The zero-based index of the columns to stretch. [string]
+android:stretchMode : Defines how columns should stretch to fill the available empty space, if any. [enum]
+style : A reference to a custom style [reference]
+android:switchMinWidth : Minimum width for the switch component [dimension]
+android:switchPadding : Minimum space between the switch and caption text [dimension]
+android:switchTextAppearance : TextAppearance style for text displayed on the switch thumb. [reference]
+android:tabLayout : Layout used to organize each tab's content. [reference]
+android:tabStripEnabled : Determines whether the strip under the tab indicators is drawn or not. [boolean]
+android:tabStripLeft : Drawable used to draw the left part of the strip underneath the tabs. [reference]
+android:tabStripRight : Drawable used to draw the right part of the strip underneath the tabs. [reference]
+android:tag : Supply a tag for the top-level view containing a String, to be retrieved later with View.getTag() or searched for with View.findViewWithTag() . [string]
+android:text : Text to display. [string]
+android:textAlignment : Alignment of the text. [integer, enum]
+android:textAllCaps : Present the text in ALL CAPS. [boolean]
+android:textAppearance : Base text color, typeface, size, and style. [reference]
+android:textColor : Text color. [color, reference]
+android:textColorHighlight : Color of the text selection highlight. [color, reference]
+android:textColorHint : Color of the hint text. [color, reference]
+android:textColorLink : Text color for links. [color, reference]
+android:textCursorDrawable : Reference to a drawable that will be drawn under the insertion cursor. [reference]
+android:textDirection : Direction of the text. [integer, enum]
+android:textEditNoPasteWindowLayout : Variation of textEditPasteWindowLayout displayed when the clipboard is empty. [reference]
+android:textEditPasteWindowLayout : The layout of the view that is displayed on top of the cursor to paste inside a TextEdit field. [reference]
+android:textEditSideNoPasteWindowLayout : Variation of textEditSidePasteWindowLayout displayed when the clipboard is empty. [reference]
+android:textEditSidePasteWindowLayout : Used instead of textEditPasteWindowLayout when the window is moved on the side of the insertion cursor because it would be clipped if it were positioned on top. [reference]
+android:textEditSuggestionItemLayout : Layout of the TextView item that will populate the suggestion popup window. [reference]
+android:textFilterEnabled : When set to true, the list will filter results as the user types. [boolean]
+android:textIsSelectable : Indicates that the content of a non-editable text can be selected. [boolean]
+android:textOff : The text for the button when it is not checked. [string]
+android:textOn : The text for the button when it is checked. [string]
+android:textScaleX : Sets the horizontal scaling factor for the text. [float]
+android:textSelectHandle : Reference to a drawable that will be used to display a text selection anchor for positioning the cursor within text. [reference]
+android:textSelectHandleLeft : Reference to a drawable that will be used to display a text selection anchor on the left side of a selection region. [reference]
+android:textSelectHandleRight : Reference to a drawable that will be used to display a text selection anchor on the right side of a selection region. [reference]
+android:textSize : Size of the text. [dimension]
+android:textStyle : Style (bold, italic, bolditalic) for the text. [flag]
+android:thumb : Drawable to use as the "thumb" that switches back and forth. [reference]
+android:thumbOffset : An offset for the thumb that allows it to extend out of the range of the track. [dimension]
+android:thumbTextPadding : Amount of padding on either side of text within the switch thumb. [dimension]
+android:tint : Set a tinting color for the image. [color]
+android:topOffset : Extra offset for the handle at the top of the SlidingDrawer. [dimension]
+android:track : Drawable to use as the "track" that the switch thumb slides within. [reference]
+android:transcriptMode : Sets the transcript mode for the list. [enum]
+android:transformPivotX : x location of the pivot point around which the view will rotate and scale. [dimension]
+android:transformPivotY : y location of the pivot point around which the view will rotate and scale. [dimension]
+android:translationX : translation in x of the view. [dimension]
+android:translationY : translation in y of the view. [dimension]
+android:typeface : Typeface (normal, sans, serif, monospace) for the text. [enum]
+android:uncertainGestureColor : Color used to draw the user's strokes until we are sure it's a gesture. [color]
+android:unfocusedMonthDateColor : The color for the dates of an unfocused month. [color, reference]
+android:unselectedAlpha : Sets the alpha on the items that are not selected. [float]
+android:useDefaultMargins : When set to true, tells GridLayout to use default margins when none are specified in a view's layout parameters. [boolean]
+android:verticalScrollbarPosition : Determines which side the vertical scroll bar should be placed on. [enum]
+android:verticalSpacing : Defines the default vertical spacing between rows. [dimension]
+android:visibility : Controls the initial visibility of the view. [enum]
+android:weekDayTextAppearance : The text appearance for the week day abbreviation of the calendar header. [reference]
+android:weekNumberColor : The color for the week numbers. [color, reference]
+android:weekSeparatorLineColor : The color for the separator line between weeks. [color, reference]
+android:weightSum : Defines the maximum weight sum. [float]
+android:width : Makes the TextView be exactly this many pixels wide. [dimension]
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion33.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion33.txt
new file mode 100644
index 000000000..f9c008d25
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion33.txt
@@ -0,0 +1,3 @@
+Code completion in completionvalues1.xml for <item name="android:allowSingleTap">^</item>:
+true
+false
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion34.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion34.txt
new file mode 100644
index 000000000..861a41334
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion34.txt
@@ -0,0 +1,3 @@
+Code completion in completionvalues1.xml for <item name="android:alwaysDrawnWithCache">^ false </item>:
+true
+false
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion35.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion35.txt
new file mode 100644
index 000000000..25e8a0b1d
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion35.txt
@@ -0,0 +1,3 @@
+Code completion in completionvalues1.xml for <item name="android:alwaysDrawnWithCache"> ^false </item>:
+true
+false
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion36.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion36.txt
new file mode 100644
index 000000000..d85133f57
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion36.txt
@@ -0,0 +1,2 @@
+Code completion in completionvalues1.xml for <item name="android:alwaysDrawnWithCache"> f^alse </item>:
+false
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion37.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion37.txt
new file mode 100644
index 000000000..1d4135106
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion37.txt
@@ -0,0 +1,2 @@
+Code completion in completionvalues1.xml for <item name="android:orientation">h^</item>:
+horizontal
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion38.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion38.txt
new file mode 100644
index 000000000..8819bcd39
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion38.txt
@@ -0,0 +1,6 @@
+Code completion in completionvalues1.xml for c^:
+center_vertical
+center_horizontal
+center
+clip_vertical
+clip_horizontal
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion66.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion66.txt
new file mode 100644
index 000000000..4f29a8b71
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion66.txt
@@ -0,0 +1,7 @@
+Code completion in completionvalues1.xml for 17[^sp]:
+17dp : <b>Density-independent Pixels</b> - an abstract unit that is based on the physical density of the screen.
+17sp : <b>Scale-independent Pixels</b> - this is like the dp unit, but it is also scaled by the user's font size preference.
+17pt : <b>Points</b> - 1/72 of an inch based on the physical size of the screen.
+17mm : <b>Millimeters</b> - based on the physical size of the screen.
+17in : <b>Inches</b> - based on the physical size of the screen.
+17px : <b>Pixels</b> - corresponds to actual pixels on the screen. Not recommended.
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion67.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion67.txt
new file mode 100644
index 000000000..4f29a8b71
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion67.txt
@@ -0,0 +1,7 @@
+Code completion in completionvalues1.xml for 17[^sp]:
+17dp : <b>Density-independent Pixels</b> - an abstract unit that is based on the physical density of the screen.
+17sp : <b>Scale-independent Pixels</b> - this is like the dp unit, but it is also scaled by the user's font size preference.
+17pt : <b>Points</b> - 1/72 of an inch based on the physical size of the screen.
+17mm : <b>Millimeters</b> - based on the physical size of the screen.
+17in : <b>Inches</b> - based on the physical size of the screen.
+17px : <b>Pixels</b> - corresponds to actual pixels on the screen. Not recommended.
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion68.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion68.txt
new file mode 100644
index 000000000..5aa1d43c1
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion68.txt
@@ -0,0 +1,3 @@
+Code completion in completionvalues1.xml for [^false]:
+true
+false
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1.xml
new file mode 100644
index 000000000..89b5f4609
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources xmlns:android="http://schemas.android.com/apk/res/android">
+ <style name="stylename">
+ <item name="android:textSize">17sp</item>
+ <item name="android:textColor">@color/title_color</item>
+ <item name="android:shadowColor">@an</item>
+ <item name="android:gravity"> </item>
+ <item name="gr">@color/title_color</item>
+ <item name="an">@color/title_color</item>
+ <item ></item>
+ <item name=""></item>
+ <item name="android:allowSingleTap"></item>
+ <item name="android:alwaysDrawnWithCache"> false </item>
+ <item name="android:orientation">h</item>
+ <item name="android:gravity">
+ c
+ </item>
+ </style>
+</resources>
+
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues2-expected-applyCompletion45.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues2-expected-applyCompletion45.diff
new file mode 100644
index 000000000..649866860
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues2-expected-applyCompletion45.diff
@@ -0,0 +1,4 @@
+Code completion in completionvalues2.xml for @string/^app_name selecting @string/hello:
+< <item name="main_layout5" type="string">@string/^app_name</item>
+---
+> <item name="main_layout5" type="string">@string/hello^</item>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues2-expected-completion70.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues2-expected-completion70.txt
new file mode 100644
index 000000000..20f8a7442
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues2-expected-completion70.txt
@@ -0,0 +1,3 @@
+Code completion in completionvalues2.xml for <item name="main_layout4" type="layout">^</item>:
+@android:
+@layout/
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues2-expected-completion71.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues2-expected-completion71.txt
new file mode 100644
index 000000000..c491feabe
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues2-expected-completion71.txt
@@ -0,0 +1,2 @@
+Code completion in completionvalues2.xml for <item name="main_layout5" type="string">@string/^app_name</item>:
+@string/app_name
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues2.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues2.xml
new file mode 100644
index 000000000..293abc01a
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues2.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <item name="main_layout" type="layout">@layout/main2</item>
+ <item name="main_layout2" type="layout"> @layout/main_layout </item>
+ <item name="main_layout3" type="layout"> </item>
+ <item name="main_layout4" type="layout"></item>
+ <item name="main_layout5" type="string">@string/app_name</item>
+</resources>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/drawable1-expected-completion47.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/drawable1-expected-completion47.txt
new file mode 100644
index 000000000..c7f495b1b
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/drawable1-expected-completion47.txt
@@ -0,0 +1,12 @@
+Code completion in drawable1.xml for ^<layer-list:
+<animation-list /> : Drawable used to render several animated frames.
+<bitmap /> : Drawable used to draw bitmaps.
+<clip />
+<color /> : Drawable used to draw a single color.
+<inset />
+<layer-list ></layer-list> : Drawable used to render several drawables stacked on top of each other.
+<nine-patch /> : Drawable used to draw 9-patches.
+<rotate /> : Drawable used to rotate another drawable.
+<scale />
+<selector ></selector> : Drawable used to render several states.
+<shape ></shape> : Drawable used to render a geometric shape, with a gradient or a solid color.
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/drawable1-expected-completion48.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/drawable1-expected-completion48.txt
new file mode 100644
index 000000000..024cdebe4
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/drawable1-expected-completion48.txt
@@ -0,0 +1,3 @@
+Code completion in drawable1.xml for ^xmlns:android:
+android:opacity : Indicates the opacity of the layer. [enum]
+xmlns:android
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/drawable1-expected-completion49.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/drawable1-expected-completion49.txt
new file mode 100644
index 000000000..269fd86f0
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/drawable1-expected-completion49.txt
@@ -0,0 +1,7 @@
+Code completion in drawable1.xml for <item ^></item>:
+android:left : Left coordinate of the layer. [dimension]
+android:top : Top coordinate of the layer. [dimension]
+android:right : Right coordinate of the layer. [dimension]
+android:bottom : Bottom coordinate of the layer. [dimension]
+android:drawable : Drawable used to render the layer. [reference]
+android:id : Identifier of the layer. [reference]
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/drawable1-expected-completion50.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/drawable1-expected-completion50.txt
new file mode 100644
index 000000000..d05bc768c
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/drawable1-expected-completion50.txt
@@ -0,0 +1,12 @@
+Code completion in drawable1.xml for <item >^</item>:
+<animation-list /> : Drawable used to render several animated frames.
+<bitmap /> : Drawable used to draw bitmaps.
+<clip />
+<color /> : Drawable used to draw a single color.
+<inset />
+<layer-list ></layer-list> : Drawable used to render several drawables stacked on top of each other.
+<nine-patch /> : Drawable used to draw 9-patches.
+<rotate /> : Drawable used to rotate another drawable.
+<scale />
+<selector ></selector> : Drawable used to render several states.
+<shape ></shape> : Drawable used to render a geometric shape, with a gradient or a solid color.
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/drawable1.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/drawable1.xml
new file mode 100644
index 000000000..9513f1709
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/drawable1.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<layer-list
+ xmlns:android="http://schemas.android.com/apk/res/android">
+ <item ></item>
+</layer-list>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/drawable2-expected-completion51.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/drawable2-expected-completion51.txt
new file mode 100644
index 000000000..438bd768c
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/drawable2-expected-completion51.txt
@@ -0,0 +1,10 @@
+Code completion in drawable2.xml for ^android:innerRadiusRatio="2":
+android:visible : Indicates whether the drawable should intially be visible. [boolean]
+android:dither : Enables or disables dithering. [boolean]
+android:shape : Indicates what shape to fill with a gradient. [enum]
+android:innerRadiusRatio : Inner radius of the ring expressed as a ratio of the ring's width. [float]
+android:thicknessRatio : Thickness of the ring expressed as a ratio of the ring's width. [float]
+android:innerRadius : Inner radius of the ring. [dimension]
+android:thickness : Thickness of the ring. [dimension]
+android:useLevel : Indicates whether the drawable's level affects the way the gradient is drawn.
+xmlns:android
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/drawable2-expected-completion52.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/drawable2-expected-completion52.txt
new file mode 100644
index 000000000..2a2853363
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/drawable2-expected-completion52.txt
@@ -0,0 +1,7 @@
+Code completion in drawable2.xml for ^<gradient:
+<corners /> : Describes the corners for the rectangle shape of a GradientDrawable.
+<gradient /> : Used to describe the gradient used to fill the shape of a GradientDrawable.
+<padding /> : Used to specify the optional padding of a GradientDrawable.
+<size /> : Used to specify the size of the shape for GradientDrawable.
+<solid /> : Used to fill the shape of GradientDrawable with a solid color.
+<stroke /> : Used to describe the optional stroke of a GradientDrawable.
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/drawable2.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/drawable2.xml
new file mode 100644
index 000000000..c6a672fd8
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/drawable2.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+ android:innerRadiusRatio="2">
+ <gradient />
+</shape>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/edithandling.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/edithandling.xml
new file mode 100644
index 000000000..0488fd6f1
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/edithandling.xml
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android">
+</LinearLayout>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract1b.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract1b.diff
new file mode 100644
index 000000000..e21c594d1
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract1b.diff
@@ -0,0 +1,34 @@
+@@ -2 +2
+- android:layout_width="wrap_content" android:layout_height="match_parent">
+- <Button android:text="Button"
+- android:layout_width="wrap_content" android:layout_height="wrap_content"
+- android:textColor="#FF0000" android:textSize="20pt"
+- android:id="@+id/button1" android:layout_alignParentBottom="true"></Button>
+- <Button android:text="Button"
+- android:layout_width="wrap_content" android:layout_height="fill_parent"
+- android:textColor="#FF00FF" android:textSize="20pt"
+- android:id="@+id/button2" android:layout_alignParentBottom="true"></Button>
++ android:layout_width="wrap_content"
++ android:layout_height="match_parent" >
++
++ <Button
++ android:id="@+id/button1"
++ android:layout_width="wrap_content"
++ android:layout_height="wrap_content"
++ android:layout_alignParentBottom="true"
++ android:text="Button"
++ android:textColor="#FF0000"
++ android:textSize="20pt" >
++ </Button>
++
++ <Button
++ android:id="@+id/button2"
++ style="@style/newstyle"
++ android:layout_width="wrap_content"
++ android:layout_height="fill_parent"
++ android:layout_alignParentBottom="true"
++ android:text="Button"
++ android:textColor="#FF00FF"
++ android:textSize="20pt" >
++ </Button>
++
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract1c.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract1c.diff
new file mode 100644
index 000000000..8c12b7cde
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract1c.diff
@@ -0,0 +1,31 @@
+@@ -2 +2
+- android:layout_width="wrap_content" android:layout_height="match_parent">
+- <Button android:text="Button"
+- android:layout_width="wrap_content" android:layout_height="wrap_content"
+- android:textColor="#FF0000" android:textSize="20pt"
+- android:id="@+id/button1" android:layout_alignParentBottom="true"></Button>
+- <Button android:text="Button"
+- android:layout_width="wrap_content" android:layout_height="fill_parent"
+- android:textColor="#FF00FF" android:textSize="20pt"
+- android:id="@+id/button2" android:layout_alignParentBottom="true"></Button>
++ android:layout_width="wrap_content"
++ android:layout_height="match_parent" >
++
++ <Button
++ android:id="@+id/button1"
++ android:layout_width="wrap_content"
++ android:layout_height="wrap_content"
++ android:layout_alignParentBottom="true"
++ android:text="Button"
++ android:textColor="#FF0000"
++ android:textSize="20pt" >
++ </Button>
++
++ <Button
++ android:id="@+id/button2"
++ android:layout_width="wrap_content"
++ android:layout_height="fill_parent"
++ android:layout_alignParentBottom="true"
++ android:text="Button" >
++ </Button>
++
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract1d.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract1d.diff
new file mode 100644
index 000000000..c819b09aa
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract1d.diff
@@ -0,0 +1,32 @@
+@@ -2 +2
+- android:layout_width="wrap_content" android:layout_height="match_parent">
+- <Button android:text="Button"
+- android:layout_width="wrap_content" android:layout_height="wrap_content"
+- android:textColor="#FF0000" android:textSize="20pt"
+- android:id="@+id/button1" android:layout_alignParentBottom="true"></Button>
+- <Button android:text="Button"
+- android:layout_width="wrap_content" android:layout_height="fill_parent"
+- android:textColor="#FF00FF" android:textSize="20pt"
+- android:id="@+id/button2" android:layout_alignParentBottom="true"></Button>
++ android:layout_width="wrap_content"
++ android:layout_height="match_parent" >
++
++ <Button
++ android:id="@+id/button1"
++ android:layout_width="wrap_content"
++ android:layout_height="wrap_content"
++ android:layout_alignParentBottom="true"
++ android:text="Button"
++ android:textColor="#FF0000"
++ android:textSize="20pt" >
++ </Button>
++
++ <Button
++ android:id="@+id/button2"
++ style="@style/newstyle"
++ android:layout_width="wrap_content"
++ android:layout_height="fill_parent"
++ android:layout_alignParentBottom="true"
++ android:text="Button" >
++ </Button>
++
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract2.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract2.diff
new file mode 100644
index 000000000..c819b09aa
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract2.diff
@@ -0,0 +1,32 @@
+@@ -2 +2
+- android:layout_width="wrap_content" android:layout_height="match_parent">
+- <Button android:text="Button"
+- android:layout_width="wrap_content" android:layout_height="wrap_content"
+- android:textColor="#FF0000" android:textSize="20pt"
+- android:id="@+id/button1" android:layout_alignParentBottom="true"></Button>
+- <Button android:text="Button"
+- android:layout_width="wrap_content" android:layout_height="fill_parent"
+- android:textColor="#FF00FF" android:textSize="20pt"
+- android:id="@+id/button2" android:layout_alignParentBottom="true"></Button>
++ android:layout_width="wrap_content"
++ android:layout_height="match_parent" >
++
++ <Button
++ android:id="@+id/button1"
++ android:layout_width="wrap_content"
++ android:layout_height="wrap_content"
++ android:layout_alignParentBottom="true"
++ android:text="Button"
++ android:textColor="#FF0000"
++ android:textSize="20pt" >
++ </Button>
++
++ <Button
++ android:id="@+id/button2"
++ style="@style/newstyle"
++ android:layout_width="wrap_content"
++ android:layout_height="fill_parent"
++ android:layout_alignParentBottom="true"
++ android:text="Button" >
++ </Button>
++
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract3.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract3.diff
new file mode 100644
index 000000000..36186b83f
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract3.diff
@@ -0,0 +1,32 @@
+@@ -2 +2
+- android:layout_width="wrap_content" android:layout_height="match_parent">
+- <Button android:text="Button"
+- android:layout_width="wrap_content" android:layout_height="wrap_content"
+- android:textColor="#FF0000" android:textSize="20pt"
+- android:id="@+id/button1" android:layout_alignParentBottom="true"></Button>
+- <Button android:text="Button"
+- android:layout_width="wrap_content" android:layout_height="fill_parent"
+- android:textColor="#FF00FF" android:textSize="20pt"
+- android:id="@+id/button2" android:layout_alignParentBottom="true"></Button>
++ android:layout_width="wrap_content"
++ android:layout_height="match_parent" >
++
++ <Button
++ android:id="@+id/button1"
++ style="@style/newstyle"
++ android:layout_width="wrap_content"
++ android:layout_height="wrap_content"
++ android:layout_alignParentBottom="true"
++ android:text="Button" >
++ </Button>
++
++ <Button
++ android:id="@+id/button2"
++ style="@style/newstyle"
++ android:layout_width="wrap_content"
++ android:layout_height="fill_parent"
++ android:layout_alignParentBottom="true"
++ android:text="Button"
++ android:textColor="#FF00FF" >
++ </Button>
++
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract4.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract4.diff
new file mode 100644
index 000000000..83837f57b
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract4.diff
@@ -0,0 +1,33 @@
+@@ -2 +2
+- android:layout_width="wrap_content" android:layout_height="match_parent">
+- <Button android:text="Button"
+- android:layout_width="wrap_content" android:layout_height="wrap_content"
+- android:textColor="#FF0000" android:textSize="20pt"
+- android:id="@+id/button1" android:layout_alignParentBottom="true"></Button>
+- <Button android:text="Button"
+- android:layout_width="wrap_content" android:layout_height="fill_parent"
+- android:textColor="#FF00FF" android:textSize="20pt"
+- android:id="@+id/button2" android:layout_alignParentBottom="true"></Button>
++ android:layout_width="wrap_content"
++ android:layout_height="match_parent" >
++
++ <Button
++ android:id="@+id/button1"
++ android:layout_width="wrap_content"
++ android:layout_height="wrap_content"
++ android:layout_alignParentBottom="true"
++ android:text="Button"
++ android:textColor="#FF0000"
++ android:textSize="20pt" >
++ </Button>
++
++ <Button
++ android:id="@+id/button2"
++ style="@style/newstyle"
++ android:layout_width="wrap_content"
++ android:layout_height="fill_parent"
++ android:layout_alignParentBottom="true"
++ android:text="Button"
++ android:textSize="20pt" >
++ </Button>
++
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract5.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract5.diff
new file mode 100644
index 000000000..55d658ddd
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract5.diff
@@ -0,0 +1,33 @@
+@@ -2 +2
+- android:layout_width="wrap_content" android:layout_height="match_parent">
+- <Button android:text="Button"
+- android:layout_width="wrap_content" android:layout_height="wrap_content"
+- android:textColor="#FF0000" android:textSize="20pt"
+- android:id="@+id/button1" android:layout_alignParentBottom="true"></Button>
+- <Button android:text="Button"
+- android:layout_width="wrap_content" android:layout_height="fill_parent"
+- android:textColor="#FF00FF" android:textSize="20pt"
+- android:id="@+id/button2" android:layout_alignParentBottom="true"></Button>
++ android:layout_width="wrap_content"
++ android:layout_height="match_parent" >
++
++ <Button
++ android:id="@+id/button1"
++ style="@style/newstyle"
++ android:layout_width="wrap_content"
++ android:layout_height="wrap_content"
++ android:layout_alignParentBottom="true"
++ android:text="Button"
++ android:textColor="#FF0000" >
++ </Button>
++
++ <Button
++ android:id="@+id/button2"
++ android:layout_width="wrap_content"
++ android:layout_height="fill_parent"
++ android:layout_alignParentBottom="true"
++ android:text="Button"
++ android:textColor="#FF00FF"
++ android:textSize="20pt" >
++ </Button>
++
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract6.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract6.diff
new file mode 100644
index 000000000..1db5e3811
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract6.diff
@@ -0,0 +1,6 @@
+< <Button android:text="Button"
+< android:layout_width="wrap_content" android:layout_height="wrap_content"
+< android:textColor="#FF0000" android:textSize="20pt"
+< android:id="@+id/button1" android:layout_alignParentBottom="true"></Button>
+---
+> <Button style="@style/newstyle" android:id="@+id/button1" ></Button>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract8.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract8.diff
new file mode 100644
index 000000000..8c12b7cde
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract8.diff
@@ -0,0 +1,31 @@
+@@ -2 +2
+- android:layout_width="wrap_content" android:layout_height="match_parent">
+- <Button android:text="Button"
+- android:layout_width="wrap_content" android:layout_height="wrap_content"
+- android:textColor="#FF0000" android:textSize="20pt"
+- android:id="@+id/button1" android:layout_alignParentBottom="true"></Button>
+- <Button android:text="Button"
+- android:layout_width="wrap_content" android:layout_height="fill_parent"
+- android:textColor="#FF00FF" android:textSize="20pt"
+- android:id="@+id/button2" android:layout_alignParentBottom="true"></Button>
++ android:layout_width="wrap_content"
++ android:layout_height="match_parent" >
++
++ <Button
++ android:id="@+id/button1"
++ android:layout_width="wrap_content"
++ android:layout_height="wrap_content"
++ android:layout_alignParentBottom="true"
++ android:text="Button"
++ android:textColor="#FF0000"
++ android:textSize="20pt" >
++ </Button>
++
++ <Button
++ android:id="@+id/button2"
++ android:layout_width="wrap_content"
++ android:layout_height="fill_parent"
++ android:layout_alignParentBottom="true"
++ android:text="Button" >
++ </Button>
++
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1.info b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1.info
new file mode 100644
index 000000000..69f773989
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1.info
@@ -0,0 +1,3 @@
+android.widget.LinearLayout [0,36,140,320] <LinearLayout>
+ android.widget.Button [0,0,140,62] <Button>
+ android.widget.Button [0,62,140,284] <Button>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1.xml
new file mode 100644
index 000000000..64c49b2c1
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1.xml
@@ -0,0 +1,11 @@
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="wrap_content" android:layout_height="match_parent">
+ <Button android:text="Button"
+ android:layout_width="wrap_content" android:layout_height="wrap_content"
+ android:textColor="#FF0000" android:textSize="20pt"
+ android:id="@+id/button1" android:layout_alignParentBottom="true"></Button>
+ <Button android:text="Button"
+ android:layout_width="wrap_content" android:layout_height="fill_parent"
+ android:textColor="#FF00FF" android:textSize="20pt"
+ android:id="@+id/button2" android:layout_alignParentBottom="true"></Button>
+</FrameLayout>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle2-expected-extract7.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle2-expected-extract7.diff
new file mode 100644
index 000000000..bb2960e48
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle2-expected-extract7.diff
@@ -0,0 +1,33 @@
+@@ -2 +2
+- foo:layout_width="wrap_content" foo:layout_height="match_parent" foo:orientation="vertical">
+- <Button foo:text="Button"
+- foo:layout_width="wrap_content" foo:layout_height="wrap_content"
+- foo:textColor="#FF0000" foo:textSize="20pt"
+- foo:id="@+id/button1" foo:layout_alignParentBottom="true"></Button>
+- <Button foo:text="Button"
+- foo:layout_width="wrap_content" foo:layout_height="fill_parent"
+- foo:textColor="#00FF00" foo:textSize="20pt"
+- foo:id="@+id/button2" foo:layout_alignParentBottom="true"></Button>
++ foo:layout_width="wrap_content"
++ foo:layout_height="match_parent"
++ foo:orientation="vertical" >
++
++ <Button
++ foo:id="@+id/button1"
++ style="@style/newstyle"
++ foo:layout_width="wrap_content"
++ foo:layout_height="wrap_content"
++ foo:layout_alignParentBottom="true"
++ foo:text="Button"
++ foo:textColor="#FF0000" >
++ </Button>
++
++ <Button
++ foo:id="@+id/button2"
++ style="@style/newstyle"
++ foo:layout_width="wrap_content"
++ foo:layout_height="fill_parent"
++ foo:layout_alignParentBottom="true"
++ foo:text="Button" >
++ </Button>
++
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle2.info b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle2.info
new file mode 100644
index 000000000..69f773989
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle2.info
@@ -0,0 +1,3 @@
+android.widget.LinearLayout [0,36,140,320] <LinearLayout>
+ android.widget.Button [0,0,140,62] <Button>
+ android.widget.Button [0,62,140,284] <Button>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle2.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle2.xml
new file mode 100644
index 000000000..3cb966f30
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle2.xml
@@ -0,0 +1,11 @@
+<LinearLayout xmlns:foo="http://schemas.android.com/apk/res/android"
+ foo:layout_width="wrap_content" foo:layout_height="match_parent" foo:orientation="vertical">
+ <Button foo:text="Button"
+ foo:layout_width="wrap_content" foo:layout_height="wrap_content"
+ foo:textColor="#FF0000" foo:textSize="20pt"
+ foo:id="@+id/button1" foo:layout_alignParentBottom="true"></Button>
+ <Button foo:text="Button"
+ foo:layout_width="wrap_content" foo:layout_height="fill_parent"
+ foo:textColor="#00FF00" foo:textSize="20pt"
+ foo:id="@+id/button2" foo:layout_alignParentBottom="true"></Button>
+</LinearLayout>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/fragmentlayout-expected-applyCompletion47.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/fragmentlayout-expected-applyCompletion47.diff
new file mode 100644
index 000000000..3ed60f13d
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/fragmentlayout-expected-applyCompletion47.diff
@@ -0,0 +1,4 @@
+Code completion in fragmentlayout.xml for class="^com selecting android.app.ListFragment:
+@@ -16 +16
+- <fragment class="^com.android.eclipse.tests.TestFragment"
++ <fragment class="android.app.ListFragment^"
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/fragmentlayout-expected-complation77.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/fragmentlayout-expected-complation77.txt
new file mode 100644
index 000000000..6e8687f4f
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/fragmentlayout-expected-complation77.txt
@@ -0,0 +1,5 @@
+Code completion in fragmentlayout.xml for android:name="^com:
+android.app.DialogFragment : <p>Implementations should override this class and implement <code><a href="/reference/android/app/Fragment.html#onCreateView(android.view.LayoutInflater, android.view.ViewGroup, android.os.Bundle)">onCreateView(LayoutInflater, ViewGroup, Bundle)</a></code> to supply ...
+android.app.ListFragment : <p> ListFragment hosts a <code><a href="/reference/android/widget/ListView.html">ListView</a></code> object that can be bound to different data sources, typically either an array or a Cursor holding query results. Binding, screen layout, and row layout are discussed ...
+android.preference.PreferenceFragment : <p> Furthermore, the preferences shown will follow the visual style of system preferences. It is easy to create a hierarchy of preferences (that can be shown on multiple screens) via XML. For these reasons, it is recommended to use this fragment (as a s...
+android.webkit.WebViewFragment : <p> The WebView is automically paused or resumed when the Fragment is paused or resumed. </p> </div><!-- jd-descr --> <div class="jd-descr"> <h2>Summary</h2> <!-- =========== ENUM CONSTANT SUMMARY =========== --> <table id="...
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/fragmentlayout-expected-complation78.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/fragmentlayout-expected-complation78.txt
new file mode 100644
index 000000000..e02637c86
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/fragmentlayout-expected-complation78.txt
@@ -0,0 +1,5 @@
+Code completion in fragmentlayout.xml for class="^com:
+android.app.DialogFragment : <p>Implementations should override this class and implement <code><a href="/reference/android/app/Fragment.html#onCreateView(android.view.LayoutInflater, android.view.ViewGroup, android.os.Bundle)">onCreateView(LayoutInflater, ViewGroup, Bundle)</a></code> to supply ...
+android.app.ListFragment : <p> ListFragment hosts a <code><a href="/reference/android/widget/ListView.html">ListView</a></code> object that can be bound to different data sources, typically either an array or a Cursor holding query results. Binding, screen layout, and row layout are discussed ...
+android.preference.PreferenceFragment : <p> Furthermore, the preferences shown will follow the visual style of system preferences. It is easy to create a hierarchy of preferences (that can be shown on multiple screens) via XML. For these reasons, it is recommended to use this fragment (as a s...
+android.webkit.WebViewFragment : <p> The WebView is automically paused or resumed when the Fragment is paused or resumed. </p> </div><!-- jd-descr --> <div class="jd-descr"> <h2>Summary</h2> <!-- =========== ENUM CONSTANT SUMMARY =========== --> <table id="...
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/fragmentlayout-expected-navigate13.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/fragmentlayout-expected-navigate13.txt
new file mode 100644
index 000000000..ae30d58a3
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/fragmentlayout-expected-navigate13.txt
@@ -0,0 +1,12 @@
+Go To Declaration in fragmentlayout.xml for android:name="com.android.ecl^ipse.tests.TestFragment":
+Open XML Declaration : [com.android.eclipse.tests.TestFragment]
+
+
+After open, the selected text is:
+[^public class TestFragment extends Fragment {
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+ return null;
+ }
+}]
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/fragmentlayout-expected-navigate14.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/fragmentlayout-expected-navigate14.txt
new file mode 100644
index 000000000..0046483fc
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/fragmentlayout-expected-navigate14.txt
@@ -0,0 +1,12 @@
+Go To Declaration in fragmentlayout.xml for class="com.and^roid.eclipse.tests.TestFragment":
+Open XML Declaration : [com.android.eclipse.tests.TestFragment]
+
+
+After open, the selected text is:
+[^public class TestFragment extends Fragment {
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+ return null;
+ }
+}]
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/fragmentlayout.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/fragmentlayout.xml
new file mode 100644
index 000000000..758599c9c
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/fragmentlayout.xml
@@ -0,0 +1,19 @@
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/home_root"
+ android:orientation="horizontal"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent">
+
+ <LinearLayout android:orientation="vertical"
+ android:layout_width="wrap_content"
+ android:layout_height="fill_parent">
+ <fragment android:name="com.android.eclipse.tests.TestFragment"
+ android:id="@+id/test_fragment"
+ android:layout_marginLeft="20dp"
+ android:layout_weight="1"
+ android:layout_width="fill_parent"
+ android:layout_height="0dp" />
+ <fragment class="com.android.eclipse.tests.TestFragment"
+ android:id="@+id/test_fragment2" />
+ </LinearLayout>
+</LinearLayout>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-complation80.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-complation80.txt
new file mode 100644
index 000000000..cb1d0ce9d
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-complation80.txt
@@ -0,0 +1,8 @@
+Code completion in manifest.xml for <activity android:name="^.:
+android.accounts.AccountAuthenticatorActivity
+android.app.ActivityGroup
+android.app.AliasActivity
+android.app.ExpandableListActivity
+android.app.ListActivity
+android.app.NativeActivity
+android.app.TabActivity
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-completion14.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-completion14.txt
new file mode 100644
index 000000000..478e4357c
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-completion14.txt
@@ -0,0 +1,10 @@
+Code completion in manifest.xml for android.permission.ACC^ESS_NETWORK_STATE:
+android.permission.ACCESS_CHECKIN_PROPERTIES
+android.permission.ACCESS_COARSE_LOCATION
+android.permission.ACCESS_FINE_LOCATION
+android.permission.ACCESS_LOCATION_EXTRA_COMMANDS
+android.permission.ACCESS_MOCK_LOCATION
+android.permission.ACCESS_NETWORK_STATE
+android.permission.ACCESS_SURFACE_FLINGER
+android.permission.ACCESS_WIFI_STATE
+android.permission.ACCOUNT_MANAGER
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-completion15.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-completion15.txt
new file mode 100644
index 000000000..c6b35386d
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-completion15.txt
@@ -0,0 +1,3 @@
+Code completion in manifest.xml for android.intent.category.L^AUNCHER:
+android.intent.category.LAUNCHER
+android.intent.category.LE_DESK_DOCK
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-completion16.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-completion16.txt
new file mode 100644
index 000000000..f3367c72a
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-completion16.txt
@@ -0,0 +1,15 @@
+Code completion in manifest.xml for <^application android:i:
+application : The "application" tag describes application-level components contained in the package, as well as general application attributes.
+compatible-screens
+instrumentation : Attributes that can be supplied in an AndroidManifest.xml "instrumentation" tag, a child of the root manifest tag.
+original-package : Private tag to declare the original package name that this package is based on.
+package-verifier : Attributes relating to a package verifier.
+permission : The "permission" tag declares a security permission that can be used to control access from other packages to specific components or features in your package (or other packages).
+permission-group : The "permission-group" tag declares a logical grouping of related permissions.
+permission-tree : The "permission-tree" tag declares the base of a tree of permission values: it declares that this package has ownership of the given permission name, as well as all names underneath it (separated by '.').
+protected-broadcast : Private tag to declare system protected broadcast actions.
+supports-screens : The "supports-screens" specifies the screen dimensions an application supports.
+uses-configuration : The "uses-configuration" tag specifies a specific hardware configuration value used by the application.
+uses-feature : The "uses-feature" tag specifies a specific feature used by the application.
+uses-permission : The "uses-permission" tag requests a "permission" that the containing package must be granted in order for it to operate correctly.
+uses-sdk : The "uses-sdk" tag describes the SDK features that the containing package must be running on to operate correctly.
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-completion17.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-completion17.txt
new file mode 100644
index 000000000..8244f0a81
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-completion17.txt
@@ -0,0 +1,8 @@
+Code completion in manifest.xml for ^android:versionCode="1":
+xmlns:android
+package : This attribute gives a unique name for the package, using a Java-style naming convention to avoid name collisions. For example, applications published by Google could have names of the form com.google.app.appname
+android:versionCode : Internal version code. [integer]
+android:versionName : The text shown to the user to indicate the version they have. [string]
+android:sharedUserId : Specify the name of a user ID that will be shared between multiple packages. [string]
+android:sharedUserLabel : Specify a label for the shared user UID of this package. [reference]
+android:installLocation : The default install location defined by an application. [enum]
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-completion18.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-completion18.txt
new file mode 100644
index 000000000..12152445e
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-completion18.txt
@@ -0,0 +1,29 @@
+Code completion in manifest.xml for <activity android:^name=".TestActivity":
+android:name : Required name of the class implementing the activity, deriving from android.app.Activity. [string]. * Required.
+android:theme : The overall theme to use for an activity. [reference]
+android:label : A user-legible name for the given item. [string, reference]
+android:description : Descriptive text for the associated data. [reference]
+android:icon : [reference]
+android:logo : A Drawable resource providing an extended graphical logo for its associated item. [reference]
+android:launchMode : Specify how an activity should be launched. [enum]
+android:screenOrientation : Specify the orientation an activity should be run in. [enum]
+android:configChanges : Specify one or more configuration changes that the activity will handle itself. [flag]
+android:permission : Specify a permission that a client is required to have in order to use the associated object. [string]
+android:multiprocess : Specify whether a component is allowed to have multiple instances of itself running in different processes. [boolean]
+android:process : Specify a specific process that the associated code is to run in. [string]
+android:taskAffinity : Specify a task name that activities have an "affinity" to. [string]
+android:allowTaskReparenting : Specify that an activity can be moved out of a task it is in to the task it has an affinity for when appropriate. [boolean]
+android:finishOnTaskLaunch : Specify whether an activity should be finished when its task is brought to the foreground by relaunching from the home screen. [boolean]
+android:finishOnCloseSystemDialogs : Specify whether an activity should be finished when a "close system windows" request has been made. [boolean]
+android:clearTaskOnLaunch : Specify whether an activity's task should be cleared when it is re-launched from the home screen. [boolean]
+android:noHistory : Specify whether an activity should be kept in its history stack. [boolean]
+android:alwaysRetainTaskState : Specify whether an acitivty's task state should always be maintained by the system, or if it is allowed to reset the task to its initial state in certain situations. [boolean]
+android:stateNotNeeded : Indicates that an Activity does not need to have its freeze state (as returned by onSaveInstanceState retained in order to be restarted. [boolean]
+android:excludeFromRecents : Indicates that an Activity should be excluded from the list of recently launched activities. [boolean]
+android:enabled : Specify whether the activity is enabled or not (that is, can be instantiated by the system). [boolean]
+android:exported : Flag indicating whether the given application component is available to other applications. [boolean]
+android:windowSoftInputMode : Specify the default soft-input mode for the main window of this activity. [flag]
+android:immersive : Flag declaring this activity to be 'immersive'; immersive activities should not be interrupted with other activities or notifications. [boolean]
+android:hardwareAccelerated : <p>Flag indicating whether the application's rendering should be hardware accelerated if possible. [boolean]
+android:uiOptions : Extra options for an activity's UI. [flag]
+android:parentActivityName : The name of the logical parent of the activity as it appears in the manifest. [string]
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-completion69.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-completion69.txt
new file mode 100644
index 000000000..cf7e0f4a1
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-completion69.txt
@@ -0,0 +1,18 @@
+Code completion in manifest.xml for <uses-sdk android:minSdkVersion="^11" />:
+17 : API 17: Android 4.2 (Jelly Bean)
+16 : API 16: Android 4.1 (Jelly Bean)
+15 : API 15: Android 4.0.3 (IceCreamSandwich)
+14 : API 14: Android 4.0 (IceCreamSandwich)
+13 : API 13: Android 3.2 (Honeycomb)
+12 : API 12: Android 3.1 (Honeycomb)
+11 : API 11: Android 3.0 (Honeycomb)
+10 : API 10: Android 2.3.3 (Gingerbread)
+9 : API 9: Android 2.3 (Gingerbread)
+8 : API 8: Android 2.2 (Froyo)
+7 : API 7: Android 2.1 (Eclair)
+6 : API 6: Android 2.0.1 (Eclair)
+5 : API 5: Android 2.0 (Eclair)
+4 : API 4: Android 1.6 (Donut)
+3 : API 3: Android 1.5 (Cupcake)
+2 : API 2: Android 1.1
+1 : API 1: Android 1.0
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-navigate10.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-navigate10.txt
new file mode 100644
index 000000000..c745f54d3
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-navigate10.txt
@@ -0,0 +1,6 @@
+Go To Declaration in manifest.xml for <uses-permission android:name="android.permission.AC^CESS_NETWORK_STATE" />:
+Open XML Declaration : [android.permission.ACCESS_NETWORK_STATE]
+
+
+After open, a browser is shown with this URL:
+ reference/android/Manifest.permission.html#ACCESS_NETWORK_STATE
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-navigate11a.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-navigate11a.txt
new file mode 100644
index 000000000..eaeddf9ef
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-navigate11a.txt
@@ -0,0 +1,6 @@
+Go To Declaration in manifest.xml for <action android:name="android.intent.ac^tion.MAIN" />:
+Open XML Declaration : [android.intent.action.MAIN]
+
+
+After open, a browser is shown with this URL:
+ reference/android/content/Intent.html#ACTION_MAIN
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-navigate11g.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-navigate11g.txt
new file mode 100644
index 000000000..9acb3308a
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-navigate11g.txt
@@ -0,0 +1,6 @@
+Go To Declaration in manifest.xml for <category android:name="android.intent.category.LA^UNCHER" />:
+Open XML Declaration : [android.intent.category.LAUNCHER]
+
+
+After open, a browser is shown with this URL:
+ reference/android/content/Intent.html#CATEGORY_LAUNCHER
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-navigate9a.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-navigate9a.txt
new file mode 100644
index 000000000..2221e377c
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-navigate9a.txt
@@ -0,0 +1,6 @@
+Go To Declaration in manifest.xml for <activity android:name=".Test^Activity":
+Open XML Declaration : [.TestActivity]
+
+
+After open, the selected text is:
+^<?xml version="1.0" encoding="utf-8"?>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest.xml
new file mode 100644
index 000000000..2c0024f04
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="foo.bar"
+ android:versionCode="1"
+ android:versionName="1.0">
+ <uses-sdk android:minSdkVersion="11" />
+ <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
+
+ <application android:icon="@drawable/icon" android:label="@string/app_name">
+ <activity android:name=".TestActivity"
+ android:label="@string/app_name">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ <category android:name="android.intent.category.LAUNCHER" />
+ </intent-filter>
+ </activity>
+
+ </application>
+</manifest>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/metadata.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/metadata.xml
new file mode 100644
index 000000000..9262f97cd
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/metadata.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout android:id="@+id/LinearLayout1"
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical" android:layout_width="match_parent"
+ android:layout_height="match_parent">
+ <ListView android:layout_width="match_parent" android:id="@+id/listView1"
+ android:layout_height="wrap_content">
+ </ListView>
+ <Button android:text="Button" android:id="@+id/button1"/>
+</LinearLayout>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1-expected-complation76.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1-expected-complation76.txt
new file mode 100644
index 000000000..6b9cf5b45
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1-expected-complation76.txt
@@ -0,0 +1,76 @@
+Code completion in navigation1.xml for ?android:a^ttr/alertDialogStyle:
+?android:attr/
+?android:allowClearUserData
+?android:authorities
+?android:action
+?android:alertDialogStyle
+?android:absListViewStyle
+?android:autoCompleteTextViewStyle
+?android:autoLink
+?android:activityOpenEnterAnimation
+?android:activityOpenExitAnimation
+?android:activityCloseEnterAnimation
+?android:activityCloseExitAnimation
+?android:animationCache
+?android:alwaysDrawnWithCache
+?android:addStatesFromChildren
+?android:animationDuration
+?android:antialias
+?android:adjustViewBounds
+?android:autoText
+?android:angle
+?android:animation
+?android:animationOrder
+?android:alphabeticShortcut
+?android:alwaysRetainTaskState
+?android:allowTaskReparenting
+?android:apiKey
+?android:allowSingleTap
+?android:animateOnClick
+?android:anyDensity
+?android:allowBackup
+?android:autoUrlDetect
+?android:accountType
+?android:accountPreferences
+?android:author
+?android:autoStart
+?android:allContactsName
+?android:actionBarStyle
+?android:animateFirstView
+?android:actionDropDownStyle
+?android:actionButtonStyle
+?android:actionModeBackground
+?android:actionModeCloseDrawable
+?android:actionBarSize
+?android:animateLayoutChanges
+?android:actionBarTabStyle
+?android:actionBarTabBarStyle
+?android:actionBarTabTextStyle
+?android:actionOverflowButtonStyle
+?android:actionModeCloseButtonStyle
+?android:actionLayout
+?android:actionViewClass
+?android:activatedBackgroundIndicator
+?android:alertDialogTheme
+?android:autoAdvanceViewId
+?android:actionModeCutDrawable
+?android:actionModeCopyDrawable
+?android:actionModePasteDrawable
+?android:animationResolution
+?android:alpha
+?android:allowParallelSyncs
+?android:alertDialogIcon
+?android:actionMenuTextAppearance
+?android:actionMenuTextColor
+?android:alignmentMode
+?android:actionModeSelectAllDrawable
+?android:accessibilityEventTypes
+?android:accessibilityFeedbackType
+?android:accessibilityFlags
+?android:actionBarSplitStyle
+?android:actionProviderClass
+?android:actionModeStyle
+?android:actionBarWidgetTheme
+?android:actionBarDivider
+?android:actionBarItemBackground
+?android:actionModeSplitBackground
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1-expected-navigate1.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1-expected-navigate1.txt
new file mode 100644
index 000000000..7308a4832
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1-expected-navigate1.txt
@@ -0,0 +1,7 @@
+Go To Declaration in navigation1.xml for android:text="@string/app^_name":
+Open Declaration in values/strings.xml : [@string/app_name]
+ L/PROJECTNAME/res/values/strings.xml
+
+
+After open, the selected text is:
+ [^<string name="app_name">PROJECTNAME</string>]
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1-expected-navigate12.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1-expected-navigate12.txt
new file mode 100644
index 000000000..23fa07e00
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1-expected-navigate12.txt
@@ -0,0 +1,6 @@
+Go To Declaration in navigation1.xml for <my.Cust^omView></my.CustomView>:
+Open XML Declaration : [my.CustomView]
+
+
+After open, the selected text is:
+^<?xml version="1.0" encoding="utf-8"?>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1-expected-navigate15.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1-expected-navigate15.txt
new file mode 100644
index 000000000..e36c5f30b
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1-expected-navigate15.txt
@@ -0,0 +1,7 @@
+Go To Declaration in navigation1.xml for ?android:attr/alert^DialogStyle:
+Open Declaration in values/attrs.xml : [?android:attr/alertDialogStyle]
+ data/res/values/attrs.xml
+
+
+After open, the selected text is:
+ <attr name="alertDialogStyle" format="reference" />^
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1-expected-navigate16.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1-expected-navigate16.txt
new file mode 100644
index 000000000..b6f6cb2bc
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1-expected-navigate16.txt
@@ -0,0 +1,7 @@
+Go To Declaration in navigation1.xml for ?android:alert^DialogStyle:
+Open Declaration in values/attrs.xml : [?android:alertDialogStyle]
+ data/res/values/attrs.xml
+
+
+After open, the selected text is:
+ <attr name="alertDialogStyle" format="reference" />^
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1-expected-navigate2.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1-expected-navigate2.txt
new file mode 100644
index 000000000..f91e1f9ae
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1-expected-navigate2.txt
@@ -0,0 +1,7 @@
+Go To Declaration in navigation1.xml for marginLeft="@android:dimen/app_ico^n_size":
+Open Declaration in values/dimens.xml : [@android:dimen/app_icon_size]
+ data/res/values/dimens.xml
+
+
+After open, the selected text is:
+ <dimen name="app_icon_size">^48dip</dimen>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1-expected-navigate3.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1-expected-navigate3.txt
new file mode 100644
index 000000000..53776a062
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1-expected-navigate3.txt
@@ -0,0 +1,7 @@
+Go To Declaration in navigation1.xml for style="@android:style/Widget.B^utton":
+Open Declaration in values/styles.xml : [@android:style/Widget.Button]
+ data/res/values/styles.xml
+
+
+After open, the selected text is:
+ <style name="Widget.Button">^
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1-expected-navigate4.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1-expected-navigate4.txt
new file mode 100644
index 000000000..ec5ee3801
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1-expected-navigate4.txt
@@ -0,0 +1,89 @@
+Go To Declaration in navigation1.xml for android:text="@android:st^ring/ok":
+Open Declaration in values-en-rGB/strings.xml : [@android:string/ok]
+ data/res/values-en-rGB/strings.xml
+Open Declaration in values/strings.xml : [@android:string/ok]
+ data/res/values/strings.xml
+Open Declaration in values-ar/strings.xml : [@android:string/ok]
+ data/res/values-ar/strings.xml
+Open Declaration in values-bg/strings.xml : [@android:string/ok]
+ data/res/values-bg/strings.xml
+Open Declaration in values-ca/strings.xml : [@android:string/ok]
+ data/res/values-ca/strings.xml
+Open Declaration in values-cs/strings.xml : [@android:string/ok]
+ data/res/values-cs/strings.xml
+Open Declaration in values-da/strings.xml : [@android:string/ok]
+ data/res/values-da/strings.xml
+Open Declaration in values-de/strings.xml : [@android:string/ok]
+ data/res/values-de/strings.xml
+Open Declaration in values-el/strings.xml : [@android:string/ok]
+ data/res/values-el/strings.xml
+Open Declaration in values-es/strings.xml : [@android:string/ok]
+ data/res/values-es/strings.xml
+Open Declaration in values-es-rUS/strings.xml : [@android:string/ok]
+ data/res/values-es-rUS/strings.xml
+Open Declaration in values-fa/strings.xml : [@android:string/ok]
+ data/res/values-fa/strings.xml
+Open Declaration in values-fi/strings.xml : [@android:string/ok]
+ data/res/values-fi/strings.xml
+Open Declaration in values-fr/strings.xml : [@android:string/ok]
+ data/res/values-fr/strings.xml
+Open Declaration in values-hr/strings.xml : [@android:string/ok]
+ data/res/values-hr/strings.xml
+Open Declaration in values-hu/strings.xml : [@android:string/ok]
+ data/res/values-hu/strings.xml
+Open Declaration in values-in/strings.xml : [@android:string/ok]
+ data/res/values-in/strings.xml
+Open Declaration in values-it/strings.xml : [@android:string/ok]
+ data/res/values-it/strings.xml
+Open Declaration in values-iw/strings.xml : [@android:string/ok]
+ data/res/values-iw/strings.xml
+Open Declaration in values-ja/strings.xml : [@android:string/ok]
+ data/res/values-ja/strings.xml
+Open Declaration in values-ko/strings.xml : [@android:string/ok]
+ data/res/values-ko/strings.xml
+Open Declaration in values-lt/strings.xml : [@android:string/ok]
+ data/res/values-lt/strings.xml
+Open Declaration in values-lv/strings.xml : [@android:string/ok]
+ data/res/values-lv/strings.xml
+Open Declaration in values-nb/strings.xml : [@android:string/ok]
+ data/res/values-nb/strings.xml
+Open Declaration in values-nl/strings.xml : [@android:string/ok]
+ data/res/values-nl/strings.xml
+Open Declaration in values-pl/strings.xml : [@android:string/ok]
+ data/res/values-pl/strings.xml
+Open Declaration in values-pt/strings.xml : [@android:string/ok]
+ data/res/values-pt/strings.xml
+Open Declaration in values-pt-rPT/strings.xml : [@android:string/ok]
+ data/res/values-pt-rPT/strings.xml
+Open Declaration in values-rm/strings.xml : [@android:string/ok]
+ data/res/values-rm/strings.xml
+Open Declaration in values-ro/strings.xml : [@android:string/ok]
+ data/res/values-ro/strings.xml
+Open Declaration in values-ru/strings.xml : [@android:string/ok]
+ data/res/values-ru/strings.xml
+Open Declaration in values-sk/strings.xml : [@android:string/ok]
+ data/res/values-sk/strings.xml
+Open Declaration in values-sl/strings.xml : [@android:string/ok]
+ data/res/values-sl/strings.xml
+Open Declaration in values-sr/strings.xml : [@android:string/ok]
+ data/res/values-sr/strings.xml
+Open Declaration in values-sv/strings.xml : [@android:string/ok]
+ data/res/values-sv/strings.xml
+Open Declaration in values-th/strings.xml : [@android:string/ok]
+ data/res/values-th/strings.xml
+Open Declaration in values-tl/strings.xml : [@android:string/ok]
+ data/res/values-tl/strings.xml
+Open Declaration in values-tr/strings.xml : [@android:string/ok]
+ data/res/values-tr/strings.xml
+Open Declaration in values-uk/strings.xml : [@android:string/ok]
+ data/res/values-uk/strings.xml
+Open Declaration in values-vi/strings.xml : [@android:string/ok]
+ data/res/values-vi/strings.xml
+Open Declaration in values-zh-rCN/strings.xml : [@android:string/ok]
+ data/res/values-zh-rCN/strings.xml
+Open Declaration in values-zh-rTW/strings.xml : [@android:string/ok]
+ data/res/values-zh-rTW/strings.xml
+
+
+After open, the selected text is:
+ <string name="ok" msgid="5970060430562524910">^"OK"</string>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1.xml
new file mode 100644
index 000000000..c5b292e7b
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+ <Button
+ android:text="@string/app_name"
+ android:layout_marginLeft="@android:dimen/app_icon_size"
+ style="@android:style/Widget.Button"
+ android:id="@+id/button1"
+ ></Button>
+ <my.CustomView></my.CustomView>
+ <EditText
+ android:text="@android:string/ok"
+ </EditText>
+ <EditText android:text="?android:attr/alertDialogStyle" />
+ <EditText android:text="?android:alertDialogStyle" />
+</LinearLayout>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigationstyles-expected-extract2.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigationstyles-expected-extract2.diff
new file mode 100644
index 000000000..8890f79ea
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigationstyles-expected-extract2.diff
@@ -0,0 +1,5 @@
+@@ -28 +28
++ <style name="newstyle">
++ <item name="android:textColor">#FF00FF</item>
++ <item name="android:textSize">20pt</item>
++ </style>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigationstyles-expected-navigate5.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigationstyles-expected-navigate5.txt
new file mode 100644
index 000000000..15c91d1be
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigationstyles-expected-navigate5.txt
@@ -0,0 +1,7 @@
+Go To Declaration in navigationstyles.xml for parent="android:Theme.Li^ght">:
+Open Declaration in values/themes.xml : [android:Theme.Light]
+ data/res/values/themes.xml
+
+
+After open, the selected text is:
+ <style name="Theme.Light">^
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigationstyles-expected-navigate6.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigationstyles-expected-navigate6.txt
new file mode 100644
index 000000000..5a4f40aa4
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigationstyles-expected-navigate6.txt
@@ -0,0 +1,7 @@
+Go To Declaration in navigationstyles.xml for parent="android:The^me.Light">:
+Open Declaration in values/themes.xml : [android:Theme]
+ data/res/values/themes.xml
+
+
+After open, the selected text is:
+ <style name="Theme">^
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigationstyles-expected-navigate7.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigationstyles-expected-navigate7.txt
new file mode 100644
index 000000000..8f7eb46b8
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigationstyles-expected-navigate7.txt
@@ -0,0 +1,7 @@
+Go To Declaration in navigationstyles.xml for popupBackground">@android:drawable/spinner_dr^opdown_background</item>:
+Open Declaration in drawable/spinner_dropdown_background.xml : [@android:drawable/spinner_dropdown_background]
+ data/res/drawable/spinner_dropdown_background.xml
+
+
+After open, the selected text is:
+^<?xml version="1.0" encoding="utf-8"?>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigationstyles-expected-navigate8.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigationstyles-expected-navigate8.txt
new file mode 100644
index 000000000..b74c67681
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigationstyles-expected-navigate8.txt
@@ -0,0 +1,7 @@
+Go To Declaration in navigationstyles.xml for colorBackground"> @color/cust^om_theme_color </item>:
+Open Declaration in values/navigationstyles.xml : [@color/custom_theme_color]
+ L/PROJECTNAME/res/values/navigationstyles.xml
+
+
+After open, the selected text is:
+ [^<color name="custom_theme_color">#b0b0ff</color>]
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigationstyles.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigationstyles.xml
new file mode 100644
index 000000000..da4bbf289
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigationstyles.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <color name="custom_theme_color">#b0b0ff</color>
+ <style name="CustomTheme" parent="android:Theme.Light">
+ <item name="android:windowBackground">@color/custom_theme_color</item>
+ <item name="android:colorBackground"> @color/custom_theme_color </item>
+ </style>
+
+ <style name="BrowserTheme" parent="@android:Theme.Black">
+ <item name="android:autoCompleteTextViewStyle">@style/AutoCompleteTextView</item>
+ <item name="android:windowNoTitle">true</item>
+ </style>
+
+ <style name="AutoCompleteTextView">
+ <item name="android:focusable">true</item>
+ <item name="android:focusableInTouchMode">true</item>
+ <item name="android:clickable">true</item>
+ <item name="android:completionHintView">@android:layout/simple_dropdown_item_1line</item>
+ <item name="android:textAppearance">?android:attr/textAppearanceLargeInverse</item>
+ <item name="android:completionThreshold">2</item>
+ <item name="android:dropDownSelector">@android:drawable/list_selector_background</item>
+ <item name="android:popupBackground">@android:drawable/spinner_dropdown_background</item>
+ </style>
+
+ <style name="CustomTitle" parent="@android:Theme">
+ <item name="android:windowTitleSize">60dip</item>
+ </style>
+</resources>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newlayout1-expected-extract1.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newlayout1-expected-extract1.xml
new file mode 100644
index 000000000..2a0e9477c
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newlayout1-expected-extract1.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Button xmlns:android="http://schemas.android.com/apk/res/android" android:text="Button" android:id="@+id/button2" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newlayout2-expected-extract2.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newlayout2-expected-extract2.xml
new file mode 100644
index 000000000..b2d1789aa
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newlayout2-expected-extract2.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<merge xmlns:android="http://schemas.android.com/apk/res/android">
+ <ImageView android:id="@+id/android_logo" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/android_button" android:focusable="false" android:clickable="false" android:layout_weight="1.0" />
+ <Button android:text="Button" android:id="@+id/button2" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
+</merge>
+
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newlayout3-expected-extract3.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newlayout3-expected-extract3.xml
new file mode 100644
index 000000000..6ba61c838
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newlayout3-expected-extract3.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Button xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:id="@+id/button3" android:layout_height="wrap_content" android:text="Button" ></Button>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newlayout3-expected-extract4.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newlayout3-expected-extract4.xml
new file mode 100644
index 000000000..ee8568e68
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newlayout3-expected-extract4.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="utf-8"?>
+<ImageView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/android_logo" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/android_button" android:focusable="false" android:clickable="false" />
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newlayout3-expected-extract5.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newlayout3-expected-extract5.xml
new file mode 100644
index 000000000..be5706645
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newlayout3-expected-extract5.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<merge xmlns:android="http://schemas.android.com/apk/res/android">
+ <Button android:text="Button" android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
+ <ImageView android:id="@+id/android_logo" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/android_button" android:focusable="false" android:clickable="false" android:layout_weight="1.0" />
+</merge>
+
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newlayout6-expected-extract6.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newlayout6-expected-extract6.diff
new file mode 100644
index 000000000..6772a8fa2
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newlayout6-expected-extract6.diff
@@ -0,0 +1,12 @@
+@@ -1 +1
+-
+@@ -2 +1
++ <?xml version="1.0" encoding="utf-8"?>
++ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="wrap_content" android:id="@+id/linearLayout4" android:layout_width="match_parent">
++ <LinearLayout android:layout_height="match_parent" android:id="@+id/linearLayout5" android:layout_width="wrap_content">
++ <LinearLayout android:layout_height="match_parent" android:id="@+id/linearLayout6" android:layout_width="wrap_content">
++ <!-- Comment -->
++ <Button android:text="Button" android:id="@+id/button6" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
++ </LinearLayout>
++ </LinearLayout>
++ </LinearLayout>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newlayout6-expected-extract7.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newlayout6-expected-extract7.diff
new file mode 100644
index 000000000..d0fdc92e5
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newlayout6-expected-extract7.diff
@@ -0,0 +1,29 @@
+@@ -1 +1
++ <?xml version="1.0" encoding="utf-8"?>
++ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
++ android:id="@+id/linearLayout4"
++ android:layout_width="match_parent"
++ android:layout_height="wrap_content" >
+@@ -2 +7
++ <LinearLayout
++ android:id="@+id/linearLayout5"
++ android:layout_width="wrap_content"
++ android:layout_height="match_parent" >
++
++ <LinearLayout
++ android:id="@+id/linearLayout6"
++ android:layout_width="wrap_content"
++ android:layout_height="match_parent" >
++
++ <!-- Comment -->
++
++ <Button
++ android:id="@+id/button6"
++ android:layout_width="wrap_content"
++ android:layout_height="wrap_content"
++ android:text="Button" >
++ </Button>
++ </LinearLayout>
++ </LinearLayout>
++
++ </LinearLayout>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles-expected-extract1.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles-expected-extract1.diff
new file mode 100644
index 000000000..0949fbd01
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles-expected-extract1.diff
@@ -0,0 +1,10 @@
+@@ -1 +1
+-
+@@ -2 +1
++ <?xml version="1.0" encoding="utf-8"?>
++ <resources xmlns:android="http://schemas.android.com/apk/res/android">
++ <style name="newstyle">
++ <item name="android:textColor">#FF00FF</item>
++ <item name="android:textSize">20pt</item>
++ </style>
++ </resources>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles2-expected-extract1b.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles2-expected-extract1b.diff
new file mode 100644
index 000000000..0949fbd01
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles2-expected-extract1b.diff
@@ -0,0 +1,10 @@
+@@ -1 +1
+-
+@@ -2 +1
++ <?xml version="1.0" encoding="utf-8"?>
++ <resources xmlns:android="http://schemas.android.com/apk/res/android">
++ <style name="newstyle">
++ <item name="android:textColor">#FF00FF</item>
++ <item name="android:textSize">20pt</item>
++ </style>
++ </resources>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles3-expected-extract1c.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles3-expected-extract1c.diff
new file mode 100644
index 000000000..0949fbd01
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles3-expected-extract1c.diff
@@ -0,0 +1,10 @@
+@@ -1 +1
+-
+@@ -2 +1
++ <?xml version="1.0" encoding="utf-8"?>
++ <resources xmlns:android="http://schemas.android.com/apk/res/android">
++ <style name="newstyle">
++ <item name="android:textColor">#FF00FF</item>
++ <item name="android:textSize">20pt</item>
++ </style>
++ </resources>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles3-expected-extract8.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles3-expected-extract8.diff
new file mode 100644
index 000000000..e8b553ec9
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles3-expected-extract8.diff
@@ -0,0 +1,10 @@
+@@ -1 +1
+-
+@@ -2 +1
++ <?xml version="1.0" encoding="utf-8"?>
++ <resources xmlns:android="http://schemas.android.com/apk/res/android">
++ <style name="newstyle" parent="android:Widget.Button">
++ <item name="android:textColor">#FF00FF</item>
++ <item name="android:textSize">20pt</item>
++ </style>
++ </resources>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles4-expected-extract1d.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles4-expected-extract1d.diff
new file mode 100644
index 000000000..0949fbd01
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles4-expected-extract1d.diff
@@ -0,0 +1,10 @@
+@@ -1 +1
+-
+@@ -2 +1
++ <?xml version="1.0" encoding="utf-8"?>
++ <resources xmlns:android="http://schemas.android.com/apk/res/android">
++ <style name="newstyle">
++ <item name="android:textColor">#FF00FF</item>
++ <item name="android:textSize">20pt</item>
++ </style>
++ </resources>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles4-expected-extract3.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles4-expected-extract3.diff
new file mode 100644
index 000000000..88a94e7e0
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles4-expected-extract3.diff
@@ -0,0 +1,10 @@
+@@ -1 +1
+-
+@@ -2 +1
++ <?xml version="1.0" encoding="utf-8"?>
++ <resources xmlns:android="http://schemas.android.com/apk/res/android">
++ <style name="newstyle">
++ <item name="android:textColor">#FF0000</item>
++ <item name="android:textSize">20pt</item>
++ </style>
++ </resources>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles5-expected-extract4.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles5-expected-extract4.diff
new file mode 100644
index 000000000..49043b93c
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles5-expected-extract4.diff
@@ -0,0 +1,9 @@
+@@ -1 +1
+-
+@@ -2 +1
++ <?xml version="1.0" encoding="utf-8"?>
++ <resources xmlns:android="http://schemas.android.com/apk/res/android">
++ <style name="newstyle">
++ <item name="android:textColor">#FF00FF</item>
++ </style>
++ </resources>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles6-expected-extract5.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles6-expected-extract5.diff
new file mode 100644
index 000000000..49ab2c3ee
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles6-expected-extract5.diff
@@ -0,0 +1,9 @@
+@@ -1 +1
+-
+@@ -2 +1
++ <?xml version="1.0" encoding="utf-8"?>
++ <resources xmlns:android="http://schemas.android.com/apk/res/android">
++ <style name="newstyle">
++ <item name="android:textSize">20pt</item>
++ </style>
++ </resources>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles7-expected-extract6.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles7-expected-extract6.diff
new file mode 100644
index 000000000..51f0812c9
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles7-expected-extract6.diff
@@ -0,0 +1,13 @@
+<
+---
+> <?xml version="1.0" encoding="utf-8"?>
+> <resources xmlns:android="http://schemas.android.com/apk/res/android">
+> <style name="newstyle">
+> <item name="android:layout_alignParentBottom">true</item>
+> <item name="android:layout_height">wrap_content</item>
+> <item name="android:layout_width">wrap_content</item>
+> <item name="android:text">Button</item>
+> <item name="android:textColor">#FF0000</item>
+> <item name="android:textSize">20pt</item>
+> </style>
+> </resources>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles8-expected-extract7.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles8-expected-extract7.diff
new file mode 100644
index 000000000..6bcd6ffd4
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles8-expected-extract7.diff
@@ -0,0 +1,10 @@
+@@ -1 +1
+-
+@@ -2 +1
++ <?xml version="1.0" encoding="utf-8"?>
++ <resources xmlns:android="http://schemas.android.com/apk/res/android">
++ <style name="newstyle">
++ <item name="android:textColor">#00FF00</item>
++ <item name="android:textSize">20pt</item>
++ </style>
++ </resources>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/quickfix1-expected-quickFix1.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/quickfix1-expected-quickFix1.xml
new file mode 100644
index 000000000..a51abf407
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/quickfix1-expected-quickFix1.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+
+ <string name="app_name">PROJECTNAME</string>
+ <string name="firststring">[^TODO]</string>
+
+</resources> \ No newline at end of file
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/quickfix1-expected-quickFix2.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/quickfix1-expected-quickFix2.xml
new file mode 100644
index 000000000..a0d04fb6e
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/quickfix1-expected-quickFix2.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <dimen name="testdimen">[^1dp]</dimen>
+</resources>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/quickfix1-expected-quickFix3.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/quickfix1-expected-quickFix3.xml
new file mode 100644
index 000000000..900c42064
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/quickfix1-expected-quickFix3.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical" >
+ ^
+
+</LinearLayout> \ No newline at end of file
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/quickfix1.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/quickfix1.xml
new file mode 100644
index 000000000..927c8d1db
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/quickfix1.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <Button android:text="@string/firststring"
+ android:id="@+id/button1"
+ android:layout_width="@dimen/testdimen"
+ android:layout_height="wrap_content">
+ </Button>
+
+ <include layout="@layout/testlayout" android:layout_width="wrap_content" android:layout_height="wrap_content"/>
+
+</LinearLayout>
+
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/quickfix2-expected-quickFix4.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/quickfix2-expected-quickFix4.xml
new file mode 100644
index 000000000..7b638c645
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/quickfix2-expected-quickFix4.xml
@@ -0,0 +1,4 @@
+@@ -5 +5
+- <color android:color="#0000000"/>
+@@ -6 +5
++ <color android:color="#0000000" xmlns:android="http://schemas.android.com/apk/res/android"/>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/quickfix2.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/quickfix2.xml
new file mode 100644
index 000000000..4f2a925a5
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/quickfix2.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+ <!--
+ Random comment here
+ -->
+<color android:color="#0000000"/>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound1-expected-1.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound1-expected-1.xml
new file mode 100644
index 000000000..e72638f57
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound1-expected-1.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:orientation="vertical" >
+
+ <TextView
+ android:id="@+id/TextView1"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:drawableTop="@drawable/ic_launcher"
+ android:gravity="center"
+ android:text="Hello World" >
+ </TextView>
+
+</LinearLayout> \ No newline at end of file
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound1.info b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound1.info
new file mode 100644
index 000000000..4f0aea55e
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound1.info
@@ -0,0 +1,4 @@
+android.widget.LinearLayout [0,121,800,480] <LinearLayout>
+ android.widget.LinearLayout [0,0,109,97] <LinearLayout>
+ android.widget.ImageView [18,0,90,72] <ImageView>
+ android.widget.TextView [0,72,109,97] <TextView>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound1.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound1.xml
new file mode 100644
index 000000000..e4f5bf20e
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound1.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:orientation="vertical" >
+
+ <LinearLayout
+ android:id="@+id/layout1"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:gravity="center"
+ android:orientation="vertical" >
+
+ <ImageView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:src="@drawable/ic_launcher" />
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="Hello World" />
+ </LinearLayout>
+
+</LinearLayout>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound2-expected-2.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound2-expected-2.xml
new file mode 100644
index 000000000..2b9d338d1
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound2-expected-2.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:orientation="vertical" >
+
+ <TextView
+ android:id="@+id/TextView1"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:drawableBottom="@drawable/ic_launcher"
+ android:gravity="center"
+ android:text="Hello World" >
+ </TextView>
+
+</LinearLayout> \ No newline at end of file
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound2.info b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound2.info
new file mode 100644
index 000000000..37084fb88
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound2.info
@@ -0,0 +1,5 @@
+android.widget.LinearLayout [0,121,800,480] <LinearLayout>
+ android.widget.LinearLayout [0,0,109,97] <LinearLayout>
+ android.widget.TextView [0,0,109,25] <TextView>
+ android.widget.ImageView [18,25,90,97] <ImageView>
+
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound2.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound2.xml
new file mode 100644
index 000000000..c24fb211c
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound2.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:orientation="vertical" >
+
+ <LinearLayout
+ android:id="@+id/layout2"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:gravity="center"
+ android:orientation="vertical" >
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="Hello World" />
+
+ <ImageView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:src="@drawable/ic_launcher" />
+ </LinearLayout>
+
+</LinearLayout>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound3-expected-3.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound3-expected-3.xml
new file mode 100644
index 000000000..ac8ffa8ce
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound3-expected-3.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:orientation="vertical" >
+
+ <TextView
+ android:id="@+id/TextView1"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:drawableLeft="@drawable/ic_launcher"
+ android:gravity="center"
+ android:text="Hello World" >
+ </TextView>
+
+</LinearLayout> \ No newline at end of file
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound3.info b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound3.info
new file mode 100644
index 000000000..01d1127f1
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound3.info
@@ -0,0 +1,4 @@
+android.widget.LinearLayout [0,121,800,480] <LinearLayout>
+ android.widget.LinearLayout [0,0,181,72] <LinearLayout>
+ android.widget.ImageView [0,0,72,72] <ImageView>
+ android.widget.TextView [72,23,181,48] <TextView>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound3.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound3.xml
new file mode 100644
index 000000000..2444e4830
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound3.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:orientation="vertical" >
+
+ <LinearLayout
+ android:id="@+id/layout3"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:gravity="center"
+ android:orientation="horizontal" >
+
+ <ImageView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:src="@drawable/ic_launcher" />
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="Hello World" />
+ </LinearLayout>
+
+</LinearLayout>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound4-expected-4.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound4-expected-4.xml
new file mode 100644
index 000000000..af9b1c922
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound4-expected-4.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:orientation="vertical" >
+
+ <TextView
+ android:id="@+id/TextView1"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:drawableRight="@drawable/ic_launcher"
+ android:gravity="center"
+ android:text="Hello World" >
+ </TextView>
+
+</LinearLayout> \ No newline at end of file
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound4.info b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound4.info
new file mode 100644
index 000000000..4b39be81e
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound4.info
@@ -0,0 +1,4 @@
+android.widget.LinearLayout [0,121,800,480] <LinearLayout>
+ android.widget.LinearLayout [0,0,181,72] <LinearLayout>
+ android.widget.TextView [0,23,109,48] <TextView>
+ android.widget.ImageView [109,0,181,72] <ImageView>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound4.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound4.xml
new file mode 100644
index 000000000..2f6afd2f7
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound4.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:orientation="vertical" >
+
+ <LinearLayout
+ android:id="@+id/layout4"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:gravity="center"
+ android:orientation="horizontal" >
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="Hello World" />
+
+ <ImageView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:src="@drawable/ic_launcher" />
+ </LinearLayout>
+
+</LinearLayout>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound5-expected-7.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound5-expected-7.xml
new file mode 100644
index 000000000..e909811cf
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound5-expected-7.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<TextView xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/TextView1"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:drawableBottom="@drawable/ic_launcher"
+ android:text="Hello World" >
+
+</TextView> \ No newline at end of file
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound5.info b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound5.info
new file mode 100644
index 000000000..8eb5c4b86
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound5.info
@@ -0,0 +1,3 @@
+android.widget.LinearLayout [0,74,480,800] <LinearLayout>
+ android.widget.TextView [0,0,107,26] <TextView>
+ android.widget.ImageView [0,26,72,98] <ImageView>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound5.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound5.xml
new file mode 100644
index 000000000..49c0594da
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound5.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:id="@+id/layout"
+ android:orientation="vertical" >
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="Hello World" />
+
+ <ImageView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:src="@drawable/ic_launcher" />
+
+</LinearLayout>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound6-expected-8.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound6-expected-8.xml
new file mode 100644
index 000000000..1ef5d78c6
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound6-expected-8.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:orientation="vertical" >
+
+ <TextView
+ android:id="@+id/TextView1"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:drawableLeft="@drawable/ic_launcher"
+ android:drawablePadding="@android:dimen/thumbnail_width"
+ android:gravity="center"
+ android:text="Hello World" >
+ </TextView>
+
+</LinearLayout> \ No newline at end of file
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound6.info b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound6.info
new file mode 100644
index 000000000..4f0aea55e
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound6.info
@@ -0,0 +1,4 @@
+android.widget.LinearLayout [0,121,800,480] <LinearLayout>
+ android.widget.LinearLayout [0,0,109,97] <LinearLayout>
+ android.widget.ImageView [18,0,90,72] <ImageView>
+ android.widget.TextView [0,72,109,97] <TextView>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound6.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound6.xml
new file mode 100644
index 000000000..94a363ba5
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound6.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:orientation="vertical" >
+
+ <LinearLayout
+ android:id="@+id/layout1"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:gravity="center" >
+
+ <ImageView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginRight="@android:dimen/thumbnail_width"
+ android:src="@drawable/ic_launcher" />
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="Hello World" />
+ </LinearLayout>
+
+</LinearLayout>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound7-expected-9.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound7-expected-9.xml
new file mode 100644
index 000000000..1b2a8643e
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound7-expected-9.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:orientation="vertical" >
+
+ <TextView
+ android:id="@+id/TextView1"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:drawablePadding="35dp"
+ android:drawableTop="@drawable/ic_launcher"
+ android:gravity="center"
+ android:text="Hello World" >
+ </TextView>
+
+</LinearLayout> \ No newline at end of file
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound7.info b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound7.info
new file mode 100644
index 000000000..4f0aea55e
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound7.info
@@ -0,0 +1,4 @@
+android.widget.LinearLayout [0,121,800,480] <LinearLayout>
+ android.widget.LinearLayout [0,0,109,97] <LinearLayout>
+ android.widget.ImageView [18,0,90,72] <ImageView>
+ android.widget.TextView [0,72,109,97] <TextView>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound7.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound7.xml
new file mode 100644
index 000000000..46393fe0e
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound7.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:orientation="vertical" >
+
+ <LinearLayout
+ android:id="@+id/layout1"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:gravity="center"
+ android:orientation="vertical" >
+
+ <ImageView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="10dp"
+ android:src="@drawable/ic_launcher" />
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="25dp"
+ android:text="Hello World" />
+ </LinearLayout>
+
+</LinearLayout>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound_all-expected-5.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound_all-expected-5.xml
new file mode 100644
index 000000000..35bebf5f1
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound_all-expected-5.xml
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/RelativeLayout1"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent" >
+
+ <LinearLayout
+ android:id="@+id/layout1"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:gravity="center"
+ android:orientation="vertical" >
+
+ <ImageView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:src="@drawable/ic_launcher" />
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="Hello World" />
+ </LinearLayout>
+
+ <TextView
+ android:id="@+id/textView2"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_below="@+id/layout1"
+ android:drawableBottom="@drawable/ic_launcher"
+ android:gravity="center"
+ android:text="Hello World" >
+ </TextView>
+
+ <LinearLayout
+ android:id="@+id/layout3"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_below="@+id/textView2"
+ android:gravity="center"
+ android:orientation="horizontal" >
+
+ <ImageView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:src="@drawable/ic_launcher" />
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="Hello World" />
+ </LinearLayout>
+
+ <LinearLayout
+ android:id="@+id/layout4"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_below="@+id/layout3"
+ android:gravity="center"
+ android:orientation="horizontal" >
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="Hello World" />
+
+ <ImageView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:src="@drawable/ic_launcher" />
+ </LinearLayout>
+
+</RelativeLayout> \ No newline at end of file
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound_all-expected-6.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound_all-expected-6.xml
new file mode 100644
index 000000000..6d9925674
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound_all-expected-6.xml
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/RelativeLayout1"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent" >
+
+ <LinearLayout
+ android:id="@+id/layout1"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:gravity="center"
+ android:orientation="vertical" >
+
+ <ImageView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:src="@drawable/ic_launcher" />
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="Hello World" />
+ </LinearLayout>
+
+ <LinearLayout
+ android:id="@+id/layout2"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_below="@+id/layout1"
+ android:gravity="center"
+ android:orientation="vertical" >
+
+ <TextView
+ android:id="@+id/textView2"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="Hello World" />
+
+ <ImageView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:src="@drawable/ic_launcher" />
+ </LinearLayout>
+
+ <TextView
+ android:id="@+id/TextView1"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_below="@+id/layout2"
+ android:drawableLeft="@drawable/ic_launcher"
+ android:gravity="center"
+ android:text="Hello World" >
+ </TextView>
+
+ <LinearLayout
+ android:id="@+id/layout4"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_below="@+id/TextView1"
+ android:gravity="center"
+ android:orientation="horizontal" >
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="Hello World" />
+
+ <ImageView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:src="@drawable/ic_launcher" />
+ </LinearLayout>
+
+</RelativeLayout> \ No newline at end of file
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound_all.info b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound_all.info
new file mode 100644
index 000000000..57508bd72
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound_all.info
@@ -0,0 +1,13 @@
+android.widget.RelativeLayout [0,121,800,480] <RelativeLayout>
+ android.widget.LinearLayout [0,0,109,97] <LinearLayout>
+ android.widget.ImageView [18,0,90,72] <ImageView>
+ android.widget.TextView [0,72,109,97] <TextView>
+ android.widget.LinearLayout [0,97,109,194] <LinearLayout>
+ android.widget.TextView [0,0,109,25] <TextView>
+ android.widget.ImageView [18,25,90,97] <ImageView>
+ android.widget.LinearLayout [0,194,181,266] <LinearLayout>
+ android.widget.ImageView [0,0,72,72] <ImageView>
+ android.widget.TextView [72,23,181,48] <TextView>
+ android.widget.LinearLayout [0,266,181,338] <LinearLayout>
+ android.widget.TextView [0,23,109,48] <TextView>
+ android.widget.ImageView [109,0,181,72] <ImageView>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound_all.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound_all.xml
new file mode 100644
index 000000000..0406b171d
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/refactoring/usecompound/compound_all.xml
@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/RelativeLayout1"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent" >
+
+ <LinearLayout
+ android:id="@+id/layout1"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:gravity="center"
+ android:orientation="vertical" >
+
+ <ImageView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:src="@drawable/ic_launcher" />
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="Hello World" />
+ </LinearLayout>
+
+ <LinearLayout
+ android:id="@+id/layout2"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_below="@+id/layout1"
+ android:gravity="center"
+ android:orientation="vertical" >
+
+ <TextView
+ android:id="@+id/textView2"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="Hello World" />
+
+ <ImageView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:src="@drawable/ic_launcher" />
+ </LinearLayout>
+
+ <LinearLayout
+ android:id="@+id/layout3"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_below="@+id/layout2"
+ android:gravity="center"
+ android:orientation="horizontal" >
+
+ <ImageView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:src="@drawable/ic_launcher" />
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="Hello World" />
+ </LinearLayout>
+
+ <LinearLayout
+ android:id="@+id/layout4"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_below="@+id/layout3"
+ android:gravity="center"
+ android:orientation="horizontal" >
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="Hello World" />
+
+ <ImageView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:src="@drawable/ic_launcher" />
+ </LinearLayout>
+
+</RelativeLayout>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample10-expected-convertFromGrid.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample10-expected-convertFromGrid.xml
new file mode 100644
index 000000000..98e1f36f4
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample10-expected-convertFromGrid.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/LinearLayout1"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:columnCount="2"
+ android:orientation="horizontal" >
+
+ <Button
+ android:id="@+id/button1"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="Button" />
+
+ <RadioButton
+ android:id="@+id/radioButton1"
+ android:layout_width="150dp"
+ android:layout_height="wrap_content"
+ android:layout_column="0"
+ android:layout_row="1"
+ android:text="RadioButton" />
+
+ <RadioButton
+ android:id="@+id/radioButton2"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="RadioButton" />
+
+ <CheckBox
+ android:id="@+id/checkBox1"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="CheckBox" />
+
+</LinearLayout> \ No newline at end of file
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample10-expected-initialAttributes.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample10-expected-initialAttributes.xml
new file mode 100644
index 000000000..aa8ecdac2
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample10-expected-initialAttributes.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/LinearLayout1"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:columnCount="2"
+ android:orientation="vertical" >
+
+ <Button
+ android:id="@+id/button1"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="Button" />
+
+ <RadioButton
+ android:id="@+id/radioButton1"
+ android:layout_width="150dp"
+ android:layout_height="wrap_content"
+ android:layout_column="0"
+ android:layout_row="1"
+ android:text="RadioButton" />
+
+ <RadioButton
+ android:id="@+id/radioButton2"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="RadioButton" />
+
+ <CheckBox
+ android:id="@+id/checkBox1"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="CheckBox" />
+
+</LinearLayout> \ No newline at end of file
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample10.info b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample10.info
new file mode 100644
index 000000000..c964b0eba
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample10.info
@@ -0,0 +1,5 @@
+android.widget.GridLayout [0,73,320,480] <GridLayout>
+ android.widget.Button [0,0,79,48] <Button>
+ android.widget.RadioButton [0,48,150,86] <RadioButton>
+ android.widget.RadioButton [150,48,273,86] <RadioButton>
+ android.widget.CheckBox [0,86,107,124] <CheckBox>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample10.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample10.xml
new file mode 100644
index 000000000..1fcaab569
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample10.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/GridLayout1"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:columnCount="2"
+ android:orientation="horizontal" >
+
+ <Button
+ android:id="@+id/button1"
+ android:text="Button" />
+
+ <RadioButton
+ android:id="@+id/radioButton1"
+ android:layout_width="150dp"
+ android:layout_column="0"
+ android:layout_row="1"
+ android:text="RadioButton" />
+
+ <RadioButton
+ android:id="@+id/radioButton2"
+ android:text="RadioButton" />
+
+ <CheckBox
+ android:id="@+id/checkBox1"
+ android:text="CheckBox" />
+
+</GridLayout>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample11-expected-insertSpacer.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample11-expected-insertSpacer.xml
new file mode 100644
index 000000000..d10626a90
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample11-expected-insertSpacer.xml
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright 2010 Google Inc.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/home_root"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:columnCount="3"
+ android:orientation="horizontal" >
+
+ <Button
+ android:layout_gravity="fill_horizontal"
+ android:layout_weight="1" />
+
+ <Button
+ android:layout_gravity="fill_horizontal"
+ android:layout_weight="1" />
+
+ <Button
+ android:layout_column="0"
+ android:layout_gravity="fill_horizontal"
+ android:layout_weight="1"
+ android:gravity="center_horizontal" />
+
+ <Button
+ android:layout_gravity="fill_horizontal"
+ android:layout_weight="1"
+ android:gravity="center_horizontal" />
+
+ <Button
+ android:layout_column="0"
+ android:layout_gravity="fill_horizontal"
+ android:layout_weight="1"
+ android:gravity="center_horizontal" />
+
+ <Button
+ android:layout_gravity="fill_horizontal"
+ android:layout_weight="1"
+ android:gravity="center_horizontal" />
+
+ <Space
+ android:layout_column="2"
+ android:layout_gravity="fill_vertical"
+ android:layout_row="3" />
+
+</GridLayout> \ No newline at end of file
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample11.info b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample11.info
new file mode 100644
index 000000000..560e8a877
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample11.info
@@ -0,0 +1,11 @@
+android.widget.LinearLayout [0,50,480,320] <LinearLayout>
+ android.widget.LinearLayout [0,0,480,270] <LinearLayout>
+ android.widget.LinearLayout [6,6,474,92] <LinearLayout>
+ android.widget.Button [0,19,234,67] <Button>
+ android.widget.Button [234,19,468,67] <Button>
+ android.widget.LinearLayout [6,92,474,178] <LinearLayout>
+ android.widget.Button [0,19,234,67] <Button>
+ android.widget.Button [234,19,468,67] <Button>
+ android.widget.LinearLayout [6,178,474,264] <LinearLayout>
+ android.widget.Button [0,19,234,67] <Button>
+ android.widget.Button [234,19,468,67] <Button>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample11.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample11.xml
new file mode 100644
index 000000000..4df91a190
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample11.xml
@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright 2010 Google Inc.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/home_root"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:orientation="vertical" >
+
+ <LinearLayout
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:orientation="vertical"
+ android:padding="6dip" >
+
+ <LinearLayout
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:orientation="horizontal" >
+
+ <Button
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_vertical"
+ android:layout_weight="1" />
+
+ <Button
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_vertical"
+ android:layout_weight="1" />
+ </LinearLayout>
+
+ <LinearLayout
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:orientation="horizontal" >
+
+ <Button
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_vertical"
+ android:layout_weight="1"
+ android:gravity="center_horizontal" />
+
+ <Button
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_vertical"
+ android:layout_weight="1"
+ android:gravity="center_horizontal" />
+ </LinearLayout>
+
+ <LinearLayout
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:orientation="horizontal" >
+
+ <Button
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_vertical"
+ android:layout_weight="1"
+ android:gravity="center_horizontal" />
+
+ <Button
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_vertical"
+ android:layout_weight="1"
+ android:gravity="center_horizontal" />
+ </LinearLayout>
+ </LinearLayout>
+
+</LinearLayout>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-assistant1.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-assistant1.txt
new file mode 100644
index 000000000..8eccdfc52
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-assistant1.txt
@@ -0,0 +1,3 @@
+Quick assistant in sample1a.xml for <Button android:text="Fir^stButton":
+Extract Android String : Initiates the "Extract Android String" refactoring
+Extract Style : Initiates the "Extract Style" refactoring
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-assistant2.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-assistant2.txt
new file mode 100644
index 000000000..b435ef49c
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-assistant2.txt
@@ -0,0 +1,7 @@
+Quick assistant in sample1a.xml for <Bu^tton android:text:
+Wrap in Container : Initiates the "Wrap in Container" refactoring
+Remove Container : Initiates the "Remove Container" refactoring
+Change Widget Type : Initiates the "Change Widget Type" refactoring
+Change Layout : Initiates the "Change Layout" refactoring
+Extract as Include : Initiates the "Extract as Include" refactoring
+Extract Style : Initiates the "Extract Style" refactoring
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-assistant3.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-assistant3.txt
new file mode 100644
index 000000000..a7c46c026
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-assistant3.txt
@@ -0,0 +1,7 @@
+Quick assistant in sample1a.xml for <Button andr^oid:text="FirstButton":
+Wrap in Container : Initiates the "Wrap in Container" refactoring
+Remove Container : Initiates the "Remove Container" refactoring
+Change Widget Type : Initiates the "Change Widget Type" refactoring
+Change Layout : Initiates the "Change Layout" refactoring
+Extract as Include : Initiates the "Extract as Include" refactoring
+Extract Style : Initiates the "Extract Style" refactoring
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-assistant4.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-assistant4.txt
new file mode 100644
index 000000000..30bb00b25
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-assistant4.txt
@@ -0,0 +1,3 @@
+Quick assistant in sample1a.xml for android:id="@+id/Linea^rLayout2":
+Rename Android Resource : Initiates the "Rename Android Resource" refactoring
+Extract Style : Initiates the "Extract Style" refactoring
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-changeLayout1a.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-changeLayout1a.xml
new file mode 100644
index 000000000..d03c92535
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-changeLayout1a.xml
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/RelativeLayout1"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical" >
+
+ <Button
+ android:id="@+id/button1"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentLeft="true"
+ android:layout_alignParentTop="true"
+ android:text="FirstButton" >
+ </Button>
+
+ <Button
+ android:id="@+id/button2"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentLeft="true"
+ android:layout_below="@+id/button1"
+ android:layout_marginTop="2dp"
+ android:text="SecondButton" >
+ </Button>
+
+ <Button
+ android:id="@+id/button3"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignBaseline="@+id/button2"
+ android:layout_alignTop="@+id/button2"
+ android:layout_toRightOf="@+id/button2"
+ android:text="ThirdButton" >
+ </Button>
+
+ <CheckBox
+ android:id="@+id/checkBox1"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignBaseline="@+id/button2"
+ android:layout_below="@+id/button1"
+ android:layout_toRightOf="@+id/button3"
+ android:text="CheckBox" >
+ </CheckBox>
+
+ <Button
+ android:id="@+id/button4"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_alignParentLeft="true"
+ android:layout_below="@+id/checkBox1"
+ android:text="FourthButton" >
+ </Button>
+
+ <Button
+ android:id="@+id/button5"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentLeft="true"
+ android:layout_below="@+id/button4"
+ android:layout_gravity="right"
+ android:text="FifthButton" >
+ </Button>
+
+ <Button
+ android:id="@+id/button6"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentLeft="true"
+ android:layout_below="@+id/button5"
+ android:text="Button" >
+ </Button>
+
+</RelativeLayout> \ No newline at end of file
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-changeView1.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-changeView1.xml
new file mode 100644
index 000000000..f4a08d023
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-changeView1.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout android:id="@+id/LinearLayout2" xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical">
+ <RadioButton android:text="FirstButton" android:id="@+id/RadioButton1" android:layout_width="wrap_content" android:layout_height="wrap_content"></RadioButton>
+ <LinearLayout android:layout_width="match_parent" android:id="@+id/linearLayout1" android:layout_height="wrap_content">
+ <Button android:text="SecondButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/button2"></Button>
+ <Button android:text="ThirdButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/button3"></Button>
+ <CheckBox android:id="@+id/checkBox1" android:text="CheckBox" android:layout_width="wrap_content" android:layout_height="wrap_content"></CheckBox>
+ </LinearLayout>
+ <Button android:layout_height="wrap_content" android:text="FourthButton" android:id="@+id/button4" android:layout_width="match_parent"></Button>
+ <LinearLayout android:layout_height="wrap_content" android:id="@+id/linearLayout3" android:layout_width="match_parent">
+ <Button android:layout_gravity="right" android:id="@+id/button5" android:text="FifthButton" android:layout_height="wrap_content" android:layout_width="wrap_content"></Button>
+ </LinearLayout>
+ <LinearLayout android:layout_height="wrap_content" android:id="@+id/linearLayout4" android:layout_width="match_parent">
+ <LinearLayout android:layout_height="match_parent" android:id="@+id/linearLayout5" android:layout_width="wrap_content">
+ <LinearLayout android:layout_height="match_parent" android:id="@+id/linearLayout6" android:layout_width="wrap_content">
+ <RadioButton android:text="Button" android:id="@+id/RadioButton2" android:layout_width="wrap_content" android:layout_height="wrap_content"></RadioButton>
+ </LinearLayout>
+ </LinearLayout>
+ </LinearLayout>
+</LinearLayout>
+
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-extract6.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-extract6.diff
new file mode 100644
index 000000000..1ae5748e4
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-extract6.diff
@@ -0,0 +1,9 @@
+@@ -13 +13
+- <LinearLayout android:layout_height="wrap_content" android:id="@+id/linearLayout4" android:layout_width="match_parent">
+- <LinearLayout android:layout_height="match_parent" android:id="@+id/linearLayout5" android:layout_width="wrap_content">
+- <LinearLayout android:layout_height="match_parent" android:id="@+id/linearLayout6" android:layout_width="wrap_content">
+- <Button android:text="Button" android:id="@+id/button6" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
+- </LinearLayout>
+- </LinearLayout>
+- </LinearLayout>
++ <include layout="@layout/newlayout6" android:id="@+id/linearLayout4_ref" android:layout_width="match_parent" android:layout_height="wrap_content"/>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-extract7.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-extract7.diff
new file mode 100644
index 000000000..6d18aab26
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-extract7.diff
@@ -0,0 +1,84 @@
+@@ -2 +2
+- <LinearLayout android:id="@+id/LinearLayout2" xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical">
+- <Button android:text="FirstButton" android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
+- <LinearLayout android:layout_width="match_parent" android:id="@+id/linearLayout1" android:layout_height="wrap_content">
+- <Button android:text="SecondButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/button2"></Button>
+- <Button android:text="ThirdButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/button3"></Button>
+- <CheckBox android:id="@+id/checkBox1" android:text="CheckBox" android:layout_width="wrap_content" android:layout_height="wrap_content"></CheckBox>
+- </LinearLayout>
+- <Button android:layout_height="wrap_content" android:text="FourthButton" android:id="@+id/button4" android:layout_width="match_parent"></Button>
+- <LinearLayout android:layout_height="wrap_content" android:id="@+id/linearLayout3" android:layout_width="match_parent">
+- <Button android:layout_gravity="right" android:id="@+id/button5" android:text="FifthButton" android:layout_height="wrap_content" android:layout_width="wrap_content"></Button>
++ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
++ android:id="@+id/LinearLayout2"
++ android:layout_width="match_parent"
++ android:layout_height="match_parent"
++ android:orientation="vertical" >
++
++ <Button
++ android:id="@+id/button1"
++ android:layout_width="wrap_content"
++ android:layout_height="wrap_content"
++ android:text="FirstButton" >
++ </Button>
++
++ <LinearLayout
++ android:id="@+id/linearLayout1"
++ android:layout_width="match_parent"
++ android:layout_height="wrap_content" >
++
++ <Button
++ android:id="@+id/button2"
++ android:layout_width="wrap_content"
++ android:layout_height="wrap_content"
++ android:text="SecondButton" >
++ </Button>
++
++ <Button
++ android:id="@+id/button3"
++ android:layout_width="wrap_content"
++ android:layout_height="wrap_content"
++ android:text="ThirdButton" >
++ </Button>
++
++ <CheckBox
++ android:id="@+id/checkBox1"
++ android:layout_width="wrap_content"
++ android:layout_height="wrap_content"
++ android:text="CheckBox" >
++ </CheckBox>
+@@ -13 +41
+- <LinearLayout android:layout_height="wrap_content" android:id="@+id/linearLayout4" android:layout_width="match_parent">
+- <LinearLayout android:layout_height="match_parent" android:id="@+id/linearLayout5" android:layout_width="wrap_content">
+- <LinearLayout android:layout_height="match_parent" android:id="@+id/linearLayout6" android:layout_width="wrap_content">
+- <Button android:text="Button" android:id="@+id/button6" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
+- </LinearLayout>
+- </LinearLayout>
++
++ <Button
++ android:id="@+id/button4"
++ android:layout_width="match_parent"
++ android:layout_height="wrap_content"
++ android:text="FourthButton" >
++ </Button>
++
++ <LinearLayout
++ android:id="@+id/linearLayout3"
++ android:layout_width="match_parent"
++ android:layout_height="wrap_content" >
++
++ <Button
++ android:id="@+id/button5"
++ android:layout_width="wrap_content"
++ android:layout_height="wrap_content"
++ android:layout_gravity="right"
++ android:text="FifthButton" >
++ </Button>
+@@ -20 +62
++
++ <include
++ android:id="@+id/linearLayout4_ref"
++ android:layout_width="match_parent"
++ android:layout_height="wrap_content"
++ layout="@layout/newlayout6" />
++
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-gridLayout1.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-gridLayout1.xml
new file mode 100644
index 000000000..72fe214ce
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-gridLayout1.xml
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="utf-8"?>
+<GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/GridLayout1"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:columnCount="4"
+ android:orientation="horizontal" >
+
+ <Button
+ android:id="@+id/button1"
+ android:layout_gravity="left"
+ android:text="FirstButton" >
+ </Button>
+
+ <Button
+ android:id="@+id/button2"
+ android:layout_column="0"
+ android:layout_gravity="left"
+ android:text="SecondButton" >
+ </Button>
+
+ <Button
+ android:id="@+id/button3"
+ android:layout_gravity="left"
+ android:text="ThirdButton" >
+ </Button>
+
+ <CheckBox
+ android:id="@+id/checkBox1"
+ android:layout_gravity="left"
+ android:text="CheckBox" >
+ </CheckBox>
+
+ <Button
+ android:id="@+id/button4"
+ android:layout_column="0"
+ android:layout_columnSpan="3"
+ android:layout_gravity="fill_horizontal"
+ android:text="FourthButton" >
+ </Button>
+
+ <Button
+ android:id="@+id/button5"
+ android:layout_column="0"
+ android:layout_gravity="right"
+ android:text="FifthButton" >
+ </Button>
+
+ <Button
+ android:id="@+id/button6"
+ android:layout_column="0"
+ android:layout_gravity="left"
+ android:text="Button" >
+ </Button>
+
+ <Space
+ android:layout_column="3"
+ android:layout_gravity="fill_vertical"
+ android:layout_row="5" />
+
+</GridLayout> \ No newline at end of file
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a.info b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a.info
new file mode 100644
index 000000000..20a23b08d
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a.info
@@ -0,0 +1,13 @@
+android.widget.LinearLayout [0,36,240,320] <LinearLayout>
+ android.widget.Button [0,0,70,36] <Button>
+ android.widget.LinearLayout [0,36,240,72] <LinearLayout>
+ android.widget.Button [0,2,84,38] <Button>
+ android.widget.Button [84,2,158,38] <Button>
+ android.widget.CheckBox [158,0,238,36] <CheckBox>
+ android.widget.Button [0,72,240,108] <Button>
+ android.widget.LinearLayout [0,108,240,144] <LinearLayout>
+ android.widget.Button [0,0,71,36] <Button>
+ android.widget.LinearLayout [0,144,240,180] <LinearLayout>
+ android.widget.LinearLayout [0,0,49,36] <LinearLayout>
+ android.widget.LinearLayout [0,0,49,36] <LinearLayout>
+ android.widget.Button [0,0,49,36] <Button>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a.xml
new file mode 100644
index 000000000..9a9493592
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout android:id="@+id/LinearLayout2" xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical">
+ <Button android:text="FirstButton" android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
+ <LinearLayout android:layout_width="match_parent" android:id="@+id/linearLayout1" android:layout_height="wrap_content">
+ <Button android:text="SecondButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/button2"></Button>
+ <Button android:text="ThirdButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/button3"></Button>
+ <CheckBox android:id="@+id/checkBox1" android:text="CheckBox" android:layout_width="wrap_content" android:layout_height="wrap_content"></CheckBox>
+ </LinearLayout>
+ <Button android:layout_height="wrap_content" android:text="FourthButton" android:id="@+id/button4" android:layout_width="match_parent"></Button>
+ <LinearLayout android:layout_height="wrap_content" android:id="@+id/linearLayout3" android:layout_width="match_parent">
+ <Button android:layout_gravity="right" android:id="@+id/button5" android:text="FifthButton" android:layout_height="wrap_content" android:layout_width="wrap_content"></Button>
+ </LinearLayout>
+ <LinearLayout android:layout_height="wrap_content" android:id="@+id/linearLayout4" android:layout_width="match_parent">
+ <LinearLayout android:layout_height="match_parent" android:id="@+id/linearLayout5" android:layout_width="wrap_content">
+ <LinearLayout android:layout_height="match_parent" android:id="@+id/linearLayout6" android:layout_width="wrap_content">
+ <Button android:text="Button" android:id="@+id/button6" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
+ </LinearLayout>
+ </LinearLayout>
+ </LinearLayout>
+</LinearLayout>
+
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1b-expected-changeLayout1b.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1b-expected-changeLayout1b.xml
new file mode 100644
index 000000000..d03c92535
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1b-expected-changeLayout1b.xml
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/RelativeLayout1"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical" >
+
+ <Button
+ android:id="@+id/button1"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentLeft="true"
+ android:layout_alignParentTop="true"
+ android:text="FirstButton" >
+ </Button>
+
+ <Button
+ android:id="@+id/button2"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentLeft="true"
+ android:layout_below="@+id/button1"
+ android:layout_marginTop="2dp"
+ android:text="SecondButton" >
+ </Button>
+
+ <Button
+ android:id="@+id/button3"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignBaseline="@+id/button2"
+ android:layout_alignTop="@+id/button2"
+ android:layout_toRightOf="@+id/button2"
+ android:text="ThirdButton" >
+ </Button>
+
+ <CheckBox
+ android:id="@+id/checkBox1"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignBaseline="@+id/button2"
+ android:layout_below="@+id/button1"
+ android:layout_toRightOf="@+id/button3"
+ android:text="CheckBox" >
+ </CheckBox>
+
+ <Button
+ android:id="@+id/button4"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_alignParentLeft="true"
+ android:layout_below="@+id/checkBox1"
+ android:text="FourthButton" >
+ </Button>
+
+ <Button
+ android:id="@+id/button5"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentLeft="true"
+ android:layout_below="@+id/button4"
+ android:layout_gravity="right"
+ android:text="FifthButton" >
+ </Button>
+
+ <Button
+ android:id="@+id/button6"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentLeft="true"
+ android:layout_below="@+id/button5"
+ android:text="Button" >
+ </Button>
+
+</RelativeLayout> \ No newline at end of file
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1b.info b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1b.info
new file mode 100644
index 000000000..7807227c3
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1b.info
@@ -0,0 +1,14 @@
+android.widget.LinearLayout [0,36,240,320] <LinearLayout>
+ android.widget.Button [0,0,70,36] <Button>
+ android.widget.LinearLayout [0,36,240,72] <LinearLayout>
+ android.widget.Button [0,2,84,38] <Button>
+ android.widget.Button [84,2,158,38] <Button>
+ android.widget.CheckBox [158,0,238,36] <CheckBox>
+ android.widget.Button [0,72,240,108] <Button>
+ android.widget.LinearLayout [0,108,240,144] <LinearLayout>
+ android.widget.Button [0,0,71,36] <Button>
+ android.widget.LinearLayout [0,144,240,180] <LinearLayout>
+ android.widget.LinearLayout [0,0,49,36] <LinearLayout>
+ android.widget.LinearLayout [0,0,49,36] <LinearLayout>
+ android.widget.Button [0,0,49,36] <Button>
+
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1b.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1b.xml
new file mode 100644
index 000000000..6b800ae77
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1b.xml
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout
+ android:id="@+id/LinearLayout2"
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical">
+ <Button
+ android:text="FirstButton"
+ android:id="@+id/button1"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"></Button>
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:id="@+id/linearLayout1"
+ android:layout_height="wrap_content">
+ <Button
+ android:text="SecondButton"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:id="@+id/button2"></Button>
+ <Button
+ android:text="ThirdButton"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:id="@+id/button3"></Button>
+ <CheckBox
+ android:id="@+id/checkBox1"
+ android:text="CheckBox"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"></CheckBox>
+ </LinearLayout>
+ <Button
+ android:layout_height="wrap_content"
+ android:text="FourthButton"
+ android:id="@+id/button4"
+ android:layout_width="match_parent"></Button>
+ <LinearLayout
+ android:layout_height="wrap_content"
+ android:id="@+id/linearLayout3"
+ android:layout_width="match_parent">
+ <Button
+ android:layout_gravity="right"
+ android:id="@+id/button5"
+ android:text="FifthButton"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"></Button>
+ </LinearLayout>
+ <LinearLayout
+ android:layout_height="wrap_content"
+ android:id="@+id/linearLayout4"
+ android:layout_width="match_parent">
+ <LinearLayout
+ android:layout_height="match_parent"
+ android:id="@+id/linearLayout5"
+ android:layout_width="wrap_content">
+ <LinearLayout
+ android:layout_height="match_parent"
+ android:id="@+id/linearLayout6"
+ android:layout_width="wrap_content">
+ <Button
+ android:text="Button"
+ android:id="@+id/button6"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"></Button>
+ </LinearLayout>
+ </LinearLayout>
+ </LinearLayout>
+</LinearLayout>
+
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample2-expected-changeLayout2.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample2-expected-changeLayout2.xml
new file mode 100644
index 000000000..06420c483
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample2-expected-changeLayout2.xml
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/RelativeLayout1"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical" >
+
+ <Button
+ android:id="@+id/button1"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentLeft="true"
+ android:layout_alignParentTop="true"
+ android:text="Button" >
+ </Button>
+
+ <Button
+ android:id="@+id/button2"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentLeft="true"
+ android:layout_below="@+id/button1"
+ android:text="Button" >
+ </Button>
+
+ <Button
+ android:id="@+id/button3"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_below="@+id/button2"
+ android:layout_toRightOf="@+id/button2"
+ android:text="Button" >
+ </Button>
+
+ <Button
+ android:id="@+id/button4"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_below="@+id/button3"
+ android:layout_toRightOf="@+id/button3"
+ android:text="Button" >
+ </Button>
+
+ <CheckBox
+ android:id="@+id/checkBox1"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_below="@+id/button4"
+ android:layout_toLeftOf="@+id/button4"
+ android:text="CheckBox" >
+ </CheckBox>
+
+ <Button
+ android:id="@+id/button5"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentRight="true"
+ android:layout_alignTop="@+id/button2"
+ android:text="Button" >
+ </Button>
+
+</RelativeLayout> \ No newline at end of file
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample2-expected-changeView2.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample2-expected-changeView2.xml
new file mode 100644
index 000000000..366c8df70
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample2-expected-changeView2.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical">
+ <Button android:text="Button" android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
+ <RelativeLayout android:layout_height="match_parent" android:id="@+id/relativeLayout1" android:layout_width="match_parent">
+ <Button android:layout_width="wrap_content" android:layout_alignParentLeft="true" android:id="@+id/button2" android:layout_height="wrap_content" android:text="Button"></Button>
+ <ImageButton android:layout_width="wrap_content" android:id="@+id/ImageButton1" android:layout_below="@+id/button2" android:layout_height="wrap_content" android:text="Button" android:layout_toRightOf="@+id/button2"></ImageButton>
+ <Button android:layout_width="wrap_content" android:id="@+id/button4" android:layout_below="@+id/ImageButton1" android:layout_height="wrap_content" android:text="Button" android:layout_toRightOf="@+id/ImageButton1"></Button>
+ <CheckBox android:layout_width="wrap_content" android:layout_below="@+id/button4" android:id="@+id/checkBox1" android:layout_height="wrap_content" android:text="CheckBox" android:layout_toLeftOf="@+id/button4"></CheckBox>
+ <ImageButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Button" android:id="@+id/ImageButton2" android:layout_alignParentRight="true"></ImageButton>
+ </RelativeLayout>
+</LinearLayout>
+
+
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample2-expected-extract3.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample2-expected-extract3.xml
new file mode 100644
index 000000000..e4ff73166
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample2-expected-extract3.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical">
+ <Button android:text="Button" android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
+ <RelativeLayout android:layout_height="match_parent" android:id="@+id/relativeLayout1" android:layout_width="match_parent">
+ <Button android:layout_width="wrap_content" android:layout_alignParentLeft="true" android:id="@+id/button2" android:layout_height="wrap_content" android:text="Button"></Button>
+ <include layout="@layout/newlayout3" android:id="@+id/button3_ref" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/button2" android:layout_toRightOf="@+id/button2"/>
+ <Button android:layout_width="wrap_content" android:id="@+id/button4" android:layout_below="@+id/button3_ref" android:layout_height="wrap_content" android:text="Button" android:layout_toRightOf="@+id/button3_ref"></Button>
+ <CheckBox android:layout_width="wrap_content" android:layout_below="@+id/button4" android:id="@+id/checkBox1" android:layout_height="wrap_content" android:text="CheckBox" android:layout_toLeftOf="@+id/button4"></CheckBox>
+ <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Button" android:id="@+id/button5" android:layout_alignParentRight="true"></Button>
+ </RelativeLayout>
+</LinearLayout>
+
+
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample2-expected-gridLayout2.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample2-expected-gridLayout2.xml
new file mode 100644
index 000000000..8b9056216
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample2-expected-gridLayout2.xml
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="utf-8"?>
+<GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/GridLayout1"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:columnCount="6"
+ android:orientation="horizontal" >
+
+ <Button
+ android:id="@+id/button1"
+ android:layout_columnSpan="2"
+ android:layout_gravity="left"
+ android:text="Button" >
+ </Button>
+
+ <Button
+ android:id="@+id/button2"
+ android:layout_alignParentLeft="true"
+ android:layout_column="0"
+ android:layout_columnSpan="2"
+ android:layout_gravity="left"
+ android:text="Button" >
+ </Button>
+
+ <Button
+ android:id="@+id/button3"
+ android:layout_below="@+id/button2"
+ android:layout_gravity="left"
+ android:layout_row="2"
+ android:layout_toRightOf="@+id/button2"
+ android:text="Button" >
+ </Button>
+
+ <Button
+ android:id="@+id/button4"
+ android:layout_below="@+id/button3"
+ android:layout_gravity="left"
+ android:layout_row="3"
+ android:layout_toRightOf="@+id/button3"
+ android:text="Button" >
+ </Button>
+
+ <CheckBox
+ android:id="@+id/checkBox1"
+ android:layout_below="@+id/button4"
+ android:layout_column="1"
+ android:layout_columnSpan="2"
+ android:layout_gravity="left"
+ android:layout_toLeftOf="@+id/button4"
+ android:text="CheckBox" >
+ </CheckBox>
+
+ <Button
+ android:id="@+id/button5"
+ android:layout_alignParentRight="true"
+ android:layout_column="4"
+ android:layout_gravity="left"
+ android:layout_row="1"
+ android:text="Button" >
+ </Button>
+
+ <Space
+ android:layout_column="5"
+ android:layout_gravity="fill_vertical"
+ android:layout_row="5" />
+
+</GridLayout> \ No newline at end of file
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample2.info b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample2.info
new file mode 100644
index 000000000..44d3b626d
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample2.info
@@ -0,0 +1,9 @@
+android.widget.LinearLayout [0,36,240,320] <LinearLayout>
+ android.widget.Button [0,0,49,36] <Button>
+ android.widget.RelativeLayout [0,36,240,284] <RelativeLayout>
+ android.widget.Button [0,0,49,36] <Button>
+ android.widget.Button [49,36,98,72] <Button>
+ android.widget.Button [98,72,147,108] <Button>
+ android.widget.CheckBox [18,108,98,144] <CheckBox>
+ android.widget.Button [191,0,240,36] <Button>
+
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample2.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample2.xml
new file mode 100644
index 000000000..0697c645c
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample2.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical">
+ <Button android:text="Button" android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
+ <RelativeLayout android:layout_height="match_parent" android:id="@+id/relativeLayout1" android:layout_width="match_parent">
+ <Button android:layout_width="wrap_content" android:layout_alignParentLeft="true" android:id="@+id/button2" android:layout_height="wrap_content" android:text="Button"></Button>
+ <Button android:layout_width="wrap_content" android:id="@+id/button3" android:layout_below="@+id/button2" android:layout_height="wrap_content" android:text="Button" android:layout_toRightOf="@+id/button2"></Button>
+ <Button android:layout_width="wrap_content" android:id="@+id/button4" android:layout_below="@+id/button3" android:layout_height="wrap_content" android:text="Button" android:layout_toRightOf="@+id/button3"></Button>
+ <CheckBox android:layout_width="wrap_content" android:layout_below="@+id/button4" android:id="@+id/checkBox1" android:layout_height="wrap_content" android:text="CheckBox" android:layout_toLeftOf="@+id/button4"></CheckBox>
+ <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Button" android:id="@+id/button5" android:layout_alignParentRight="true"></Button>
+ </RelativeLayout>
+</LinearLayout>
+
+
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-expected-changeLayout3.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-expected-changeLayout3.xml
new file mode 100644
index 000000000..268688b83
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-expected-changeLayout3.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/newlinear"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical" >
+
+ <Button
+ android:id="@+id/button1"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentLeft="true"
+ android:layout_alignParentTop="true"
+ android:text="Button" >
+ </Button>
+
+ <ImageView
+ android:id="@+id/android_logo"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_above="@+id/button2"
+ android:layout_alignParentLeft="true"
+ android:layout_below="@+id/button1"
+ android:layout_weight="1.0"
+ android:clickable="false"
+ android:focusable="false"
+ android:src="@drawable/android_button" />
+
+ <Button
+ android:id="@+id/button2"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentBottom="true"
+ android:layout_alignParentLeft="true"
+ android:text="Button" >
+ </Button>
+
+</RelativeLayout> \ No newline at end of file
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-expected-extract1.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-expected-extract1.xml
new file mode 100644
index 000000000..70f576ed6
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-expected-extract1.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/newlinear" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent">
+ <Button android:text="Button" android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
+ <ImageView android:id="@+id/android_logo" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/android_button" android:focusable="false" android:clickable="false" android:layout_weight="1.0" />
+ <include layout="@layout/newlayout1" android:id="@+id/button2_ref" android:layout_width="wrap_content" android:layout_height="wrap_content"/>
+</LinearLayout>
+
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-expected-extract2.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-expected-extract2.xml
new file mode 100644
index 000000000..9a30a96b5
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-expected-extract2.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/newlinear" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent">
+ <Button android:text="Button" android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
+ <include layout="@layout/newlayout2" android:layout_width="wrap_content" android:layout_height="wrap_content"/>
+</LinearLayout>
+
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-expected-extract4.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-expected-extract4.xml
new file mode 100644
index 000000000..445f88ac0
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-expected-extract4.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/newlinear" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent">
+ <Button android:text="Button" android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
+ <include layout="@layout/newlayout3" android:id="@+id/android_logo_ref" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1.0"/>
+ <Button android:text="Button" android:id="@+id/button2" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
+</LinearLayout>
+
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-expected-extract5.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-expected-extract5.xml
new file mode 100644
index 000000000..8df41ca2e
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-expected-extract5.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/newlinear" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent">
+ <include layout="@layout/newlayout3" android:layout_width="wrap_content" android:layout_height="wrap_content"/>
+ <Button android:text="Button" android:id="@+id/button2" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
+</LinearLayout>
+
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-expected-wrapIn1.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-expected-wrapIn1.xml
new file mode 100644
index 000000000..097f87046
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-expected-wrapIn1.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/newlinear"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical" >
+
+ <Button
+ android:id="@+id/button1"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="Button" >
+ </Button>
+
+ <ImageView
+ android:id="@+id/android_logo"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_weight="1.0"
+ android:clickable="false"
+ android:focusable="false"
+ android:src="@drawable/android_button" />
+
+ <LinearLayout
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content" >
+
+ <Button
+ android:id="@+id/button2"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="Button" >
+ </Button>
+ </LinearLayout>
+
+</LinearLayout> \ No newline at end of file
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-expected-wrapIn2.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-expected-wrapIn2.xml
new file mode 100644
index 000000000..2921e40e7
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-expected-wrapIn2.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<android.gesture.GestureOverlayView xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent" >
+
+ <LinearLayout
+ android:id="@+id/newlinear"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical" >
+
+ <Button
+ android:id="@+id/button1"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="Button" >
+ </Button>
+
+ <ImageView
+ android:id="@+id/android_logo"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_weight="1.0"
+ android:clickable="false"
+ android:focusable="false"
+ android:src="@drawable/android_button" />
+
+ <Button
+ android:id="@+id/button2"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="Button" >
+ </Button>
+ </LinearLayout>
+
+</android.gesture.GestureOverlayView> \ No newline at end of file
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-expected-wrapIn3.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-expected-wrapIn3.xml
new file mode 100644
index 000000000..6b57216a6
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-expected-wrapIn3.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/newlinear"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical" >
+
+ <Button
+ android:id="@+id/button1"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="Button" >
+ </Button>
+
+ <LinearLayout
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content" >
+
+ <ImageView
+ android:id="@+id/android_logo"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_weight="1.0"
+ android:clickable="false"
+ android:focusable="false"
+ android:src="@drawable/android_button" />
+
+ <Button
+ android:id="@+id/button2"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="Button" >
+ </Button>
+ </LinearLayout>
+
+</LinearLayout> \ No newline at end of file
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-variation1-expected-extract4.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-variation1-expected-extract4.xml
new file mode 100644
index 000000000..d616269ab
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-variation1-expected-extract4.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/newlinear" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent">
+ <Button android:text="Button" android:id="@+id/button2" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
+ <LinearLayout android:id="@+id/newlinear2" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent">
+ <Button android:text="Button" android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
+ <include layout="@layout/newlayout3" android:id="@+id/android_logo_ref" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1.0"/>
+ </LinearLayout>
+</LinearLayout>
+
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-variation1-expected-extract5.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-variation1-expected-extract5.xml
new file mode 100644
index 000000000..b37e7bebb
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-variation1-expected-extract5.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/newlinear" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent">
+ <Button android:text="Button" android:id="@+id/button2" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
+ <LinearLayout android:id="@+id/newlinear2" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent">
+ <include layout="@layout/newlayout3" android:layout_width="wrap_content" android:layout_height="wrap_content"/>
+ </LinearLayout>
+</LinearLayout>
+
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-variation1.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-variation1.xml
new file mode 100644
index 000000000..9cf3c434a
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-variation1.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/newlinear" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent">
+ <Button android:text="Button" android:id="@+id/button2" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
+ <LinearLayout android:id="@+id/newlinear2" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent">
+ <Button android:text="Button" android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
+ <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/android_button"
+ android:focusable="false" android:clickable="false" android:layout_weight="1.0" android:id="@+id/android_logo" />
+ </LinearLayout>
+</LinearLayout>
+
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-variation2-expected-extract4.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-variation2-expected-extract4.xml
new file mode 100644
index 000000000..40676abd1
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-variation2-expected-extract4.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:customprefix="http://schemas.android.com/apk/res/android" customprefix:id="@+id/newlinear" customprefix:orientation="vertical" customprefix:layout_width="match_parent" customprefix:layout_height="match_parent">
+ <include layout="@layout/newlayout3" customprefix:id="@+id/android_logo_ref" customprefix:layout_width="wrap_content" customprefix:layout_height="wrap_content" customprefix:layout_weight="1.0"/>
+ <Button customprefix:text="Button" customprefix:id="@+id/button1" customprefix:layout_width="wrap_content" customprefix:layout_height="wrap_content"></Button>
+ <Button customprefix:text="Button" customprefix:id="@+id/button2" customprefix:layout_width="wrap_content" customprefix:layout_height="wrap_content"></Button>
+</LinearLayout>
+
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-variation2-expected-extract5.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-variation2-expected-extract5.xml
new file mode 100644
index 000000000..c51dc3797
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-variation2-expected-extract5.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:customprefix="http://schemas.android.com/apk/res/android" customprefix:id="@+id/newlinear" customprefix:orientation="vertical" customprefix:layout_width="match_parent" customprefix:layout_height="match_parent">
+ <include layout="@layout/newlayout3" customprefix:layout_width="wrap_content" customprefix:layout_height="wrap_content"/>
+ <Button customprefix:text="Button" customprefix:id="@+id/button2" customprefix:layout_width="wrap_content" customprefix:layout_height="wrap_content"></Button>
+</LinearLayout>
+
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-variation2.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-variation2.xml
new file mode 100644
index 000000000..48d479024
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3-variation2.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:customprefix="http://schemas.android.com/apk/res/android" customprefix:id="@+id/newlinear" customprefix:orientation="vertical" customprefix:layout_width="match_parent" customprefix:layout_height="match_parent">
+ <ImageView customprefix:id="@+id/android_logo" customprefix:layout_width="wrap_content"
+ customprefix:layout_height="wrap_content" customprefix:src="@drawable/android_button" customprefix:focusable="false" customprefix:clickable="false" customprefix:layout_weight="1.0" />
+ <Button customprefix:text="Button" customprefix:id="@+id/button1" customprefix:layout_width="wrap_content" customprefix:layout_height="wrap_content"></Button>
+ <Button customprefix:text="Button" customprefix:id="@+id/button2" customprefix:layout_width="wrap_content" customprefix:layout_height="wrap_content"></Button>
+</LinearLayout>
+
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3.info b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3.info
new file mode 100644
index 000000000..ef3324eb4
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3.info
@@ -0,0 +1,5 @@
+android.widget.LinearLayout [0,36,240,320] <LinearLayout>
+ android.widget.Button [0,0,49,36] <Button>
+ android.widget.ImageView [0,36,128,248] <ImageView>
+ android.widget.Button [0,248,49,284] <Button>
+
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3.xml
new file mode 100644
index 000000000..ddd136ce8
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample3.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/newlinear" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent">
+ <Button android:text="Button" android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
+ <ImageView android:id="@+id/android_logo" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/android_button" android:focusable="false" android:clickable="false" android:layout_weight="1.0" />
+ <Button android:text="Button" android:id="@+id/button2" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
+</LinearLayout>
+
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample4-expected-changeLayout4.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample4-expected-changeLayout4.xml
new file mode 100644
index 000000000..6e5552950
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample4-expected-changeLayout4.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/RelativeLayout1"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical" >
+
+ <CheckBox
+ android:id="@+id/checkBox1"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentLeft="true"
+ android:layout_alignParentTop="true"
+ android:text="CheckBox" >
+ </CheckBox>
+
+ <Button
+ android:id="@+id/button5"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentRight="true"
+ android:layout_below="@+id/checkBox1"
+ android:text="Button" >
+ </Button>
+
+</RelativeLayout> \ No newline at end of file
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample4.info b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample4.info
new file mode 100644
index 000000000..605c17793
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample4.info
@@ -0,0 +1,5 @@
+android.widget.LinearLayout [0,36,240,320] <LinearLayout>
+ android.widget.CheckBox [0,0,80,36] <CheckBox>
+ android.widget.RelativeLayout [0,36,240,284] <RelativeLayout>
+ android.widget.Button [191,0,240,36] <Button>
+
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample4.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample4.xml
new file mode 100644
index 000000000..a56f27294
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample4.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical">
+ <CheckBox android:text="CheckBox" android:id="@+id/checkBox1" android:layout_width="wrap_content" android:layout_height="wrap_content"></CheckBox>
+ <RelativeLayout android:layout_height="match_parent" android:id="@+id/relativeLayout1" android:layout_width="match_parent">
+ <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Button" android:id="@+id/button5" android:layout_alignParentRight="true"></Button>
+ </RelativeLayout>
+</LinearLayout>
+
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample5-expected-changeLayout5.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample5-expected-changeLayout5.xml
new file mode 100644
index 000000000..06b236dfb
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample5-expected-changeLayout5.xml
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/RelativeLayout1"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical" >
+
+ <Button
+ android:id="@+id/button1"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentTop="true"
+ android:layout_centerHorizontal="true"
+ android:layout_gravity="center_horizontal"
+ android:text="Button" >
+ </Button>
+
+ <Button
+ android:id="@+id/button2"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_below="@+id/button1"
+ android:layout_centerHorizontal="true"
+ android:layout_gravity="center"
+ android:text="Button" >
+ </Button>
+
+ <Button
+ android:id="@+id/button3"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentRight="true"
+ android:layout_below="@+id/button2"
+ android:layout_gravity="right"
+ android:text="Button" >
+ </Button>
+
+ <Button
+ android:id="@+id/button4"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentLeft="true"
+ android:layout_below="@+id/button3"
+ android:layout_gravity="center"
+ android:layout_marginTop="70dp"
+ android:text="Button" >
+ </Button>
+
+ <Button
+ android:id="@+id/button5"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignBaseline="@+id/button4"
+ android:layout_alignTop="@+id/button4"
+ android:layout_gravity="center_vertical"
+ android:layout_toRightOf="@+id/button4"
+ android:text="Button" >
+ </Button>
+
+ <Button
+ android:id="@+id/button6"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentBottom="true"
+ android:layout_gravity="bottom"
+ android:layout_toRightOf="@+id/button5"
+ android:text="Button" >
+ </Button>
+
+</RelativeLayout> \ No newline at end of file
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample5-expected-gridLayout5.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample5-expected-gridLayout5.xml
new file mode 100644
index 000000000..dd9f18cf2
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample5-expected-gridLayout5.xml
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="utf-8"?>
+<GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/GridLayout1"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:columnCount="4"
+ android:orientation="horizontal" >
+
+ <Button
+ android:id="@+id/button1"
+ android:layout_columnSpan="2"
+ android:layout_gravity="center_horizontal"
+ android:text="Button" >
+ </Button>
+
+ <Button
+ android:id="@+id/button2"
+ android:layout_columnSpan="2"
+ android:layout_gravity="center"
+ android:layout_row="1"
+ android:text="Button" >
+ </Button>
+
+ <Button
+ android:id="@+id/button3"
+ android:layout_column="2"
+ android:layout_columnSpan="2"
+ android:layout_gravity="right"
+ android:text="Button" >
+ </Button>
+
+ <Button
+ android:id="@+id/button4"
+ android:layout_gravity="center"
+ android:text="Button" >
+ </Button>
+
+ <Button
+ android:id="@+id/button5"
+ android:layout_columnSpan="2"
+ android:layout_gravity="center_vertical"
+ android:text="Button" >
+ </Button>
+
+ <Button
+ android:id="@+id/button6"
+ android:layout_gravity="bottom"
+ android:text="Button" >
+ </Button>
+
+</GridLayout> \ No newline at end of file
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample5.info b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample5.info
new file mode 100644
index 000000000..fce532ecd
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample5.info
@@ -0,0 +1,9 @@
+android.widget.LinearLayout [0,36,240,320] <LinearLayout>
+ android.widget.Button [95,0,144,36] <Button>
+ android.widget.Button [95,36,144,72] <Button>
+ android.widget.Button [191,72,240,108] <Button>
+ android.widget.LinearLayout [0,108,240,284] <LinearLayout>
+ android.widget.Button [0,70,49,106] <Button>
+ android.widget.Button [49,70,98,106] <Button>
+ android.widget.Button [98,140,147,176] <Button>
+
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample5.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample5.xml
new file mode 100644
index 000000000..afc19388d
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample5.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical">
+ <Button android:text="Button" android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal"></Button>
+ <Button android:text="Button" android:id="@+id/button2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center"></Button>
+ <Button android:text="Button" android:id="@+id/button3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="right"></Button>
+ <LinearLayout android:id="@+id/linearLayout1" android:layout_width="match_parent" android:layout_height="match_parent">
+ <Button android:layout_height="wrap_content" android:layout_gravity="center" android:text="Button" android:id="@+id/button4" android:layout_width="wrap_content"></Button>
+ <Button android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:text="Button" android:id="@+id/button5" android:layout_width="wrap_content"></Button>
+ <Button android:layout_height="wrap_content" android:text="Button" android:id="@+id/button6" android:layout_width="wrap_content" android:layout_gravity="bottom"></Button>
+ </LinearLayout>
+</LinearLayout>
+
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample6-expected-changeLayout6.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample6-expected-changeLayout6.xml
new file mode 100644
index 000000000..a91ad1e7b
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample6-expected-changeLayout6.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/RelativeLayout1"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:baselineAligned="true" >
+
+ <Button
+ android:id="@+id/button1"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignBaseline="@+id/button2"
+ android:layout_alignParentLeft="true"
+ android:layout_alignParentTop="true"
+ android:text="Button" >
+ </Button>
+
+ <RadioButton
+ android:id="@+id/radioButton1"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignBaseline="@+id/button2"
+ android:layout_alignParentTop="true"
+ android:layout_toRightOf="@+id/button1"
+ android:text="RadioButton" >
+ </RadioButton>
+
+ <Button
+ android:id="@+id/button2"
+ android:layout_width="wrap_content"
+ android:layout_height="150dip"
+ android:layout_alignParentTop="true"
+ android:layout_toRightOf="@+id/radioButton1"
+ android:text="Button" >
+ </Button>
+
+</RelativeLayout> \ No newline at end of file
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample6.info b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample6.info
new file mode 100644
index 000000000..7a7a44ab5
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample6.info
@@ -0,0 +1,5 @@
+android.widget.LinearLayout [0,36,240,320] <LinearLayout>
+ android.widget.Button [0,38,49,74] <Button>
+ android.widget.RadioButton [49,36,143,72] <RadioButton>
+ android.widget.Button [143,0,192,113] <Button>
+
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample6.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample6.xml
new file mode 100644
index 000000000..5cdc82493
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample6.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/LinearLayout1" android:layout_width="match_parent" android:layout_height="match_parent" android:baselineAligned="true">
+ <Button android:text="Button" android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
+ <RadioButton android:text="RadioButton" android:id="@+id/radioButton1" android:layout_width="wrap_content" android:layout_height="wrap_content"></RadioButton>
+ <Button android:layout_width="wrap_content" android:id="@+id/button2" android:text="Button" android:layout_height="150dip"></Button>
+</LinearLayout>
+
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample7-expected-extract6.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample7-expected-extract6.diff
new file mode 100644
index 000000000..8a01599a6
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample7-expected-extract6.diff
@@ -0,0 +1,10 @@
+@@ -4 +4
+- <LinearLayout android:layout_height="wrap_content" android:id="@+id/linearLayout4" android:layout_width="match_parent">
+- <LinearLayout android:layout_height="match_parent" android:id="@+id/linearLayout5" android:layout_width="wrap_content">
+- <LinearLayout android:layout_height="match_parent" android:id="@+id/linearLayout6" android:layout_width="wrap_content">
+- <!-- Comment -->
+- <Button android:text="Button" android:id="@+id/button6" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
+- </LinearLayout>
+- </LinearLayout>
+- </LinearLayout>
++ <include layout="@layout/newlayout6" android:id="@+id/linearLayout4_ref" android:layout_width="match_parent" android:layout_height="wrap_content"/>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample7-expected-extract7.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample7-expected-extract7.diff
new file mode 100644
index 000000000..3de135d77
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample7-expected-extract7.diff
@@ -0,0 +1,69 @@
+@@ -2 +2
+- <LinearLayout android:id="@+id/LinearLayout2" xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical">
+- <Button android:text="FirstButton" android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
+- <LinearLayout android:layout_height="wrap_content" android:id="@+id/linearLayout4" android:layout_width="match_parent">
+- <LinearLayout android:layout_height="match_parent" android:id="@+id/linearLayout5" android:layout_width="wrap_content">
+- <LinearLayout android:layout_height="match_parent" android:id="@+id/linearLayout6" android:layout_width="wrap_content">
+- <!-- Comment -->
+- <Button android:text="Button" android:id="@+id/button6" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
+- </LinearLayout>
+- </LinearLayout>
+- </LinearLayout>
+- <LinearLayout android:layout_width="match_parent" android:id="@+id/linearLayout9" android:layout_height="wrap_content">
+- <Button android:text="SecondButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/button2"></Button>
+- <Button android:text="ThirdButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/button3"></Button>
+- <CheckBox android:id="@+id/checkBox1" android:text="CheckBox" android:layout_width="wrap_content" android:layout_height="wrap_content"></CheckBox>
++ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
++ android:id="@+id/LinearLayout2"
++ android:layout_width="match_parent"
++ android:layout_height="match_parent"
++ android:orientation="vertical" >
++
++ <Button
++ android:id="@+id/button1"
++ android:layout_width="wrap_content"
++ android:layout_height="wrap_content"
++ android:text="FirstButton" >
++ </Button>
++
++ <include
++ android:id="@+id/linearLayout4_ref"
++ android:layout_width="match_parent"
++ android:layout_height="wrap_content"
++ layout="@layout/newlayout6" />
++
++ <LinearLayout
++ android:id="@+id/linearLayout9"
++ android:layout_width="match_parent"
++ android:layout_height="wrap_content" >
++
++ <Button
++ android:id="@+id/button2"
++ android:layout_width="wrap_content"
++ android:layout_height="wrap_content"
++ android:text="SecondButton" >
++ </Button>
++
++ <Button
++ android:id="@+id/button3"
++ android:layout_width="wrap_content"
++ android:layout_height="wrap_content"
++ android:text="ThirdButton" >
++ </Button>
++
++ <CheckBox
++ android:id="@+id/checkBox1"
++ android:layout_width="wrap_content"
++ android:layout_height="wrap_content"
++ android:text="CheckBox" >
++ </CheckBox>
+@@ -17 +47
+- <Button android:layout_height="wrap_content" android:text="FourthButton" android:id="@+id/button4" android:layout_width="match_parent"></Button>
++
++ <Button
++ android:id="@+id/button4"
++ android:layout_width="match_parent"
++ android:layout_height="wrap_content"
++ android:text="FourthButton" >
++ </Button>
++
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample7.info b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample7.info
new file mode 100644
index 000000000..134234c44
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample7.info
@@ -0,0 +1,11 @@
+android.widget.LinearLayout [0,0,240,320] <LinearLayout>
+ android.widget.Button [0,0,101,36] <Button>
+ android.widget.LinearLayout [0,36,240,72] <LinearLayout>
+ android.widget.LinearLayout [0,0,73,36] <LinearLayout>
+ android.widget.LinearLayout [0,0,73,36] <LinearLayout>
+ android.widget.Button [0,0,73,36] <Button>
+ android.widget.LinearLayout [0,72,240,192] <LinearLayout>
+ android.widget.Button [0,0,117,36] <Button>
+ android.widget.Button [117,0,223,36] <Button>
+ android.widget.CheckBox [223,10,240,130] <CheckBox>
+ android.widget.Button [0,192,240,228] <Button>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample7.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample7.xml
new file mode 100644
index 000000000..0445bbf8f
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample7.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout android:id="@+id/LinearLayout2" xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical">
+ <Button android:text="FirstButton" android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
+ <LinearLayout android:layout_height="wrap_content" android:id="@+id/linearLayout4" android:layout_width="match_parent">
+ <LinearLayout android:layout_height="match_parent" android:id="@+id/linearLayout5" android:layout_width="wrap_content">
+ <LinearLayout android:layout_height="match_parent" android:id="@+id/linearLayout6" android:layout_width="wrap_content">
+ <!-- Comment -->
+ <Button android:text="Button" android:id="@+id/button6" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
+ </LinearLayout>
+ </LinearLayout>
+ </LinearLayout>
+ <LinearLayout android:layout_width="match_parent" android:id="@+id/linearLayout9" android:layout_height="wrap_content">
+ <Button android:text="SecondButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/button2"></Button>
+ <Button android:text="ThirdButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/button3"></Button>
+ <CheckBox android:id="@+id/checkBox1" android:text="CheckBox" android:layout_width="wrap_content" android:layout_height="wrap_content"></CheckBox>
+ </LinearLayout>
+ <Button android:layout_height="wrap_content" android:text="FourthButton" android:id="@+id/button4" android:layout_width="match_parent"></Button>
+</LinearLayout>
+
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample8-expected-extract6.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample8-expected-extract6.diff
new file mode 100644
index 000000000..ea3afc2e3
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample8-expected-extract6.diff
@@ -0,0 +1,15 @@
+@@ -10 +10
+- <LinearLayout android:layout_height="wrap_content"
+- android:id="@+id/linearLayout4" android:layout_width="match_parent">
+- <LinearLayout android:layout_height="match_parent"
+- android:layout_width="wrap_content" android:id="@+id/linearLayout5">
+- <LinearLayout android:layout_height="match_parent"
+- android:id="@+id/linearLayout6"
+- android:layout_width="wrap_content">
+- <Button android:text="Button" android:id="@+id/button6"
+- android:layout_width="wrap_content"
+- android:layout_height="wrap_content"></Button>
+- </LinearLayout>
+- </LinearLayout>
+- </LinearLayout>
++ <include layout="@layout/newlayout6" android:id="@+id/linearLayout4_ref" android:layout_width="match_parent" android:layout_height="wrap_content"/>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample8-expected-extract7.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample8-expected-extract7.diff
new file mode 100644
index 000000000..8228b597e
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample8-expected-extract7.diff
@@ -0,0 +1,85 @@
+@@ -2 +2
+- <LinearLayout android:id="@+id/LinearLayout2"
+- xmlns:android="http://schemas.android.com/apk/res/android"
+- android:layout_width="match_parent" android:layout_height="match_parent"
+- android:orientation="vertical">
+- <Button android:text="FirstButton" android:id="@+id/button1"
+- android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
+- <FrameLayout android:id="@+id/outer"
+- android:layout_width="match_parent" android:layout_height="wrap_content">
+- <LinearLayout android:layout_height="wrap_content"
+- android:id="@+id/linearLayout4" android:layout_width="match_parent">
+- <LinearLayout android:layout_height="match_parent"
+- android:layout_width="wrap_content" android:id="@+id/linearLayout5">
+- <LinearLayout android:layout_height="match_parent"
+- android:id="@+id/linearLayout6"
+- android:layout_width="wrap_content">
+- <Button android:text="Button" android:id="@+id/button6"
+- android:layout_width="wrap_content"
+- android:layout_height="wrap_content"></Button>
+- </LinearLayout>
+- </LinearLayout>
+- </LinearLayout>
++ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
++ android:id="@+id/LinearLayout2"
++ android:layout_width="match_parent"
++ android:layout_height="match_parent"
++ android:orientation="vertical" >
++
++ <Button
++ android:id="@+id/button1"
++ android:layout_width="wrap_content"
++ android:layout_height="wrap_content"
++ android:text="FirstButton" >
++ </Button>
++
++ <FrameLayout
++ android:id="@+id/outer"
++ android:layout_width="match_parent"
++ android:layout_height="wrap_content" >
++
++ <include
++ android:id="@+id/linearLayout4_ref"
++ android:layout_width="match_parent"
++ android:layout_height="wrap_content"
++ layout="@layout/newlayout6" />
+@@ -24 +26
+- <FrameLayout android:id="@+id/outer"
+- android:layout_width="match_parent" android:layout_height="wrap_content">
+- <LinearLayout android:layout_height="wrap_content"
+- android:id="@+id/linearLayout4" android:layout_width="match_parent">
+- <LinearLayout android:layout_height="match_parent"
+- android:layout_width="wrap_content" android:id="@+id/linearLayout5">
+- <LinearLayout android:layout_height="match_parent"
++
++ <FrameLayout
++ android:id="@+id/outer"
++ android:layout_width="match_parent"
++ android:layout_height="wrap_content" >
++
++ <LinearLayout
++ android:id="@+id/linearLayout4"
++ android:layout_width="match_parent"
++ android:layout_height="wrap_content" >
++
++ <LinearLayout
++ android:id="@+id/linearLayout5"
++ android:layout_width="wrap_content"
++ android:layout_height="match_parent" >
++
++ <LinearLayout
+@@ -32 +44
+- android:layout_width="wrap_content">
+- <Button android:text="Button" android:id="@+id/button6"
++ android:layout_width="wrap_content"
++ android:layout_height="match_parent" >
++
++ <Button
++ android:id="@+id/button6"
+@@ -35 +50
+- android:layout_height="wrap_content"></Button>
++ android:layout_height="wrap_content"
++ android:text="Button" >
++ </Button>
+@@ -40 +57
++
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample8.info b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample8.info
new file mode 100644
index 000000000..ca294ba10
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample8.info
@@ -0,0 +1,12 @@
+android.widget.LinearLayout [0,0,240,320] <LinearLayout>
+ android.widget.Button [0,0,101,36] <Button>
+ android.widget.FrameLayout [0,36,240,72] <FrameLayout>
+ android.widget.LinearLayout [0,0,240,36] <LinearLayout>
+ android.widget.LinearLayout [0,0,73,36] <LinearLayout>
+ android.widget.LinearLayout [0,0,73,36] <LinearLayout>
+ android.widget.Button [0,0,73,36] <Button>
+ android.widget.FrameLayout [0,72,240,108] <FrameLayout>
+ android.widget.LinearLayout [0,0,240,36] <LinearLayout>
+ android.widget.LinearLayout [0,0,73,36] <LinearLayout>
+ android.widget.LinearLayout [0,0,73,36] <LinearLayout>
+ android.widget.Button [0,0,73,36] <Button>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample8.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample8.xml
new file mode 100644
index 000000000..c7984692e
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample8.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout android:id="@+id/LinearLayout2"
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent" android:layout_height="match_parent"
+ android:orientation="vertical">
+ <Button android:text="FirstButton" android:id="@+id/button1"
+ android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
+ <FrameLayout android:id="@+id/outer"
+ android:layout_width="match_parent" android:layout_height="wrap_content">
+ <LinearLayout android:layout_height="wrap_content"
+ android:id="@+id/linearLayout4" android:layout_width="match_parent">
+ <LinearLayout android:layout_height="match_parent"
+ android:layout_width="wrap_content" android:id="@+id/linearLayout5">
+ <LinearLayout android:layout_height="match_parent"
+ android:id="@+id/linearLayout6"
+ android:layout_width="wrap_content">
+ <Button android:text="Button" android:id="@+id/button6"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"></Button>
+ </LinearLayout>
+ </LinearLayout>
+ </LinearLayout>
+ </FrameLayout>
+ <FrameLayout android:id="@+id/outer"
+ android:layout_width="match_parent" android:layout_height="wrap_content">
+ <LinearLayout android:layout_height="wrap_content"
+ android:id="@+id/linearLayout4" android:layout_width="match_parent">
+ <LinearLayout android:layout_height="match_parent"
+ android:layout_width="wrap_content" android:id="@+id/linearLayout5">
+ <LinearLayout android:layout_height="match_parent"
+ android:id="@+id/linearLayout6"
+ android:layout_width="wrap_content">
+ <Button android:text="Button" android:id="@+id/button6"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"></Button>
+ </LinearLayout>
+ </LinearLayout>
+ </LinearLayout>
+ </FrameLayout>
+</LinearLayout>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample9-expected-convertToGrid.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample9-expected-convertToGrid.xml
new file mode 100644
index 000000000..03ffac714
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample9-expected-convertToGrid.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="utf-8"?>
+<GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/GridLayout1"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:columnCount="3"
+ android:orientation="horizontal" >
+
+ <Button
+ android:id="@+id/button1"
+ android:layout_gravity="left"
+ android:text="Button" />
+
+ <RadioButton
+ android:id="@+id/radioButton1"
+ android:layout_width="150dp"
+ android:layout_column="0"
+ android:layout_gravity="left"
+ android:text="RadioButton" />
+
+ <RadioButton
+ android:id="@+id/radioButton2"
+ android:layout_gravity="left"
+ android:text="RadioButton" />
+
+ <CheckBox
+ android:id="@+id/checkBox1"
+ android:layout_column="0"
+ android:layout_gravity="left"
+ android:text="CheckBox" />
+
+ <Space
+ android:layout_column="2"
+ android:layout_gravity="fill_vertical"
+ android:layout_row="3" />
+
+</GridLayout> \ No newline at end of file
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample9.info b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample9.info
new file mode 100644
index 000000000..3085ff074
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample9.info
@@ -0,0 +1,6 @@
+android.widget.LinearLayout [0,73,320,480] <LinearLayout>
+ android.widget.Button [0,0,79,48] <Button>
+ android.widget.LinearLayout [0,48,320,86] <LinearLayout>
+ android.widget.RadioButton [0,0,150,38] <RadioButton>
+ android.widget.RadioButton [150,0,273,38] <RadioButton>
+ android.widget.CheckBox [0,86,107,124] <CheckBox>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample9.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample9.xml
new file mode 100644
index 000000000..13068e763
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample9.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/LinearLayout1"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical" >
+
+ <Button
+ android:id="@+id/button1"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="Button" />
+
+ <LinearLayout
+ android:id="@+id/linearLayout2"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content" >
+
+ <RadioButton
+ android:id="@+id/radioButton1"
+ android:layout_width="150dp"
+ android:layout_height="wrap_content"
+ android:text="RadioButton" />
+
+ <RadioButton
+ android:id="@+id/radioButton2"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="RadioButton" />
+
+ </LinearLayout>
+
+ <CheckBox
+ android:id="@+id/checkBox1"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="CheckBox" />
+
+</LinearLayout>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/unwrap-expected-unwrap1.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/unwrap-expected-unwrap1.xml
new file mode 100644
index 000000000..e5aba11bb
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/unwrap-expected-unwrap1.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/linear"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical" >
+
+ <TextView
+ android:id="@+id/text"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/hello" />
+
+ <Button
+ android:id="@+id/button"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/hello" />
+
+</LinearLayout> \ No newline at end of file
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/unwrap-expected-unwrap2.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/unwrap-expected-unwrap2.xml
new file mode 100644
index 000000000..e5aba11bb
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/unwrap-expected-unwrap2.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/linear"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical" >
+
+ <TextView
+ android:id="@+id/text"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/hello" />
+
+ <Button
+ android:id="@+id/button"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/hello" />
+
+</LinearLayout> \ No newline at end of file
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/unwrap-expected-unwrap3.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/unwrap-expected-unwrap3.xml
new file mode 100644
index 000000000..348b2bc81
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/unwrap-expected-unwrap3.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/frame"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content" >
+
+ <TextView
+ android:id="@+id/text"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/hello" />
+
+ <Button
+ android:id="@+id/button"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/hello" />
+
+</FrameLayout> \ No newline at end of file
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/unwrap.info b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/unwrap.info
new file mode 100644
index 000000000..c5461b399
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/unwrap.info
@@ -0,0 +1,4 @@
+android.widget.LinearLayout [0,56,1280,104] <LinearLayout>
+ android.widget.FrameLayout [0,0,1280,48] <FrameLayout>
+ android.widget.TextView [0,0,1280,17] <TextView>
+ android.widget.Button [0,0,1280,48] <Button>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/unwrap.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/unwrap.xml
new file mode 100644
index 000000000..db94dc358
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/unwrap.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/linear"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical" >
+
+ <FrameLayout
+ android:id="@+id/frame"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content" >
+
+ <TextView
+ android:id="@+id/text"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/hello" />
+
+ <Button
+ android:id="@+id/button"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/hello" />
+ </FrameLayout>
+
+</LinearLayout>