Search in sources :

Example 1 with NlPaletteTreeGrid

use of com.android.tools.idea.uibuilder.palette.NlPaletteTreeGrid in project android by JetBrains.

the class NlEditorFixture method dragComponentToSurface.

@NotNull
public NlEditorFixture dragComponentToSurface(@NotNull String group, @NotNull String item) {
    NlPaletteTreeGrid treeGrid = robot().finder().findByType(NlPaletteTreeGrid.class, true);
    new JListFixture(robot(), (JList) treeGrid.getCategoryList()).selectItem(group);
    // Wait until the list has been expanded in UI (eliminating flakiness).
    JList list = GuiTests.waitUntilShowing(robot(), treeGrid, Matchers.byName(JList.class, group));
    new JListFixture(robot(), list).drag(item);
    myDragAndDrop.drop(myDesignSurfaceFixture.target(), new Point(0, 0));
    return this;
}
Also used : JListFixture(org.fest.swing.fixture.JListFixture) NlPaletteTreeGrid(com.android.tools.idea.uibuilder.palette.NlPaletteTreeGrid) NotNull(org.jetbrains.annotations.NotNull)

Example 2 with NlPaletteTreeGrid

use of com.android.tools.idea.uibuilder.palette.NlPaletteTreeGrid in project android by JetBrains.

the class NlPreviewFixture method dragComponentToSurface.

@NotNull
public NlPreviewFixture dragComponentToSurface(@NotNull String group, @NotNull String item) {
    openPalette();
    NlPaletteTreeGrid treeGrid = myRobot.finder().findByType(NlPaletteTreeGrid.class, true);
    Wait.seconds(5).expecting("the UI to be populated").until(() -> treeGrid.getCategoryList().getModel().getSize() > 0);
    new JListFixture(myRobot, treeGrid.getCategoryList()).selectItem(group);
    // Wait until the list has been expanded in UI (eliminating flakiness).
    JList list = GuiTests.waitUntilShowing(myRobot, treeGrid, Matchers.byName(JList.class, group));
    new JListFixture(myRobot, list).drag(item);
    myDragAndDrop.drop(myDesignSurfaceFixture.target(), new Point(0, 0));
    return this;
}
Also used : JListFixture(org.fest.swing.fixture.JListFixture) NlPaletteTreeGrid(com.android.tools.idea.uibuilder.palette.NlPaletteTreeGrid) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

NlPaletteTreeGrid (com.android.tools.idea.uibuilder.palette.NlPaletteTreeGrid)2 JListFixture (org.fest.swing.fixture.JListFixture)2 NotNull (org.jetbrains.annotations.NotNull)2