use of org.fest.swing.fixture.JTableFixture in project android by JetBrains.
the class TranslationsEditorTest method paste.
@Test
public void paste() {
JTableFixture table = myTranslationsEditor.getTable();
table.selectCell(TableCell.row(1).column(2));
String data = "app_name\tapp_name_en\n" + "cancel\tcancel_en\n";
Toolkit.getDefaultToolkit().getSystemClipboard().setContents(new StringSelection(data), EmptyClipboardOwner.INSTANCE);
KeyStroke keyStroke = getKeyStroke(table.target().getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT), "paste");
table.pressAndReleaseKey(KeyPressInfo.keyCode(keyStroke.getKeyCode()).modifiers(keyStroke.getModifiers()));
assertEquals("app_name", table.valueAt(TableCell.row(1).column(2)));
assertEquals("app_name_en", table.valueAt(TableCell.row(1).column(3)));
assertEquals("cancel", table.valueAt(TableCell.row(2).column(2)));
assertEquals("cancel_en", table.valueAt(TableCell.row(2).column(3)));
}
use of org.fest.swing.fixture.JTableFixture 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;
}
use of org.fest.swing.fixture.JTableFixture 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());
}
use of org.fest.swing.fixture.JTableFixture in project android by JetBrains.
the class AvdManagerDialogFixture method selectAvd.
public AvdManagerDialogFixture selectAvd(@NotNull String name) {
TableView tableView = robot().finder().findByType(target(), TableView.class, true);
JTableFixture tableFixture = new JTableFixture(robot(), tableView);
tableFixture.cell(name).select();
return this;
}
use of org.fest.swing.fixture.JTableFixture 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;
}
Aggregations