use of org.fest.swing.fixture.JTableFixture 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;
}
use of org.fest.swing.fixture.JTableFixture in project android by JetBrains.
the class ModulesToImportDialogFixture method getSelectedModuleList.
@NotNull
public ImmutableList<String> getSelectedModuleList() {
JTableFixture moduleTable = getModuleTable();
int size = moduleTable.rowCount();
String[][] contents = moduleTable.contents();
ImmutableList.Builder<String> result = ImmutableList.builder();
for (int i = 0; i < size; i++) {
if ("true".equals(contents[i][0])) {
result.add(contents[i][1]);
}
}
return result.build();
}
use of org.fest.swing.fixture.JTableFixture 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;
}
use of org.fest.swing.fixture.JTableFixture in project android by JetBrains.
the class ModulesToImportDialogFixture method getModuleList.
@NotNull
public ImmutableList<String> getModuleList() {
JTableFixture moduleTable = getModuleTable();
int size = moduleTable.rowCount();
String[][] contents = moduleTable.contents();
ImmutableList.Builder<String> result = ImmutableList.builder();
for (int i = 0; i < size; i++) {
result.add(contents[i][1]);
}
return result.build();
}
Aggregations