OSDN Git Service

Fix Extract as Include refactoring for layout attributes
authorTor Norbye <tnorbye@google.com>
Wed, 12 Jan 2011 16:38:52 +0000 (08:38 -0800)
committerTor Norbye <tnorbye@google.com>
Sat, 15 Jan 2011 05:45:32 +0000 (21:45 -0800)
commit39a075d99f8bfb030cecaa9fd6b436331f67621c
treecc9064bc125f0ceafaff81a28fd8b73815f37df5
parent36e3d648bdada3818fc10a0753a2c6fb468d41ca
Fix Extract as Include refactoring for layout attributes

This changeset fixes several issues with the Extract As Include
operation:

1) Transfer all the layout_ attributes to the include
   itself. Generally the layout attributes are particular to the
   inclusion context, they are not shared among the different uses of
   the include. For example, in layout1, the include may be in a
   linear layout and have a layout weight, and in another layout the
   included may need relative layout attachments.

2) Generate a new id for the included tag itself

3) For any layout references to the old extracted id, use the include
   tag id instead

4) Generate the new layout in the same folder as the source of the
   extract operation, since it may depend on properties only defined
   there

Change-Id: I515a56fe07cc0ffc1b4fcb6eec8d3a10d383915e
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/LayoutConstants.java
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/RelativeLayoutRule.java
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/ExtractIncludeAction.java