Search in sources :

Example 1 with JTableCellFixture

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

the class TranslationsEditorTest method basics.

@Test
public void basics() {
    Object expected = Arrays.asList("English (en)", "English (en) in United Kingdom (GB)", "Hebrew (iw)", "Tamil (ta)", "Chinese (zh) in China (CN)");
    assertEquals(expected, myTranslationsEditor.locales());
    assertEquals(Arrays.asList("action_settings", "app_name", "cancel", "hello_world"), myTranslationsEditor.keys());
    // Cancel in zh-rCN
    JTableCellFixture cancel = myTranslationsEditor.getTable().cell(TableCell.row(2).column(7));
    assertEquals("取消", cancel.value());
    assertEquals(-1, cancel.font().target().canDisplayUpTo("取消"));
}
Also used : JTableCellFixture(org.fest.swing.fixture.JTableCellFixture) Test(org.junit.Test)

Example 2 with JTableCellFixture

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

the class ChooseSystemImageStepFixture method selectSystemImage.

@NotNull
public ChooseSystemImageStepFixture selectSystemImage(@NotNull String releaseName, @NotNull String apiLevel, @NotNull String abiType, @NotNull String targetName) {
    final TableView systemImageList = robot().finder().findByType(target(), TableView.class, true);
    JTableFixture systemImageListFixture = new JTableFixture(robot(), systemImageList);
    JTableCellFixture cell = systemImageListFixture.cell(rowWithValue(releaseName, apiLevel, abiType, targetName).column(0));
    cell.select();
    return this;
}
Also used : JTableCellFixture(org.fest.swing.fixture.JTableCellFixture) JTableFixture(org.fest.swing.fixture.JTableFixture) TableView(com.intellij.ui.table.TableView) NotNull(org.jetbrains.annotations.NotNull)

Example 3 with JTableCellFixture

use of org.fest.swing.fixture.JTableCellFixture in project intellij-community by JetBrains.

the class ConfigureProjectSubsetDialogFixture method selectModule.

@NotNull
public ConfigureProjectSubsetDialogFixture selectModule(@NotNull String moduleName, boolean selected) {
    JTableCellFixture cell = myModulesTable.cell(moduleName);
    myModulesTable.enterValue(row(cell.row()).column(0), String.valueOf(selected));
    return this;
}
Also used : JTableCellFixture(org.fest.swing.fixture.JTableCellFixture) NotNull(org.jetbrains.annotations.NotNull)

Example 4 with JTableCellFixture

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

the class ModulesToImportDialogFixture method setSelected.

@NotNull
public ModulesToImportDialogFixture setSelected(@NotNull String moduleName, boolean selected) {
    JTableFixture moduleTable = getModuleTable();
    JTableCellFixture cell = moduleTable.cell(moduleName);
    moduleTable.enterValue(TableCell.row(cell.row()).column(0), String.valueOf(selected));
    return this;
}
Also used : JTableCellFixture(org.fest.swing.fixture.JTableCellFixture) JTableFixture(org.fest.swing.fixture.JTableFixture) NotNull(org.jetbrains.annotations.NotNull)

Example 5 with JTableCellFixture

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

the class BuildVariantsToolWindowFixture method selectVariantForModule.

@NotNull
public BuildVariantsToolWindowFixture selectVariantForModule(@NotNull final String module, @NotNull String variant) {
    activate();
    Content[] contents = myToolWindow.getContentManager().getContents();
    assertThat(contents.length).isAtLeast(1);
    Content content = contents[0];
    JTable variantsTable = myRobot.finder().findByType(content.getComponent(), JTable.class, true);
    final String moduleColumnText = "Module: '" + module + "'";
    JTableFixture table = new JTableFixture(myRobot, variantsTable);
    JTableCellFixture moduleCell = table.cell((jTable, cellReader) -> {
        int rowCount = jTable.getRowCount();
        for (int i = 0; i < rowCount; i++) {
            int moduleColumnIndex = 0;
            String currentModule = cellReader.valueAt(jTable, i, moduleColumnIndex);
            if (moduleColumnText.equals(currentModule)) {
                return row(i).column(moduleColumnIndex);
            }
        }
        throw new AssertionError("Failed to find module '" + module + "' in 'Build Variants' view");
    });
    TableCell variantCellCoordinates = row(moduleCell.row()).column(1);
    String selectedVariant = table.valueAt(variantCellCoordinates);
    if (!variant.equals(selectedVariant)) {
        // Attempt to select variant if it is not already selected.
        JTableCellFixture variantCell = table.cell(variantCellCoordinates);
        variantCell.enterValue(variant);
        myProjectFrame.waitForBuildToFinish(BuildMode.SOURCE_GEN);
    }
    return this;
}
Also used : JTableCellFixture(org.fest.swing.fixture.JTableCellFixture) JTableFixture(org.fest.swing.fixture.JTableFixture) TableCell(org.fest.swing.data.TableCell) Content(com.intellij.ui.content.Content) 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