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;
}
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;
}
Aggregations