OSDN Git Service

Refactoring quick fix adjustments to caret and selection handling
authorTor Norbye <tnorbye@google.com>
Fri, 30 Sep 2011 18:45:26 +0000 (11:45 -0700)
committerTor Norbye <tnorbye@google.com>
Fri, 30 Sep 2011 22:56:58 +0000 (15:56 -0700)
commitbf09c5651e2ade9738670ff69377824a40d4c79c
tree826a6ba1a8a669e41985a328285446c0f076d8ce
parent58add15e93f9aa2a339ed5923538721f43f6fa3d
Refactoring quick fix adjustments to caret and selection handling

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: I0714bb652032aa19e6c2502dc1af7bb5e4adf308
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