本文整理汇总了Java中org.fest.swing.fixture.JTableFixture类的典型用法代码示例。如果您正苦于以下问题:Java JTableFixture类的具体用法?Java JTableFixture怎么用?Java JTableFixture使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JTableFixture类属于org.fest.swing.fixture包,在下文中一共展示了JTableFixture类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: JMVAdeletingManyStationsAndClasses
import org.fest.swing.fixture.JTableFixture; //导入依赖的package包/类
/**
* Creates 3 additional classes (on top the existing 1) and deletes three
* of them by highlighting them and pressing the 'delete' button.
* Verifies the classes were deleted.
* Then does a similar thing with stations
*/
@Test
public void JMVAdeletingManyStationsAndClasses() {
jmva.label(new TextLabelMatcher("Classes")).click();
jmva.button(new TextButtonMatcher("New Class")).click();
jmva.button(new TextButtonMatcher("New Class")).click();
jmva.button(new TextButtonMatcher("New Class")).click();
JTableFixture classesTable = jmva.table("ClassTable");
classesTable.selectRows(1, 2, 3);
classesTable.pressAndReleaseKey(KeyPressInfo.keyCode(127));
assertEquals(1, classesTable.component().getRowCount());
jmva.label(new TextLabelMatcher("Stations")).click();
jmva.button(new TextButtonMatcher("New Station")).click();
jmva.button(new TextButtonMatcher("New Station")).click();
jmva.button(new TextButtonMatcher("New Station")).click();
JTableFixture stationsTable = jmva.table("StationTable");
stationsTable.selectRows(0, 1, 2);
stationsTable.pressAndReleaseKey(KeyPressInfo.keyCode(127));
assertEquals(1, stationsTable.component().getRowCount());
}
示例2: getFieldValue
import org.fest.swing.fixture.JTableFixture; //导入依赖的package包/类
/**
* Get table field value
*
* @param row the row number
* @param column the column number
* @throws VerificationException if the element doesn't exist
*/
@Override
@PublicAtsApi
public String getFieldValue(
int row,
int column ) {
new SwingElementState(this).waitToBecomeExisting();
try {
return ((JTableFixture) SwingElementLocator.findFixture(this)).valueAt(new TableCell(row,
column) {});
} catch (IndexOutOfBoundsException ioobe) {
throw new UiElementException(ioobe.getMessage(), this);
}
}
示例3: clickCell
import org.fest.swing.fixture.JTableFixture; //导入依赖的package包/类
/**
* Click table cell
*
* @param row the row number
* @param column the column number
* @throws VerificationException if the table element doesn't exist
*/
@PublicAtsApi
public void clickCell(
int row,
int column ) {
new SwingElementState(this).waitToBecomeExisting();
JTableFixture tableFixture = (JTableFixture) SwingElementLocator.findFixture(this);
try {
tableFixture.cell(new TableCell(row, column) {}).click();
} catch (Exception e) {
throw new UiElementException(e.getMessage(), this);
}
}
示例4: doubleClickCell
import org.fest.swing.fixture.JTableFixture; //导入依赖的package包/类
/**
* Double click table cell
*
* @param row the row number
* @param column the column number
* @throws VerificationException if the element doesn't exist
*/
@PublicAtsApi
public void doubleClickCell(
int row,
int column ) {
new SwingElementState(this).waitToBecomeExisting();
JTableFixture tableFixture = (JTableFixture) SwingElementLocator.findFixture(this);
try {
tableFixture.cell(new TableCell(row, column) {}).doubleClick();
} catch (Exception e) {
throw new UiElementException(e.getMessage(), this);
}
}
示例5: rightClickCell
import org.fest.swing.fixture.JTableFixture; //导入依赖的package包/类
/**
* Right click on table cell
*
* @param row the row number
* @param column the column number
* @throws VerificationException if the table element doesn't exist
*/
@PublicAtsApi
public void rightClickCell(
int row,
int column ) {
new SwingElementState(this).waitToBecomeExisting();
JTableFixture tableFixture = (JTableFixture) SwingElementLocator.findFixture(this);
try {
tableFixture.cell(new TableCell(row, column) {}).rightClick();
} catch (Exception e) {
throw new UiElementException(e.getMessage(), this);
}
}
示例6: selectCell
import org.fest.swing.fixture.JTableFixture; //导入依赖的package包/类
/**
* Select table cell
*
* @param row the row number
* @param column the column number
* @throws VerificationException if the table element doesn't exist
*/
@PublicAtsApi
public void selectCell(
int row,
int column ) {
new SwingElementState(this).waitToBecomeExisting();
JTableFixture tableFixture = (JTableFixture) SwingElementLocator.findFixture(this);
try {
tableFixture.selectCell(new TableCell(row, column) {});
} catch (Exception e) {
throw new UiElementException(e.getMessage(), this);
}
}
示例7: selectCells
import org.fest.swing.fixture.JTableFixture; //导入依赖的package包/类
/**
* Select table cells
*
* @param cells the cells coordinates (eg. new int[][]{ { 1, 1 }, { 1, 2 }, { 2, 2 } )
* @throws VerificationException if the element doesn't exist
*/
@PublicAtsApi
public void selectCells(
int[][] cells ) {
new SwingElementState(this).waitToBecomeExisting();
JTableFixture tableFixture = (JTableFixture) SwingElementLocator.findFixture(this);
try {
TableCell[] cellsToSelect = new TableCell[cells.length];
for (int i = 0; i < cells.length; i++) {
int row = cells[i][0];
int column = cells[i][1];
cellsToSelect[i] = new TableCell(row, column) {};
}
tableFixture.selectCells(cellsToSelect);
} catch (Exception e) {
throw new UiElementException(e.getMessage(), this);
}
}
示例8: clickHeader
import org.fest.swing.fixture.JTableFixture; //导入依赖的package包/类
/**
* Click table header by column index
*
* @param columnIndex the column index
* @throws VerificationException if the table element doesn't exist
*/
@PublicAtsApi
public void clickHeader(
int columnIndex ) {
new SwingElementState(this).waitToBecomeExisting();
JTableFixture tableFixture = (JTableFixture) SwingElementLocator.findFixture(this);
JTableHeaderFixture tableHeaderFixture = tableFixture.tableHeader();
try {
tableHeaderFixture.clickColumn(columnIndex);
} catch (Exception e) {
throw new UiElementException(e.getMessage(), this);
}
}
示例9: getCellBackgroundColors
import org.fest.swing.fixture.JTableFixture; //导入依赖的package包/类
/**
* Gets table cell backgrounds (as {@link Color}) of all table cells.
*
* @return array of java.awt.Color objects one for each cell. First index is
* table row and second is the column in this row.
*/
@PublicAtsApi
public Color[][] getCellBackgroundColors() {
new SwingElementState(this).waitToBecomeExisting();
final JTableFixture tableFixture = (JTableFixture) SwingElementLocator.findFixture(this);
int rowCount = tableFixture.rowCount();
// SwingUtilities.
int columnCount = GuiActionRunner.execute(new GuiQuery<Integer>() {
@Override
protected Integer executeInEDT() throws Throwable {
return tableFixture.component().getColumnCount();
}
});
Color[][] resultArr = new Color[rowCount][columnCount];
for (int i = 0; i < rowCount; i++) {
for (int j = 0; j < columnCount; j++) {
resultArr[i][j] = tableFixture.backgroundAt(new TableCell(i, j) {}).target();
}
}
return resultArr;
}
示例10: testParentLabelCell
import org.fest.swing.fixture.JTableFixture; //导入依赖的package包/类
@Test @IdeGuiTest
public void testParentLabelCell() throws IOException {
IdeFrameFixture projectFrame = importSimpleApplication();
ThemeEditorFixture themeEditor = openThemeEditor(projectFrame);
JTableFixture themeEditorTable = themeEditor.getThemeEditorTable();
assertNotNull(themeEditorTable);
// Cell (0,0) should be Theme parent
JTableCellFixture parentLabelCell = themeEditorTable.cell(row(0).column(0));
final String parentName = themeEditorTable.valueAt(row(0).column(1));
assertNotNull(parentName);
parentLabelCell.requireNotEditable();
parentLabelCell.requireValue("Theme Parent");
testParentPopup(parentLabelCell, parentName, themeEditor);
}
示例11: removeDeviceByName
import org.fest.swing.fixture.JTableFixture; //导入依赖的package包/类
@NotNull
public ChooseDeviceDefinitionStepFixture removeDeviceByName(@NotNull final String deviceName) {
JTableFixture deviceListFixture = getTableFixture();
deviceListFixture.cell(deviceName).click(RIGHT_BUTTON);
JPopupMenu popupMenu = robot().findActivePopupMenu();
assertNotNull(popupMenu);
JPopupMenuFixture contextMenuFixture = new JPopupMenuFixture(robot(), popupMenu);
contextMenuFixture.menuItem(new GenericTypeMatcher<JMenuItem>(JMenuItem.class) {
@Override
protected boolean isMatching(@NotNull JMenuItem component) {
return "Delete".equals(component.getText());
}
}).click();
MessagesFixture.findByTitle(robot(), target(), "Confirm Deletion").clickYes();
return this;
}
示例12: editAvdWithName
import org.fest.swing.fixture.JTableFixture; //导入依赖的package包/类
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());
}
示例13: deleteAvdByName
import org.fest.swing.fixture.JTableFixture; //导入依赖的package包/类
public void deleteAvdByName(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);
JPopupMenu contextMenu = robot().findActivePopupMenu();
assertNotNull(contextMenu);
JPopupMenuFixture contextMenuFixture = new JPopupMenuFixture(robot(), contextMenu);
contextMenuFixture.menuItem(new GenericTypeMatcher<JMenuItem>(JMenuItem.class) {
@Override
protected boolean isMatching(@NotNull JMenuItem component) {
return "Delete".equals(component.getText());
}
}).click();
MessagesFixture.findByTitle(robot(), target(), "Confirm Deletion").clickYes();
}
示例14: linkClocksDeleteAllTest
import org.fest.swing.fixture.JTableFixture; //导入依赖的package包/类
@Test // issue #414
public void linkClocksDeleteAllTest() throws Exception {
warning("Load gopher data 26.nex, 47.nex, 59.nex");
importAlignment("examples/nexus", new File("26.nex"), new File("47.nex"), new File("59.nex"));
JTabbedPaneFixture f = beautiFrame.tabbedPane();
printBeautiState(f);
selectRows(0, 1, 2);
warning("Link clocks");
f.selectTab("Partitions");
beautiFrame.button("Link Clock Models").click();
beautiFrame.button("-").click();
JTableFixture t = beautiFrame.table();
Assertions.assertThat(t.target.getRowCount()).isEqualTo(0);
}
示例15: editKeyWithStringValue
import org.fest.swing.fixture.JTableFixture; //导入依赖的package包/类
@Test
public void editKeyWithStringValue() throws Exception {
JTableFixture editionTreeTable = frameFixture.table("editionTreeTable").cellReader(new JsonTableCellReader());
// edit 'label' key
editionTreeTable.enterValue(TableCell.row(1).column(1), "Hello");
frameFixture.button("saveButton").click();
ArgumentCaptor<DBObject> argument = ArgumentCaptor.forClass(DBObject.class);
verify(mockMongoOperations).updateMongoDocument(argument.capture());
Assert.assertEquals("{ \"_id\" : { \"$oid\" : \"50b8d63414f85401b9268b99\"} , \"label\" : \"Hello\" , \"visible\" : false , \"image\" : null }",
argument.getValue().toString());
verify(mockActionCallback, times(1)).onOperationSuccess(any(String.class));
}