Search in sources :

Example 6 with JTableCellFixture

use of org.fest.swing.fixture.JTableCellFixture in project android by JetBrains.

the class AvdManagerDialogFixture method deleteAvd.

public AvdManagerDialogFixture deleteAvd(String name) {
    TableView tableView = robot().finder().findByType(target(), TableView.class, true);
    JTableFixture tableFixture = new JTableFixture(robot(), tableView);
    JTableCellFixture cell = tableFixture.cell(name);
    cell.click(RIGHT_BUTTON);
    JPopupMenuFixture contextMenuFixture = new JPopupMenuFixture(robot(), robot().findActivePopupMenu());
    contextMenuFixture.menuItemWithPath("Delete").click();
    MessagesFixture.findByTitle(robot(), "Confirm Deletion").clickYes();
    return this;
}
Also used : JTableCellFixture(org.fest.swing.fixture.JTableCellFixture) JTableFixture(org.fest.swing.fixture.JTableFixture) JPopupMenuFixture(org.fest.swing.fixture.JPopupMenuFixture) TableView(com.intellij.ui.table.TableView)

Example 7 with JTableCellFixture

use of org.fest.swing.fixture.JTableCellFixture in project android by JetBrains.

the class AvdManagerDialogFixture method editAvdWithName.

public AvdEditWizardFixture editAvdWithName(@NotNull String name) {
    final TableView tableView = robot().finder().findByType(target(), TableView.class, true);
    JTableFixture tableFixture = new JTableFixture(robot(), tableView);
    JTableCellFixture cell = tableFixture.cell(name);
    final TableCell actionCell = TableCell.row(cell.row()).column(7);
    JTableCellFixture actionCellFixture = tableFixture.cell(actionCell);
    execute(new GuiTask() {

        @Override
        protected void executeInEDT() throws Throwable {
            tableView.editCellAt(actionCell.row, actionCell.column);
        }
    });
    JPanel actionPanel = (JPanel) actionCellFixture.editor();
    HyperlinkLabel editButtonLabel = robot().finder().find(actionPanel, new GenericTypeMatcher<HyperlinkLabel>(HyperlinkLabel.class) {

        @Override
        protected boolean isMatching(@NotNull HyperlinkLabel component) {
            return "Edit this AVD".equals(component.getToolTipText());
        }
    });
    robot().click(editButtonLabel);
    return AvdEditWizardFixture.find(robot());
}
Also used : JTableCellFixture(org.fest.swing.fixture.JTableCellFixture) GuiTask(org.fest.swing.edt.GuiTask) JTableFixture(org.fest.swing.fixture.JTableFixture) TableCell(org.fest.swing.data.TableCell) HyperlinkLabel(com.intellij.ui.HyperlinkLabel) TableView(com.intellij.ui.table.TableView)

Example 8 with JTableCellFixture

use of org.fest.swing.fixture.JTableCellFixture in project android by JetBrains.

the class ChooseDeviceDefinitionStepFixture method selectHardwareProfile.

@NotNull
public ChooseDeviceDefinitionStepFixture selectHardwareProfile(@NotNull final String deviceName) {
    JTableFixture deviceListFixture = getTableFixture();
    JTableCellFixture cell = deviceListFixture.cell(deviceName);
    cell.select();
    return this;
}
Also used : JTableCellFixture(org.fest.swing.fixture.JTableCellFixture) JTableFixture(org.fest.swing.fixture.JTableFixture) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

JTableCellFixture (org.fest.swing.fixture.JTableCellFixture)8 JTableFixture (org.fest.swing.fixture.JTableFixture)6 NotNull (org.jetbrains.annotations.NotNull)5 TableView (com.intellij.ui.table.TableView)3 TableCell (org.fest.swing.data.TableCell)2 HyperlinkLabel (com.intellij.ui.HyperlinkLabel)1 Content (com.intellij.ui.content.Content)1 GuiTask (org.fest.swing.edt.GuiTask)1 JPopupMenuFixture (org.fest.swing.fixture.JPopupMenuFixture)1 Test (org.junit.Test)1