diff options
25 files changed, 196 insertions, 109 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/AbsoluteLayoutRule.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/AbsoluteLayoutRule.java index 708b67b..348d6cf 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/AbsoluteLayoutRule.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/AbsoluteLayoutRule.java @@ -16,6 +16,8 @@ package com.android.ide.common.layout; +import static com.android.ide.common.layout.LayoutConstants.ANDROID_URI; + import com.android.ide.common.api.DrawingStyle; import com.android.ide.common.api.DropFeedback; import com.android.ide.common.api.IDragElement; diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/BaseLayout.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/BaseLayout.java index 412e495..979a4a2 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/BaseLayout.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/BaseLayout.java @@ -16,17 +16,21 @@ package com.android.ide.common.layout; +import static com.android.ide.common.layout.LayoutConstants.ANDROID_URI; +import static com.android.ide.common.layout.LayoutConstants.ATTR_ID; +import static com.android.ide.common.layout.LayoutConstants.ATTR_TEXT; + import com.android.ide.common.api.DropFeedback; import com.android.ide.common.api.IAttributeInfo; +import com.android.ide.common.api.IAttributeInfo.Format; import com.android.ide.common.api.IClientRulesEngine; import com.android.ide.common.api.IDragElement; +import com.android.ide.common.api.IDragElement.IDragAttribute; import com.android.ide.common.api.IGraphics; import com.android.ide.common.api.INode; import com.android.ide.common.api.MenuAction; import com.android.ide.common.api.Point; import com.android.ide.common.api.Rect; -import com.android.ide.common.api.IAttributeInfo.Format; -import com.android.ide.common.api.IDragElement.IDragAttribute; import java.util.Arrays; import java.util.HashMap; diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/BaseView.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/BaseView.java index 92f0543..4bcf069 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/BaseView.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/BaseView.java @@ -16,6 +16,13 @@ package com.android.ide.common.layout; +import static com.android.ide.common.layout.LayoutConstants.ANDROID_URI; +import static com.android.ide.common.layout.LayoutConstants.ATTR_LAYOUT_HEIGHT; +import static com.android.ide.common.layout.LayoutConstants.ATTR_LAYOUT_WIDTH; +import static com.android.ide.common.layout.LayoutConstants.VALUE_FILL_PARENT; +import static com.android.ide.common.layout.LayoutConstants.VALUE_MATCH_PARENT; +import static com.android.ide.common.layout.LayoutConstants.VALUE_WRAP_CONTENT; + import com.android.ide.common.api.DropFeedback; import com.android.ide.common.api.IAttributeInfo; import com.android.ide.common.api.IClientRulesEngine; @@ -44,49 +51,6 @@ import java.util.Set; public class BaseView implements IViewRule { protected IClientRulesEngine mRulesEngine; - /** - * Namespace for the Android resource XML, i.e. - * "http://schemas.android.com/apk/res/android" - */ - public static String ANDROID_URI = "http://schemas.android.com/apk/res/android"; //$NON-NLS-1$ - - /** The fully qualified class name of an EditText view */ - public static final String FQCN_EDIT_TEXT = "android.widget.EditText"; //$NON-NLS-1$ - - /** The fully qualified class name of a LinearLayout view */ - public static final String FQCN_LINEAR_LAYOUT = "android.widget.LinearLayout"; //$NON-NLS-1$ - - /** The fully qualified class name of a FrameLayout view */ - public static final String FQCN_FRAME_LAYOUT = "android.widget.FrameLayout"; //$NON-NLS-1$ - - /** The fully qualified class name of a TableRow view */ - public static final String FQCN_TABLE_ROW = "android.widget.TableRow"; //$NON-NLS-1$ - - /** The fully qualified class name of a TabWidget view */ - public static final String FQCN_TAB_WIDGET = "android.widget.TabWidget"; //$NON-NLS-1$ - - // Some common Android layout attribute names used by the view rules. - // All these belong to the attribute namespace ANDROID_URI. - public static final String ATTR_ID = "id"; //$NON-NLS-1$ - - public static final String ATTR_TEXT = "text"; //$NON-NLS-1$ - - public static final String ATTR_LAYOUT_WIDTH = "layout_width"; //$NON-NLS-1$ - - public static final String ATTR_LAYOUT_HEIGHT = "layout_height"; //$NON-NLS-1$ - - public static final String ATTR_SRC = "src"; //$NON-NLS-1$ - - public static final String ATTR_LAYOUT_BELOW = "layout_below"; //$NON-NLS-1$ - - // Some common Android layout attribute values used by the view rules. - public static final String VALUE_FILL_PARENT = "fill_parent"; //$NON-NLS-1$ - - // like fill_parent for API 8 - public static final String VALUE_MATCH_PARENT = "match_parent"; //$NON-NLS-1$ - - public static final String VALUE_WRAP_CONTENT = "wrap_content"; //$NON-NLS-1$ - // Cache of attributes. Key is FQCN of a node mixed with its view hierarchy // parent. Values are a custom map as needed by getContextMenu. private Map<String, Map<String, Prop>> mAttributesMap = diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/DialerFilterRule.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/DialerFilterRule.java index 54b511e..311af84 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/DialerFilterRule.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/DialerFilterRule.java @@ -16,6 +16,14 @@ package com.android.ide.common.layout; +import static com.android.ide.common.layout.LayoutConstants.ANDROID_URI; +import static com.android.ide.common.layout.LayoutConstants.ATTR_ID; +import static com.android.ide.common.layout.LayoutConstants.ATTR_LAYOUT_BELOW; +import static com.android.ide.common.layout.LayoutConstants.ATTR_LAYOUT_WIDTH; +import static com.android.ide.common.layout.LayoutConstants.ATTR_TEXT; +import static com.android.ide.common.layout.LayoutConstants.FQCN_EDIT_TEXT; +import static com.android.ide.common.layout.LayoutConstants.VALUE_FILL_PARENT; + import com.android.ide.common.api.INode; import com.android.ide.common.api.IViewRule; import com.android.ide.common.api.InsertType; @@ -32,12 +40,12 @@ public class DialerFilterRule extends BaseView { // A DialerFilter requires a couple of nested EditTexts with fixed ids: if (insertType == InsertType.CREATE) { INode hint = node.appendChild(FQCN_EDIT_TEXT); - hint.setAttribute(ANDROID_URI, BaseView.ATTR_TEXT, "Hint"); + hint.setAttribute(ANDROID_URI, ATTR_TEXT, "Hint"); hint.setAttribute(ANDROID_URI, ATTR_ID, "@android:id/hint"); //$NON-NLS-1$ hint.setAttribute(ANDROID_URI, ATTR_LAYOUT_WIDTH, VALUE_FILL_PARENT); INode primary = node.appendChild(FQCN_EDIT_TEXT); - primary.setAttribute(ANDROID_URI, BaseView.ATTR_TEXT, "Primary"); + primary.setAttribute(ANDROID_URI, ATTR_TEXT, "Primary"); primary.setAttribute(ANDROID_URI, ATTR_ID, "@android:id/primary"); //$NON-NLS-1$ primary.setAttribute(ANDROID_URI, ATTR_LAYOUT_BELOW, "@android:id/hint"); //$NON-NLS-1$ diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/HorizontalScrollViewRule.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/HorizontalScrollViewRule.java index 547dc04..6ae6872 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/HorizontalScrollViewRule.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/HorizontalScrollViewRule.java @@ -16,6 +16,14 @@ package com.android.ide.common.layout; +import static com.android.ide.common.layout.LayoutConstants.ANDROID_URI; +import static com.android.ide.common.layout.LayoutConstants.ATTR_LAYOUT_HEIGHT; +import static com.android.ide.common.layout.LayoutConstants.ATTR_LAYOUT_WIDTH; +import static com.android.ide.common.layout.LayoutConstants.ATTR_ORIENTATION; +import static com.android.ide.common.layout.LayoutConstants.FQCN_LINEAR_LAYOUT; +import static com.android.ide.common.layout.LayoutConstants.VALUE_FILL_PARENT; +import static com.android.ide.common.layout.LayoutConstants.VALUE_HORIZONTAL; + import com.android.ide.common.api.INode; import com.android.ide.common.api.IViewRule; import com.android.ide.common.api.InsertType; @@ -42,8 +50,8 @@ public class HorizontalScrollViewRule extends BaseView { // Insert a horizontal linear layout which is commonly used with horizontal scrollbars // as described by the documentation for HorizontalScrollbars. INode linearLayout = node.appendChild(FQCN_LINEAR_LAYOUT); - linearLayout.setAttribute(ANDROID_URI, LinearLayoutRule.ATTR_ORIENTATION, - LinearLayoutRule.VALUE_HORIZONTAL); + linearLayout.setAttribute(ANDROID_URI, ATTR_ORIENTATION, + VALUE_HORIZONTAL); } } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/ImageButtonRule.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/ImageButtonRule.java index 7a23f17..9ea5dc2 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/ImageButtonRule.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/ImageButtonRule.java @@ -16,6 +16,9 @@ package com.android.ide.common.layout; +import static com.android.ide.common.layout.LayoutConstants.ANDROID_URI; +import static com.android.ide.common.layout.LayoutConstants.ATTR_SRC; + import com.android.ide.common.api.INode; import com.android.ide.common.api.IViewRule; import com.android.ide.common.api.InsertType; diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/ImageViewRule.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/ImageViewRule.java index 67cd422..9b1eac3 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/ImageViewRule.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/ImageViewRule.java @@ -16,6 +16,9 @@ package com.android.ide.common.layout; +import static com.android.ide.common.layout.LayoutConstants.ANDROID_URI; +import static com.android.ide.common.layout.LayoutConstants.ATTR_SRC; + import com.android.ide.common.api.INode; import com.android.ide.common.api.IViewRule; import com.android.ide.common.api.InsertType; diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/LayoutConstants.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/LayoutConstants.java index f662411..2a7f5f3 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/LayoutConstants.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/LayoutConstants.java @@ -14,8 +14,7 @@ * limitations under the License. */ -package com.android.ide.eclipse.adt.internal.editors.layout; - +package com.android.ide.common.layout; /** * A bunch of constants that map to either: @@ -26,7 +25,6 @@ package com.android.ide.eclipse.adt.internal.editors.layout; * </ul> */ public class LayoutConstants { - public static final String RELATIVE_LAYOUT = "RelativeLayout"; //$NON-NLS-1$ public static final String LINEAR_LAYOUT = "LinearLayout"; //$NON-NLS-1$ public static final String ABSOLUTE_LAYOUT = "AbsoluteLayout"; //$NON-NLS-1$ @@ -61,6 +59,36 @@ public class LayoutConstants { public static final String VALUE_TRUE = "true"; //$NON-NLS-1$ public static final String VALUE_N_DIP = "%ddip"; //$NON-NLS-1$ - private LayoutConstants() { - } + /** + * Namespace for the Android resource XML, i.e. + * "http://schemas.android.com/apk/res/android" + */ + public static String ANDROID_URI = "http://schemas.android.com/apk/res/android"; //$NON-NLS-1$ + + /** The fully qualified class name of an EditText view */ + public static final String FQCN_EDIT_TEXT = "android.widget.EditText"; //$NON-NLS-1$ + + /** The fully qualified class name of a LinearLayout view */ + public static final String FQCN_LINEAR_LAYOUT = "android.widget.LinearLayout"; //$NON-NLS-1$ + + /** The fully qualified class name of a FrameLayout view */ + public static final String FQCN_FRAME_LAYOUT = "android.widget.FrameLayout"; //$NON-NLS-1$ + + /** The fully qualified class name of a TableRow view */ + public static final String FQCN_TABLE_ROW = "android.widget.TableRow"; //$NON-NLS-1$ + + /** The fully qualified class name of a TabWidget view */ + public static final String FQCN_TAB_WIDGET = "android.widget.TabWidget"; //$NON-NLS-1$ + + public static final String ATTR_SRC = "src"; //$NON-NLS-1$ + + // like fill_parent for API 8 + public static final String VALUE_MATCH_PARENT = "match_parent"; //$NON-NLS-1$ + + public static String ATTR_ORIENTATION = "orientation"; //$NON-NLS-1$ + + public static String VALUE_HORIZONTAL = "horizontal"; //$NON-NLS-1$ + + public static String VALUE_VERTICAL = "vertical"; //$NON-NLS-1$ + } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/LinearLayoutRule.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/LinearLayoutRule.java index e31424c..77e6d54 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/LinearLayoutRule.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/LinearLayoutRule.java @@ -16,6 +16,14 @@ package com.android.ide.common.layout; +import static com.android.ide.common.layout.LayoutConstants.ANDROID_URI; +import static com.android.ide.common.layout.LayoutConstants.ATTR_LAYOUT_HEIGHT; +import static com.android.ide.common.layout.LayoutConstants.ATTR_LAYOUT_WIDTH; +import static com.android.ide.common.layout.LayoutConstants.ATTR_ORIENTATION; +import static com.android.ide.common.layout.LayoutConstants.VALUE_FILL_PARENT; +import static com.android.ide.common.layout.LayoutConstants.VALUE_HORIZONTAL; +import static com.android.ide.common.layout.LayoutConstants.VALUE_VERTICAL; + import com.android.ide.common.api.DrawingStyle; import com.android.ide.common.api.DropFeedback; import com.android.ide.common.api.IDragElement; @@ -25,12 +33,12 @@ import com.android.ide.common.api.IMenuCallback; import com.android.ide.common.api.INode; import com.android.ide.common.api.INodeHandler; import com.android.ide.common.api.IViewMetadata; +import com.android.ide.common.api.IViewMetadata.FillPreference; import com.android.ide.common.api.IViewRule; import com.android.ide.common.api.InsertType; import com.android.ide.common.api.MenuAction; import com.android.ide.common.api.Point; import com.android.ide.common.api.Rect; -import com.android.ide.common.api.IViewMetadata.FillPreference; import java.util.ArrayList; import java.util.List; @@ -41,10 +49,6 @@ import java.util.Map; * classes. */ public class LinearLayoutRule extends BaseLayout { - public static String ATTR_ORIENTATION = "orientation"; //$NON-NLS-1$ - public static String VALUE_HORIZONTAL = "horizontal"; //$NON-NLS-1$ - public static String VALUE_VERTICAL = "vertical"; //$NON-NLS-1$ - /** * Add an explicit Orientation toggle to the context menu. */ diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/ListViewRule.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/ListViewRule.java index 347057a..d3d226c 100755 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/ListViewRule.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/ListViewRule.java @@ -16,6 +16,10 @@ package com.android.ide.common.layout; +import static com.android.ide.common.layout.LayoutConstants.ANDROID_URI; +import static com.android.ide.common.layout.LayoutConstants.ATTR_LAYOUT_WIDTH; +import static com.android.ide.common.layout.LayoutConstants.VALUE_FILL_PARENT; + import com.android.ide.common.api.INode; import com.android.ide.common.api.IViewRule; import com.android.ide.common.api.InsertType; diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/MapViewRule.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/MapViewRule.java index 2eff369..b8ddedd 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/MapViewRule.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/MapViewRule.java @@ -16,6 +16,8 @@ package com.android.ide.common.layout; +import static com.android.ide.common.layout.LayoutConstants.ANDROID_URI; + import com.android.ide.common.api.INode; import com.android.ide.common.api.IViewRule; import com.android.ide.common.api.InsertType; diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/RelativeLayoutRule.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/RelativeLayoutRule.java index 96e6aa6..04629b2 100755 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/RelativeLayoutRule.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/RelativeLayoutRule.java @@ -16,19 +16,22 @@ package com.android.ide.common.layout; +import static com.android.ide.common.layout.LayoutConstants.ANDROID_URI; +import static com.android.ide.common.layout.LayoutConstants.ATTR_ID; + import com.android.ide.common.api.DrawingStyle; import com.android.ide.common.api.DropFeedback; import com.android.ide.common.api.IAttributeInfo; +import com.android.ide.common.api.IAttributeInfo.Format; import com.android.ide.common.api.IDragElement; import com.android.ide.common.api.IFeedbackPainter; import com.android.ide.common.api.IGraphics; import com.android.ide.common.api.INode; +import com.android.ide.common.api.INode.IAttribute; import com.android.ide.common.api.INodeHandler; import com.android.ide.common.api.IViewRule; import com.android.ide.common.api.Point; import com.android.ide.common.api.Rect; -import com.android.ide.common.api.IAttributeInfo.Format; -import com.android.ide.common.api.INode.IAttribute; import java.util.ArrayList; import java.util.Collections; diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/ScrollViewRule.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/ScrollViewRule.java index 5ce8bad..5324278 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/ScrollViewRule.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/ScrollViewRule.java @@ -16,6 +16,12 @@ package com.android.ide.common.layout; +import static com.android.ide.common.layout.LayoutConstants.ANDROID_URI; +import static com.android.ide.common.layout.LayoutConstants.ATTR_LAYOUT_HEIGHT; +import static com.android.ide.common.layout.LayoutConstants.ATTR_LAYOUT_WIDTH; +import static com.android.ide.common.layout.LayoutConstants.FQCN_LINEAR_LAYOUT; +import static com.android.ide.common.layout.LayoutConstants.VALUE_FILL_PARENT; + import com.android.ide.common.api.INode; import com.android.ide.common.api.IViewRule; import com.android.ide.common.api.InsertType; diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/SeekBarRule.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/SeekBarRule.java index b6d184f..727d231 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/SeekBarRule.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/SeekBarRule.java @@ -16,6 +16,10 @@ package com.android.ide.common.layout; +import static com.android.ide.common.layout.LayoutConstants.ANDROID_URI; +import static com.android.ide.common.layout.LayoutConstants.ATTR_LAYOUT_WIDTH; +import static com.android.ide.common.layout.LayoutConstants.VALUE_FILL_PARENT; + import com.android.ide.common.api.INode; import com.android.ide.common.api.IViewRule; import com.android.ide.common.api.InsertType; diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/TabHostRule.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/TabHostRule.java index f47da68..dc512bd 100755 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/TabHostRule.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/TabHostRule.java @@ -16,6 +16,18 @@ package com.android.ide.common.layout; +import static com.android.ide.common.layout.LayoutConstants.ANDROID_URI; +import static com.android.ide.common.layout.LayoutConstants.ATTR_ID; +import static com.android.ide.common.layout.LayoutConstants.ATTR_LAYOUT_HEIGHT; +import static com.android.ide.common.layout.LayoutConstants.ATTR_LAYOUT_WIDTH; +import static com.android.ide.common.layout.LayoutConstants.ATTR_ORIENTATION; +import static com.android.ide.common.layout.LayoutConstants.FQCN_FRAME_LAYOUT; +import static com.android.ide.common.layout.LayoutConstants.FQCN_LINEAR_LAYOUT; +import static com.android.ide.common.layout.LayoutConstants.FQCN_TAB_WIDGET; +import static com.android.ide.common.layout.LayoutConstants.VALUE_FILL_PARENT; +import static com.android.ide.common.layout.LayoutConstants.VALUE_VERTICAL; +import static com.android.ide.common.layout.LayoutConstants.VALUE_WRAP_CONTENT; + import com.android.ide.common.api.INode; import com.android.ide.common.api.IViewRule; import com.android.ide.common.api.InsertType; @@ -41,8 +53,8 @@ public class TabHostRule extends IgnoredLayoutRule { INode linear = node.appendChild(FQCN_LINEAR_LAYOUT); linear.setAttribute(ANDROID_URI, ATTR_LAYOUT_WIDTH, VALUE_FILL_PARENT); linear.setAttribute(ANDROID_URI, ATTR_LAYOUT_HEIGHT, VALUE_FILL_PARENT); - linear.setAttribute(ANDROID_URI, LinearLayoutRule.ATTR_ORIENTATION, - LinearLayoutRule.VALUE_VERTICAL); + linear.setAttribute(ANDROID_URI, ATTR_ORIENTATION, + VALUE_VERTICAL); INode tab = linear.appendChild(FQCN_TAB_WIDGET); tab.setAttribute(ANDROID_URI, ATTR_LAYOUT_WIDTH, VALUE_FILL_PARENT); diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/TableLayoutRule.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/TableLayoutRule.java index a5d772c..6ac670f 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/TableLayoutRule.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/TableLayoutRule.java @@ -15,6 +15,8 @@ */ package com.android.ide.common.layout; +import static com.android.ide.common.layout.LayoutConstants.FQCN_TABLE_ROW; + import com.android.ide.common.api.IMenuCallback; import com.android.ide.common.api.INode; import com.android.ide.common.api.IViewRule; diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/descriptors/DescriptorsUtils.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/descriptors/DescriptorsUtils.java index 0e1e8bd..09691b8 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/descriptors/DescriptorsUtils.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/descriptors/DescriptorsUtils.java @@ -16,10 +16,18 @@ package com.android.ide.eclipse.adt.internal.editors.descriptors; +import static com.android.ide.common.layout.LayoutConstants.ATTR_ID; +import static com.android.ide.common.layout.LayoutConstants.ATTR_LAYOUT_BELOW; +import static com.android.ide.common.layout.LayoutConstants.ATTR_LAYOUT_HEIGHT; +import static com.android.ide.common.layout.LayoutConstants.ATTR_LAYOUT_WIDTH; +import static com.android.ide.common.layout.LayoutConstants.ATTR_TEXT; +import static com.android.ide.common.layout.LayoutConstants.RELATIVE_LAYOUT; +import static com.android.ide.common.layout.LayoutConstants.VALUE_FILL_PARENT; +import static com.android.ide.common.layout.LayoutConstants.VALUE_WRAP_CONTENT; + import com.android.ide.common.api.IAttributeInfo.Format; import com.android.ide.common.resources.platform.AttributeInfo; import com.android.ide.eclipse.adt.AndroidConstants; -import com.android.ide.eclipse.adt.internal.editors.layout.LayoutConstants; import com.android.ide.eclipse.adt.internal.editors.uimodel.UiDocumentNode; import com.android.ide.eclipse.adt.internal.editors.uimodel.UiElementNode; import com.android.ide.eclipse.adt.internal.resources.ResourceType; @@ -30,8 +38,8 @@ import org.eclipse.swt.graphics.Image; import java.util.ArrayList; import java.util.HashSet; import java.util.Map; -import java.util.Set; import java.util.Map.Entry; +import java.util.Set; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -668,27 +676,27 @@ public final class DescriptorsUtils { boolean fill = ui_node.getDescriptor().hasChildren() && ui_node.getUiParent() instanceof UiDocumentNode; ui_node.setAttributeValue( - LayoutConstants.ATTR_LAYOUT_WIDTH, + ATTR_LAYOUT_WIDTH, SdkConstants.NS_RESOURCES, - fill ? LayoutConstants.VALUE_FILL_PARENT : LayoutConstants.VALUE_WRAP_CONTENT, + fill ? VALUE_FILL_PARENT : VALUE_WRAP_CONTENT, false /* override */); ui_node.setAttributeValue( - LayoutConstants.ATTR_LAYOUT_HEIGHT, + ATTR_LAYOUT_HEIGHT, SdkConstants.NS_RESOURCES, - fill ? LayoutConstants.VALUE_FILL_PARENT : LayoutConstants.VALUE_WRAP_CONTENT, + fill ? VALUE_FILL_PARENT : VALUE_WRAP_CONTENT, false /* override */); String widget_id = getFreeWidgetId(ui_node); if (widget_id != null) { ui_node.setAttributeValue( - LayoutConstants.ATTR_ID, + ATTR_ID, SdkConstants.NS_RESOURCES, widget_id, false /* override */); } ui_node.setAttributeValue( - LayoutConstants.ATTR_TEXT, + ATTR_TEXT, SdkConstants.NS_RESOURCES, widget_id, false /*override*/); @@ -697,14 +705,14 @@ public final class DescriptorsUtils { UiElementNode ui_parent = ui_node.getUiParent(); if (ui_parent != null && ui_parent.getDescriptor().getXmlLocalName().equals( - LayoutConstants.RELATIVE_LAYOUT)) { + RELATIVE_LAYOUT)) { UiElementNode ui_previous = ui_node.getUiPreviousSibling(); if (ui_previous != null) { - String id = ui_previous.getAttributeValue(LayoutConstants.ATTR_ID); + String id = ui_previous.getAttributeValue(ATTR_ID); if (id != null && id.length() > 0) { id = id.replace("@+", "@"); //$NON-NLS-1$ //$NON-NLS-2$ ui_node.setAttributeValue( - LayoutConstants.ATTR_LAYOUT_BELOW, + ATTR_LAYOUT_BELOW, SdkConstants.NS_RESOURCES, id, false /* override */); @@ -804,7 +812,7 @@ public final class DescriptorsUtils { params[2] = generated; } - String id = uiRoot.getAttributeValue(LayoutConstants.ATTR_ID); + String id = uiRoot.getAttributeValue(ATTR_ID); if (id != null) { id = id.replace("@+id/", ""); //$NON-NLS-1$ $NON-NLS-2$ id = id.replace("@id/", ""); //$NON-NLS-1$ $NON-NLS-2$ diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/PaletteComposite.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/PaletteComposite.java index 142d8eb..ba7b7b5 100755 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/PaletteComposite.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/PaletteComposite.java @@ -16,15 +16,19 @@ package com.android.ide.eclipse.adt.internal.editors.layout.gle2; +import static com.android.ide.common.layout.LayoutConstants.ANDROID_URI; +import static com.android.ide.common.layout.LayoutConstants.ATTR_LAYOUT_HEIGHT; +import static com.android.ide.common.layout.LayoutConstants.ATTR_LAYOUT_WIDTH; +import static com.android.ide.common.layout.LayoutConstants.ATTR_TEXT; +import static com.android.ide.common.layout.LayoutConstants.VALUE_WRAP_CONTENT; + import com.android.ide.common.api.InsertType; import com.android.ide.common.api.Rect; -import com.android.ide.common.layout.BaseView; import com.android.ide.common.layoutlib.LayoutLibrary; import com.android.ide.eclipse.adt.internal.editors.descriptors.DescriptorsUtils; import com.android.ide.eclipse.adt.internal.editors.descriptors.DocumentDescriptor; import com.android.ide.eclipse.adt.internal.editors.descriptors.ElementDescriptor; import com.android.ide.eclipse.adt.internal.editors.descriptors.XmlnsAttributeDescriptor; -import com.android.ide.eclipse.adt.internal.editors.layout.LayoutConstants; import com.android.ide.eclipse.adt.internal.editors.layout.LayoutEditor; import com.android.ide.eclipse.adt.internal.editors.layout.descriptors.LayoutDescriptors; import com.android.ide.eclipse.adt.internal.editors.layout.gre.NodeFactory; @@ -676,19 +680,19 @@ public class PaletteComposite extends Composite { // Set up a proper name space Attr attr = document.createAttributeNS(XmlnsAttributeDescriptor.XMLNS_URI, "xmlns:android"); //$NON-NLS-1$ - attr.setValue(BaseView.ANDROID_URI); + attr.setValue(ANDROID_URI); element.getAttributes().setNamedItemNS(attr); element.setAttributeNS(SdkConstants.NS_RESOURCES, - LayoutConstants.ATTR_LAYOUT_WIDTH, LayoutConstants.VALUE_WRAP_CONTENT); + ATTR_LAYOUT_WIDTH, VALUE_WRAP_CONTENT); element.setAttributeNS(SdkConstants.NS_RESOURCES, - LayoutConstants.ATTR_LAYOUT_HEIGHT, LayoutConstants.VALUE_WRAP_CONTENT); + ATTR_LAYOUT_HEIGHT, VALUE_WRAP_CONTENT); // This doesn't apply to all, but doesn't seem to cause harm and makes for a // better experience with text-oriented views like buttons and texts UiElementNode uiRoot = layoutEditor.getUiRootNode(); String text = DescriptorsUtils.getFreeWidgetId(uiRoot, viewName); - element.setAttributeNS(SdkConstants.NS_RESOURCES, LayoutConstants.ATTR_TEXT, text); + element.setAttributeNS(SdkConstants.NS_RESOURCES, ATTR_TEXT, text); document.appendChild(element); diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/AbsoluteLayoutRuleTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/AbsoluteLayoutRuleTest.java index ee2fcc7..a6d6384 100644 --- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/AbsoluteLayoutRuleTest.java +++ b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/AbsoluteLayoutRuleTest.java @@ -16,6 +16,8 @@ package com.android.ide.common.layout; +import static com.android.ide.common.layout.LayoutConstants.ANDROID_URI; + import com.android.ide.common.api.INode; import com.android.ide.common.api.Point; import com.android.ide.common.api.Rect; @@ -56,8 +58,8 @@ public class AbsoluteLayoutRuleTest extends LayoutTestBase { // Drop preview "useStyle(DROP_PREVIEW), drawRect(Rect[-22,-50,105,80])"); - assertEquals("-22dip", inserted.getStringAttr(BaseLayout.ANDROID_URI, "layout_x")); - assertEquals("-50dip", inserted.getStringAttr(BaseLayout.ANDROID_URI, "layout_y")); + assertEquals("-22dip", inserted.getStringAttr(ANDROID_URI, "layout_x")); + assertEquals("-50dip", inserted.getStringAttr(ANDROID_URI, "layout_y")); // Without drag bounds we should just draw guide lines instead inserted = dragInto(new Rect(0, 0, 0, 0), new Point(30, -10), 4, -1, @@ -66,8 +68,8 @@ public class AbsoluteLayoutRuleTest extends LayoutTestBase { "useStyle(GUIDELINE), drawLine(30,0,30,480), drawLine(0,-10,240,-10)", // Drop preview "useStyle(DROP_PREVIEW), drawLine(30,-10,240,-10), drawLine(30,-10,30,480)"); - assertEquals("30dip", inserted.getStringAttr(BaseLayout.ANDROID_URI, "layout_x")); - assertEquals("-10dip", inserted.getStringAttr(BaseLayout.ANDROID_URI, "layout_y")); + assertEquals("30dip", inserted.getStringAttr(ANDROID_URI, "layout_x")); + assertEquals("-10dip", inserted.getStringAttr(ANDROID_URI, "layout_y")); } } diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/BaseLayoutTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/BaseLayoutTest.java index 8ac6c58..7540e4e 100644 --- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/BaseLayoutTest.java +++ b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/BaseLayoutTest.java @@ -16,6 +16,9 @@ package com.android.ide.common.layout; +import static com.android.ide.common.layout.LayoutConstants.ANDROID_URI; +import static com.android.ide.common.layout.LayoutConstants.ATTR_ID; + import com.android.ide.common.api.IDragElement; import com.android.ide.common.api.INode; import com.android.ide.common.api.Rect; @@ -64,7 +67,7 @@ public class BaseLayoutTest extends LayoutTestBase { */ public final void testCollectIds2() { IDragElement[] elements = TestDragElement.create(TestDragElement.create( - "android.widget.Button", new Rect(0, 0, 100, 80)).set("myuri", BaseView.ATTR_ID, + "android.widget.Button", new Rect(0, 0, 100, 80)).set("myuri", ATTR_ID, "@+id/Button01")); Map<String, Pair<String, String>> idMap = new HashMap<String, Pair<String, String>>(); @@ -217,9 +220,9 @@ public class BaseLayoutTest extends LayoutTestBase { public final void testDefaultAttributeFilter() { assertEquals("true", BaseLayout.DEFAULT_ATTR_FILTER.replace("myuri", "layout_alignRight", "true")); - assertEquals(null, BaseLayout.DEFAULT_ATTR_FILTER.replace(BaseLayout.ANDROID_URI, + assertEquals(null, BaseLayout.DEFAULT_ATTR_FILTER.replace(ANDROID_URI, "layout_alignRight", "true")); - assertEquals("true", BaseLayout.DEFAULT_ATTR_FILTER.replace(BaseLayout.ANDROID_URI, + assertEquals("true", BaseLayout.DEFAULT_ATTR_FILTER.replace(ANDROID_URI, "myproperty", "true")); } diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/LayoutTestBase.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/LayoutTestBase.java index be3c196..d6161b1 100644 --- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/LayoutTestBase.java +++ b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/LayoutTestBase.java @@ -16,6 +16,8 @@ package com.android.ide.common.layout; +import static com.android.ide.common.layout.LayoutConstants.ANDROID_URI; +import static com.android.ide.common.layout.LayoutConstants.ATTR_ID; import com.android.ide.common.api.DropFeedback; import com.android.ide.common.api.IDragElement; @@ -35,9 +37,6 @@ import junit.framework.TestCase; * Common layout helpers from LayoutRule tests */ public abstract class LayoutTestBase extends TestCase { - public static String ANDROID_URI = BaseView.ANDROID_URI; - public static String ATTR_ID = BaseView.ATTR_ID; - /** * Helper function used by tests to drag a button into a canvas containing * the given children. diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/LinearLayoutRuleTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/LinearLayoutRuleTest.java index 489d12c..520f984 100644 --- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/LinearLayoutRuleTest.java +++ b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/LinearLayoutRuleTest.java @@ -16,15 +16,21 @@ package com.android.ide.common.layout; +import static com.android.ide.common.layout.LayoutConstants.ANDROID_URI; +import static com.android.ide.common.layout.LayoutConstants.ATTR_ID; +import static com.android.ide.common.layout.LayoutConstants.ATTR_ORIENTATION; +import static com.android.ide.common.layout.LayoutConstants.VALUE_HORIZONTAL; +import static com.android.ide.common.layout.LayoutConstants.VALUE_VERTICAL; + import com.android.ide.common.api.DropFeedback; import com.android.ide.common.api.IDragElement; import com.android.ide.common.api.IMenuCallback; import com.android.ide.common.api.INode; import com.android.ide.common.api.IViewRule; import com.android.ide.common.api.MenuAction; +import com.android.ide.common.api.MenuAction.Choices; import com.android.ide.common.api.Point; import com.android.ide.common.api.Rect; -import com.android.ide.common.api.MenuAction.Choices; import java.util.List; @@ -84,7 +90,7 @@ public class LinearLayoutRuleTest extends LayoutTestBase { rule.onDropped(targetNode, elements, feedback, dropPoint); assertEquals(1, targetNode.getChildren().length); assertEquals("@+id/Button01", targetNode.getChildren()[0].getStringAttr( - BaseView.ANDROID_URI, BaseView.ATTR_ID)); + ANDROID_URI, ATTR_ID)); } // Utility for other tests @@ -92,9 +98,9 @@ public class LinearLayoutRuleTest extends LayoutTestBase { int insertIndex, int currentIndex, String... graphicsFragments) { INode linearLayout = TestNode.create("android.widget.LinearLayout").id( - "@+id/LinearLayout01").bounds(new Rect(0, 0, 240, 480)).set(BaseView.ANDROID_URI, - LinearLayoutRule.ATTR_ORIENTATION, - vertical ? LinearLayoutRule.VALUE_VERTICAL : LinearLayoutRule.VALUE_HORIZONTAL) + "@+id/LinearLayout01").bounds(new Rect(0, 0, 240, 480)).set(ANDROID_URI, + ATTR_ORIENTATION, + vertical ? VALUE_VERTICAL : VALUE_HORIZONTAL) .add( TestNode.create("android.widget.Button").id("@+id/Button01").bounds( new Rect(0, 0, 100, 80)), @@ -131,7 +137,7 @@ public class LinearLayoutRuleTest extends LayoutTestBase { LinearLayoutRule rule = new LinearLayoutRule(); INode node = TestNode.create("android.widget.Button").id("@+id/Button012"); - assertNull(node.getStringAttr(BaseView.ANDROID_URI, LinearLayoutRule.ATTR_ORIENTATION)); + assertNull(node.getStringAttr(ANDROID_URI, ATTR_ORIENTATION)); List<MenuAction> contextMenu = rule.getContextMenu(node); assertEquals(4, contextMenu.size()); @@ -142,14 +148,14 @@ public class LinearLayoutRuleTest extends LayoutTestBase { MenuAction.Choices choices = (Choices) orientationAction; IMenuCallback callback = choices.getCallback(); - callback.action(orientationAction, LinearLayoutRule.VALUE_VERTICAL, true); - - String orientation = node.getStringAttr(BaseView.ANDROID_URI, - LinearLayoutRule.ATTR_ORIENTATION); - assertEquals(LinearLayoutRule.VALUE_VERTICAL, orientation); - callback.action(orientationAction, LinearLayoutRule.VALUE_HORIZONTAL, true); - orientation = node.getStringAttr(BaseView.ANDROID_URI, LinearLayoutRule.ATTR_ORIENTATION); - assertEquals(LinearLayoutRule.VALUE_HORIZONTAL, orientation); + callback.action(orientationAction, VALUE_VERTICAL, true); + + String orientation = node.getStringAttr(ANDROID_URI, + ATTR_ORIENTATION); + assertEquals(VALUE_VERTICAL, orientation); + callback.action(orientationAction, VALUE_HORIZONTAL, true); + orientation = node.getStringAttr(ANDROID_URI, ATTR_ORIENTATION); + assertEquals(VALUE_HORIZONTAL, orientation); } public void testDragInEmptyWithBounds() { diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/RelativeLayoutRuleTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/RelativeLayoutRuleTest.java index 0ebec70..f04538a 100644 --- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/RelativeLayoutRuleTest.java +++ b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/RelativeLayoutRuleTest.java @@ -16,6 +16,8 @@ package com.android.ide.common.layout; +import static com.android.ide.common.layout.LayoutConstants.ANDROID_URI; + import com.android.ide.common.api.INode; import com.android.ide.common.api.Point; import com.android.ide.common.api.Rect; @@ -76,7 +78,7 @@ public class RelativeLayoutRuleTest extends LayoutTestBase { // Drop preview "useStyle(DROP_PREVIEW), drawRect(Rect[0,0,105,80])"); - assertEquals("true", inserted.getStringAttr(BaseLayout.ANDROID_URI, + assertEquals("true", inserted.getStringAttr(ANDROID_URI, "layout_alignParentTop")); } @@ -144,7 +146,7 @@ public class RelativeLayoutRuleTest extends LayoutTestBase { String[] elements = attachment.split("="); String name = "layout_" + elements[0]; String value = elements[1]; - assertEquals(value, inserted.getStringAttr(BaseLayout.ANDROID_URI, name)); + assertEquals(value, inserted.getStringAttr(ANDROID_URI, name)); } } } diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/TestDragElement.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/TestDragElement.java index b113ced..2c65317 100644 --- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/TestDragElement.java +++ b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/TestDragElement.java @@ -15,6 +15,9 @@ */ package com.android.ide.common.layout; +import static com.android.ide.common.layout.LayoutConstants.ANDROID_URI; +import static com.android.ide.common.layout.LayoutConstants.ATTR_ID; + import com.android.ide.common.api.IDragElement; import com.android.ide.common.api.Rect; @@ -79,7 +82,7 @@ public class TestDragElement implements IDragElement { } public TestDragElement id(String id) { - return set(BaseView.ANDROID_URI, BaseView.ATTR_ID, id); + return set(ANDROID_URI, ATTR_ID, id); } public static TestDragElement create(String fqn, Rect bounds) { diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/TestNode.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/TestNode.java index 21250de..14430a5 100644 --- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/TestNode.java +++ b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/TestNode.java @@ -15,6 +15,9 @@ */ package com.android.ide.common.layout; +import static com.android.ide.common.layout.LayoutConstants.ANDROID_URI; +import static com.android.ide.common.layout.LayoutConstants.ATTR_ID; + import com.android.ide.common.api.IAttributeInfo; import com.android.ide.common.api.INode; import com.android.ide.common.api.INodeHandler; @@ -50,7 +53,7 @@ public class TestNode implements INode { } public TestNode id(String id) { - return set(BaseView.ANDROID_URI, BaseView.ATTR_ID, id); + return set(ANDROID_URI, ATTR_ID, id); } public TestNode set(String uri, String name, String value) { |