diff options
Diffstat (limited to 'eclipse/plugins/com.android.ide.eclipse.tests/src/com/android')
5 files changed, 107 insertions, 105 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/AndroidContentAssistTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/AndroidContentAssistTest.java index e2f7049..a201de6 100644 --- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/AndroidContentAssistTest.java +++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/AndroidContentAssistTest.java @@ -487,6 +487,11 @@ public class AndroidContentAssistTest extends AdtProjectTest { checkLayoutCompletion("completion11.xml", "?and^roid:attr/Textapp"); } + public void testCompletion75() throws Exception { + // Test <include> attributes + checkLayoutCompletion("completion12.xml", "<include ^/>"); + } + // ---- Test *applying* code completion ---- // The following tests check -applying- a specific code completion diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/LayoutMetadataTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/LayoutMetadataTest.java index a75fc96..fa9e18f 100644 --- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/LayoutMetadataTest.java +++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/LayoutMetadataTest.java @@ -45,111 +45,6 @@ import org.w3c.dom.Node; @SuppressWarnings({"restriction", "javadoc", "deprecation"}) // XML DOM model public class LayoutMetadataTest extends AdtProjectTest { - public void testOldMetadata1() throws Exception { - Pair<IDocument, UiElementNode> pair = getNode("metadata.xml", "listView1"); - IDocument document = pair.getFirst(); - UiElementNode uiNode = pair.getSecond(); - Node node = uiNode.getXmlNode(); - - assertNull(LayoutMetadata.getProperty(document, node, "foo")); - String before = - "<ListView android:layout_width=\"match_parent\" android:id=\"@+id/listView1\"\n" + - " android:layout_height=\"wrap_content\">\n" + - " </ListView>"; - assertEquals(before, getText(document, node)); - - // Set the property - LayoutMetadata.setProperty(document, node, - "listitem", "@android:layout/simple_list_item_checked"); - String after = - "<ListView android:layout_width=\"match_parent\" android:id=\"@+id/listView1\"\n" + - " android:layout_height=\"wrap_content\">\n" + - " <!-- Preview: listitem=@android:layout/simple_list_item_checked -->\n" + - " </ListView>"; - assertEquals(after, getText(document, node)); - - // Set a second property - LayoutMetadata.setProperty(document, node, - "listheader", "@android:layout/browser_link_context_header"); - after = - "<ListView android:layout_width=\"match_parent\" android:id=\"@+id/listView1\"\n" + - " android:layout_height=\"wrap_content\">\n" + - " <!-- Preview: \n" + - " listheader=@android:layout/browser_link_context_header\n" + - " listitem=@android:layout/simple_list_item_checked\n" + - " -->\n" + - " </ListView>"; - assertEquals(after, getText(document, node)); - - // Set list item to a different layout - LayoutMetadata.setProperty(document, node, - "listitem", "@android:layout/simple_list_item_single_choice"); - after = - "<ListView android:layout_width=\"match_parent\" android:id=\"@+id/listView1\"\n" + - " android:layout_height=\"wrap_content\">\n" + - " <!-- Preview: \n" + - " listheader=@android:layout/browser_link_context_header\n" + - " listitem=@android:layout/simple_list_item_single_choice\n" + - " -->\n" + - " </ListView>"; - assertEquals(after, getText(document, node)); - - // Set header to a different layout - LayoutMetadata.setProperty(document, node, - "listheader", "@layout/foo"); - after = - "<ListView android:layout_width=\"match_parent\" android:id=\"@+id/listView1\"\n" + - " android:layout_height=\"wrap_content\">\n" + - " <!-- Preview: \n" + - " listheader=@layout/foo\n" + - " listitem=@android:layout/simple_list_item_single_choice\n" + - " -->\n" + - " </ListView>"; - assertEquals(after, getText(document, node)); - - // Clear out list item - LayoutMetadata.setProperty(document, node, - "listitem", null); - after = - "<ListView android:layout_width=\"match_parent\" android:id=\"@+id/listView1\"\n" + - " android:layout_height=\"wrap_content\">\n" + - " <!-- Preview: listheader=@layout/foo -->\n" + - " </ListView>"; - assertEquals(after, getText(document, node)); - - // Clear out list header - LayoutMetadata.setProperty(document, node, - "listheader", null); - after = - "<ListView android:layout_width=\"match_parent\" android:id=\"@+id/listView1\"\n" + - " android:layout_height=\"wrap_content\"></ListView>"; - assertEquals(after, getText(document, node)); - - // Check node expansion on the button which doesn't have an end tag: - before = "<Button android:text=\"Button\" android:id=\"@+id/button1\"/>"; - } - - public void testMetadata2() throws Exception { - Pair<IDocument, UiElementNode> pair = getNode("metadata.xml", "button1"); - IDocument document = pair.getFirst(); - UiElementNode uiNode = pair.getSecond(); - Node node = uiNode.getXmlNode(); - - assertNull(LayoutMetadata.getProperty(document, node, "foo")); - String before = - "<Button android:text=\"Button\" android:id=\"@+id/button1\"/>"; - assertEquals(before, getText(document, node)); - - // Set the property - LayoutMetadata.setProperty(document, node, - "listitem", "@android:layout/simple_list_item_checked"); - String after = - "<Button android:text=\"Button\" android:id=\"@+id/button1\">\n" + - " <!-- Preview: listitem=@android:layout/simple_list_item_checked -->\n" + - " </Button>"; - assertEquals(after, getText(document, node)); - } - public void testMetadata1() throws Exception { Pair<IDocument, UiElementNode> pair = getNode("metadata.xml", "listView1"); UiElementNode uiNode = pair.getSecond(); diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/animator1-expected-completion61.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/animator1-expected-completion61.txt index b298ac0..1ba8a62 100644 --- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/animator1-expected-completion61.txt +++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/animator1-expected-completion61.txt @@ -11,6 +11,7 @@ Code completion in animator1.xml for android:interpolator="^@android:anim/bounce @android: @+id/ @anim/ +@animator/ @color/ @drawable/ @id/ diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion12-expected-completion75.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion12-expected-completion75.txt new file mode 100644 index 0000000..2e5a543 --- /dev/null +++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion12-expected-completion75.txt @@ -0,0 +1,94 @@ +Code completion in completion12.xml for <include ^/>: +layout : [reference]. * Required. +style : A reference to a custom style [reference] +android:id : Supply an identifier name for this view, to later retrieve it with View.findViewById() or Activity.findViewById(). [reference] +android:tag : Supply a tag for this view containing a String, to be retrieved later with View.getTag() or searched for with View.findViewWithTag() . [string] +android:scrollX : The initial horizontal scroll offset, in pixels. [dimension] +android:scrollY : The initial vertical scroll offset, in pixels. [dimension] +android:background : A drawable to use as the background. [color, reference] +android:padding : Sets the padding, in pixels, of all four edges. [dimension] +android:paddingLeft : Sets the padding, in pixels, of the left edge; see padding. [dimension] +android:paddingTop : Sets the padding, in pixels, of the top edge; see padding. [dimension] +android:paddingRight : Sets the padding, in pixels, of the right edge; see padding. [dimension] +android:paddingBottom : Sets the padding, in pixels, of the bottom edge; see padding. [dimension] +android:paddingStart : Sets the padding, in pixels, of the start edge; see padding. [dimension] +android:paddingEnd : Sets the padding, in pixels, of the end edge; see padding. [dimension] +android:focusable : Boolean that controls whether a view can take focus. [boolean] +android:focusableInTouchMode : Boolean that controls whether a view can take focus while in touch mode. [boolean] +android:visibility : Controls the initial visibility of the view. [enum] +android:fitsSystemWindows : Boolean internal attribute to adjust view layout based on system windows such as the status bar. [boolean] +android:scrollbars : Defines which scrollbars should be displayed on scrolling or not. [flag] +android:scrollbarStyle : Controls the scrollbar style and position. [enum] +android:isScrollContainer : Set this if the view will serve as a scrolling container, meaing that it can be resized to shrink its overall window so that there will be space for an input method. [boolean] +android:fadeScrollbars : Defines whether to fade out scrollbars when they are not in use. [boolean] +android:scrollbarFadeDuration : Defines the delay in milliseconds that a scrollbar takes to fade out. [integer] +android:scrollbarDefaultDelayBeforeFade : Defines the delay in milliseconds that a scrollbar waits before fade out. [integer] +android:scrollbarSize : Sets the width of vertical scrollbars and height of horizontal scrollbars. [dimension] +android:scrollbarThumbHorizontal : Defines the horizontal scrollbar thumb drawable. [reference] +android:scrollbarThumbVertical : Defines the vertical scrollbar thumb drawable. [reference] +android:scrollbarTrackHorizontal : Defines the horizontal scrollbar track drawable. [reference] +android:scrollbarTrackVertical : Defines the vertical scrollbar track drawable. [reference] +android:scrollbarAlwaysDrawHorizontalTrack : Defines whether the horizontal scrollbar track should always be drawn. [boolean] +android:scrollbarAlwaysDrawVerticalTrack : Defines whether the vertical scrollbar track should always be drawn. [boolean] +android:fadingEdge : . * Deprecated: This attribute is deprecated and will be ignored as of API level {@link android.os.Build.VERSION_CODES#ICE_CREAM_SANDWICH. [flag] +android:requiresFadingEdge : Defines which edges should be faded on scrolling. [flag] +android:fadingEdgeLength : Defines the length of the fading edges. [dimension] +android:nextFocusLeft : Defines the next view to give focus to when the next focus is FOCUS_LEFT. [reference] +android:nextFocusRight : Defines the next view to give focus to when the next focus is FOCUS_RIGHT If the reference refers to a view that does not exist or is part of a hierarchy that is invisible, a java.lang.RuntimeException will result when the reference is accessed. [reference] +android:nextFocusUp : Defines the next view to give focus to when the next focus is FOCUS_UP If the reference refers to a view that does not exist or is part of a hierarchy that is invisible, a java.lang.RuntimeException will result when the reference is accessed. [reference] +android:nextFocusDown : Defines the next view to give focus to when the next focus is FOCUS_DOWN If the reference refers to a view that does not exist or is part of a hierarchy that is invisible, a java.lang.RuntimeException will result when the reference is accessed. [reference] +android:nextFocusForward : Defines the next view to give focus to when the next focus is FOCUS_FORWARD If the reference refers to a view that does not exist or is part of a hierarchy that is invisible, a java.lang.RuntimeException will result when the reference is accessed. [reference] +android:clickable : Defines whether this view reacts to click events. [boolean] +android:longClickable : Defines whether this view reacts to long click events. [boolean] +android:saveEnabled : If unset, no state will be saved for this view when it is being frozen. [boolean] +android:filterTouchesWhenObscured : Specifies whether to filter touches when the view's window is obscured by another visible window. [boolean] +android:drawingCacheQuality : Defines the quality of translucent drawing caches. [enum] +android:keepScreenOn : Controls whether the view's window should keep the screen on while visible. [boolean] +android:duplicateParentState : When this attribute is set to true, the view gets its drawable state (focused, pressed, etc.) from its direct parent rather than from itself. [boolean] +android:minHeight : Defines the minimum height of the view. +android:minWidth : Defines the minimum width of the view. +android:soundEffectsEnabled : Boolean that controls whether a view should have sound effects enabled for events such as clicking and touching. [boolean] +android:hapticFeedbackEnabled : Boolean that controls whether a view should have haptic feedback enabled for events such as long presses. [boolean] +android:contentDescription : Defines text that briefly describes content of the view. [string] +android:onClick : Name of the method in this View's context to invoke when the view is clicked. [string] +android:overScrollMode : Defines over-scrolling behavior. [enum] +android:alpha : alpha property of the view, as a value between 0 (completely transparent) and 1 (completely opaque). [float] +android:translationX : translation in x of the view. [dimension] +android:translationY : translation in y of the view. [dimension] +android:transformPivotX : x location of the pivot point around which the view will rotate and scale. [dimension] +android:transformPivotY : y location of the pivot point around which the view will rotate and scale. [dimension] +android:rotation : rotation of the view, in degrees. [float] +android:rotationX : rotation of the view around the x axis, in degrees. [float] +android:rotationY : rotation of the view around the y axis, in degrees. [float] +android:scaleX : scale of the view in the x direction. [float] +android:scaleY : scale of the view in the y direction. [float] +android:verticalScrollbarPosition : Determines which side the vertical scroll bar should be placed on. [enum] +android:layerType : Specifies the type of layer backing this view. [enum] +android:layoutDirection : Defines the direction of layout drawing. [enum] +android:textDirection : Direction of the text. [integer, enum] +android:layout_toLeftOf : Positions the right edge of this view to the left of the given anchor view ID. [reference] +android:layout_toRightOf : Positions the left edge of this view to the right of the given anchor view ID. [reference] +android:layout_above : Positions the bottom edge of this view above the given anchor view ID. [reference] +android:layout_below : Positions the top edge of this view below the given anchor view ID. [reference] +android:layout_alignBaseline : Positions the baseline of this view on the baseline of the given anchor view ID. [reference] +android:layout_alignLeft : Makes the left edge of this view match the left edge of the given anchor view ID. [reference] +android:layout_alignTop : Makes the top edge of this view match the top edge of the given anchor view ID. [reference] +android:layout_alignRight : Makes the right edge of this view match the right edge of the given anchor view ID. [reference] +android:layout_alignBottom : Makes the bottom edge of this view match the bottom edge of the given anchor view ID. [reference] +android:layout_alignParentLeft : If true, makes the left edge of this view match the left edge of the parent. [boolean] +android:layout_alignParentTop : If true, makes the top edge of this view match the top edge of the parent. [boolean] +android:layout_alignParentRight : If true, makes the right edge of this view match the right edge of the parent. [boolean] +android:layout_alignParentBottom : If true, makes the bottom edge of this view match the bottom edge of the parent. [boolean] +android:layout_centerInParent : If true, centers this child horizontally and vertically within its parent. [boolean] +android:layout_centerHorizontal : If true, centers this child horizontally within its parent. [boolean] +android:layout_centerVertical : If true, centers this child vertically within its parent. [boolean] +android:layout_alignWithParentIfMissing : If set to true, the parent will be used as the anchor when the anchor cannot be be found for layout_toLeftOf, layout_toRightOf, etc. [boolean] +android:layout_width : Specifies the basic width of the view. [dimension, enum] +android:layout_height : Specifies the basic height of the view. [dimension, enum] +android:layout_margin : Specifies extra space on the left, top, right and bottom sides of this view. [dimension] +android:layout_marginLeft : Specifies extra space on the left side of this view. [dimension] +android:layout_marginTop : Specifies extra space on the top side of this view. [dimension] +android:layout_marginRight : Specifies extra space on the right side of this view. [dimension] +android:layout_marginBottom : Specifies extra space on the bottom side of this view. [dimension] +android:layout_marginStart : Specifies extra space on the start side of this view. [dimension] +android:layout_marginEnd : Specifies extra space on the end side of this view. [dimension] diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion12.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion12.xml new file mode 100644 index 0000000..946a232 --- /dev/null +++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion12.xml @@ -0,0 +1,7 @@ +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="match_parent" > + + <include /> + +</RelativeLayout> |