History log of /sdk/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ChangeViewRefactoringTest.java
Revision Date Author Comments
12d4581faa6438941e65a9dc83213be34c6ca970 13-Sep-2012 Tor Norbye <tnorbye@google.com> Constants refactoring.

This changeset moves most constants into the SdkConstants
class, and gets rid of AndroidConstants and LintConstants.
It also migrates all non-ADT specific constants from
AdtConstants into SdkConstants. It furthermore moves various
other constants (such as those in XmlUtils and ValuesDescriptors)
into the constants class. It also fixes the modifier order
to be the canonical modifier order (JLS 8.x).

Finally, it removes redundancy and combines various constant
aliases such that we don't have both NAME_ATTR and ATTR_NAME
pointing to "name", etc.

Change-Id: Ifd1755016f62ce2dd80e5c76130d6de4b0e32161
e50549f54810c29bffc681e39d33158ab2a8f26e 10-Jan-2012 Raphael <raphael@google.com> ADT: Change LayoutEditor to use new editor delegates.

Change-Id: I5624d8f5c393a74a808d98e465f0ebc6db91d741
eacf5a536e29b366e6e2dcf6a80d86ad5241734c 15-Apr-2011 Tor Norbye <tnorbye@google.com> Make Extract Include search in all files

This changeset makes the "Extract Include" refactoring search not just
the configuration-variations of the layout it was invoked on, but it
will look for semantically identical XML fragments in all layouts in
the same project, and will offer to replace each one of them with the
new include.

Change-Id: I03abf9e285d416e91b45eec7e01f518ea8d017d9
d3a3c261ef762dc3fb8f573b27625b0ebc81d5c8 23-Mar-2011 Tor Norbye <tnorbye@google.com> Test infrastructure fixes

Add methods which allow a test case to specify that it needs a unique
project for the testcase (or even for each individual test
method). This allows tests which modify the project (such as the
quickfix-resource-creation tests) to not cause side effects that
affect other tests (e.g. resources created by the quickfix could show
up in code completion results by the code completion tests, which
meant the goldenfiles would have to either include them or exclude
them, which meant the tests must always be run together or never run
together.

The changeset also adds an environment variable pointing to the git
working copy allowing tests with no golden file to create the golden
files directly. This makes it easy to add new test cases; just write
the test scenarios, run them, which will fail all the tests but also
write out the expected golden files. Verify them and check them in and
running the tests again should pass if the output is stable.

Change-Id: I2e2789c00c84a31a9fbc603851879d8d83342ad3
9e6db060854d0e890190919a27a1846f50f69d1a 07-Mar-2011 Tor Norbye <tnorbye@google.com> Extract as Include support for configuration variations

First, add support for the "Extract as Include" refactoring to update
all identical code fragments in configuration variations of the same
file. For example, if you have a particular subtree of XML elements
in a file that you have then duplicated into say a landscape mode,
then applying the Extract as Include refactoring will locate the same
code fragment in both files, and replace *both* code fragments with an
include (and this is optional with a checkbox in the wizard
dialog). This only happens when the extracted code fragment is
"identical" in both files. The code fragments can vary in terms of XML
formatting and attribute order (and namespace prefix choice), but the
element hierarchy order, names, attributes defined and attribute
values must be identical.

Second, make fixes to the Change Layout and Change Widget Type
refactorings such that when the id of the converted element is
changed, then references to that id are updated as well.

Third, ensure that the refactorings are enabled even when there is no
text selection; in that case the refactoring will apply to the element
containing the caret.

Some test infrastructure improvements.

Change-Id: Idb4ba40f4217dba2b13881b3d06e269c80ba4b97
0757ce4af2764e4dd564acc0b1a013e910abc8da 18-Feb-2011 Tor Norbye <tnorbye@google.com> More refactoring work: Convert hierarchy, and change type

A lot of work on the "Change Layout" refactoring to improve conversion
to a Relative Layout. First, add a "Flatten Hierarchy" option which
can take an entire hierarchy of layout widgets and flatten it down to
a single top level RelativeLayout where the constraints attempt to
reflect the original layout. (This isn't always possible, since some
layout managers offer features not possible to express in
RelativeLayout, such as a LinearLayout with multiple different
weights) but it often works or is at least a good start. (This work
is ongoing, but since my changeset is getting large I want to check in
this snapshot since the functionality is better than what is in the
trunk.)

This changeset also adds a new refactoring: Change Widget Type. This
can be applied to a selection of elements, and it will convert the
widget type to the new target widget type. It will also remove any
attributes that are not valid for the new layout.

It also improves the wizards which display the possible target types.
For Change Widget Type, it will first offer "related" widgets, so for
an AnalogClock it will first offer Digital Clock, for a checkbox it
will offer a checked text view and a radio button, etc.

In addition, it will list Views and Layouts that it finds in any
library jars (except for the builtin Android ones), and any custom
view classes in the project.

There is also now some preliminary support for refactoring unit
tests. These tests must be run as Eclipse plugin tests, since they
utilize the XML model (and the XML model cannot be mocked). The test
infrastructure reads source XML files, applies the refactoring change
list to them, and diffs the output with the known expected output
(also stored as result XML files in the test project).

Finally, there are a number of fixes and improvements to the shared
refactoring code.

Change-Id: I0974653e530dfb4feb625e0eef8257c29d50614b