OSDN Git Service

Refactoring quick fix adjustments to caret and selection handling. DO NOT MERGE
authorTor Norbye <tnorbye@google.com>
Fri, 30 Sep 2011 18:45:26 +0000 (11:45 -0700)
committerTor Norbye <tnorbye@google.com>
Sat, 1 Oct 2011 04:25:58 +0000 (21:25 -0700)
commit390b825e915b0c37825d2f3941197bd3abe3394b
tree1a6be8a5d27a8a3878fa0dea95d908a250fd4b7a
parent8f2b9fbd5f8f298a05f09e0b523c4824e5da0e29
Refactoring quick fix adjustments to caret and selection handling. DO NOT MERGE

This changeset changes the logic in the refactoring quickfix (which
adds the Android refactorings based on the current caret position,
lexical context and selection).

It now allows some of the refactorings to be run when there is a
selection (this fixes "20393: Extract string functionality in Android
XML files"), and it makes other refactorings work when there is no
selection (it implicitly selects the surrounding element).

It also ensures that the Extract Style refactoring won't be listed at
the top if the attribute under the cursor is not a stylable attribute,
and it makes some other adjustments to the proposal order.

Change-Id: I1ca305d9c66ae4eb6cd9a4f45f6803bb2444abdb
eclipse/dictionary.txt
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ExtractStyleRefactoring.java
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/RefactoringAssistant.java
eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/RefactoringAssistantTest.java
eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-assistant2.txt
eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-assistant3.txt
eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-assistant4.txt