History log of /sdk/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/refactorings/core/RenameResourceXmlTextActionTest.java
Revision Date Author Comments
6ecbb8e46bcb264b08aafa8c5c1f4692578170ed 21-Sep-2013 Tor Norbye <tnorbye@google.com> Use the new ResourceUrl API in sdk-common

Change-Id: I50154323e4db659d0d29753076bae805c7fc6c7d
8cf21be14c49245cb4bc967e81d8d7bc798179b7 07-Dec-2012 Tor Norbye <tnorbye@google.com> Refactoring fixes

This CL contains a couple of tweaks to the
refactoring support. First, update <declare-styleable>
declarations for renamed custom views. Second, update
XML in downstream projects from library projects.
Third, allow invoking the rename refactoring from XML
files from class attributes and custom view tags as well
(until now it applied only to resource names.)
Finally, update unit test golden file format to include
whether each change is enabled, and tweak the code to
disable R class changes to handle some additional
scenarios.

Change-Id: I74ccbe1b0f15ec10429f8dda7674f51f9a6f83cd
a96737ef1ee717e322c87a8ef391440b2aaf03b6 09-Nov-2012 Tor Norbye <tnorbye@google.com> Add resource renaming support

This changeset adds support for renaming resources.

There are several new hooks for initiating a resource rename:

(1) You can use the same keybinding as in Java files from XML files to
initiate refactoring; for example, place the caret somewhere in
@+id/foo or @string/bar and hit the refactoring keybinding, and a
rename resource refactoring dialog shows up.

(2) Invoking Quick Assistant in an XML file (Ctrl/Cmd 1) will offer to
rename the resource, if the caret is over a resource name.

(3) Renaming an XML or bitmap resource file, such as
res/drawable-hdpi/foo.png, will now initiate the same XML resource
naming machinery as above to update all resource references, plus
it will also update all the other versions of the same file
(e.g. in res/drawable-mdpi, res/drawable-xhdpi, etc.). Assuming an
R field exists (e.g. the project has been built), it will also
optionally update all Java field references.

(4) Invoking renaming in the layout editor (via the rename keybinding,
or via the context menu, or via the property sheet's "..." button)
will also initiate id resource refactoring. Editing the id
directly in the inline editor for the id will pop up a dialog
asking whether to update references as well, along with a "Do not
ask again" checkbox.

(5) Finally, there is a renaming participant registered which will
discover whether an R field is renamed, so if you go and rename
R.layout.foo from Java, this will also kick in all of the above
machinery - renaming layout files, updating resource references,
etc.

If the renamed resource is in a library project, the refactoring
will also look at all the including projects and offer to update
references there as well.

Finally, this CL goes and fixes a few bugs in the existing refactoring
operations; in particular, making sure that they not only look at
files in layout/ but in all folder configurations containing layout
files. It also adds refactoring unit tests.

Change-Id: Ie88511a571b414fdc5be048e781fe29a34063cbf