editionTreeTable.replaceCellReader(new JsonTableCellReader()); editionTreeTable.cell(TableCell.row(1).column(1)) .doubleClick() .enterValue("Hello");
editionTreeTable.replaceCellReader(new JsonTableCellReader()); editionTreeTable.requireContents(new String[][]{ {"_id", "50b8d63414f85401b9268b99"}, {"title", "XP by example"}, {"[2]", "[{ \"tagName\" : \"pouet\" }, { \"tagName\" : \"paf\" }]"}}); editionTreeTable.selectCell(TableCell.row(3).column(1)); mongoEditionPanel.addValue("refactor"); editionTreeTable.requireContents(new String[][]{ {"_id", "50b8d63414f85401b9268b99"}, {"title", "XP by example"},
/** * Simulates a user clicking a cell in this fixture's {@code JTable} once, using the specified mouse button. * * @param cell the cell to click. * @param button the mouse button to use. * @return this fixture. * @throws NullPointerException if the cell is {@code null}. * @throws IllegalStateException if this fixture's {@code JTable} is disabled. * @throws IllegalStateException if this fixture's {@code JTable} is not showing on the screen. * @throws IndexOutOfBoundsException if any of the indices (row and column) is out of bounds. */ @Nonnull public JTableFixture click(@Nonnull TableCell cell, @Nonnull MouseButton button) { click(cell, button, 1); return this; }
/** * Creates a new {@link JTableCellFixture}. * * @param table handles the {@code JTable} containing the cell in this fixture. * @param cell row and column indices of the table cell to be managed by this fixture. * @throws NullPointerException if {@code table} is {@code null}. * @throws NullPointerException if {@code cell} is {@code null}. */ protected JTableCellFixture(@Nonnull JTableFixture table, @Nonnull TableCell cell) { this(table, cell, table.target(), table.driver()); }
/** * Returns a fixture that verifies the background color of the given table cell. * * @param cell the given table cell. * @return a fixture that verifies the background color of the given table cell. * @throws NullPointerException if the cell is {@code null}. * @throws IndexOutOfBoundsException if any of the indices (row and column) is out of bounds. */ @Nonnull public ColorFixture backgroundAt(@Nonnull TableCell cell) { Color background = driver().background(target(), cell); return new ColorFixture(checkNotNull(background), cellProperty(cell, BACKGROUND_PROPERTY)); }
/** * Shows a pop-up menu at the given cell. * * @param cell the table cell where to show the pop-up menu. * @return a fixture that manages the displayed pop-up menu. * @throws NullPointerException if the cell is {@code null}. * @throws IllegalStateException if this fixture's {@code JTable} is disabled. * @throws IllegalStateException if this fixture's {@code JTable} is not showing on the screen. * @throws org.assertj.swing.exception.ComponentLookupException if a pop-up menu cannot be found. */ @Nonnull public JPopupMenuFixture showPopupMenuAt(@Nonnull TableCell cell) { return new JPopupMenuFixture(robot(), driver().showPopupMenuAt(target(), cell)); } }
while (table.cell(TableCell.row(0).column(0)).value().equals("[..]")) { LOGGER.info("Clicking on [..]"); table.cell("[..]").click(); table.pressAndReleaseKey(KeyPressInfo.keyCode('\n')); Thread.sleep(250); } else { LOGGER.info(" clicking on " + dir); final JTableCellFixture cell = table.cell(dir); LOGGER.info(" table cell: " + cell.value()); cell.doubleClick(); vfsBrowserDialog.textBox("VfsBrowser.filter").setText(name); vfsBrowserDialog.button("VfsBrowser.refresh").click(); await().ignoreExceptions().until(() -> table.cell(TableCell.row(1).column(0)).click()); vfsBrowserDialog.button("VfsBrowser.open").click(); LOGGER.info(" file " + file.getAbsolutePath() + " opened");
/** * Simulates a user selecting this fixture's table cell. * * @return this fixture. * @throws IllegalStateException if this fixture's {@code JTable} is disabled. * @throws IllegalStateException if this fixture's {@code JTable} is not showing on the screen. */ @Override @Nonnull public JTableCellFixture select() { table.selectCell(cell()); return this; }
@RunsInEDT @Override @Nonnull public JTableFixture table(@Nonnull GenericTypeMatcher<? extends JTable> matcher) { return new JTableFixture(robot(), find(matcher)); }
public void replaceCellReader(@Nonnull JTableCellReader cellReader) { driver().replaceCellReader(cellReader); }
/** * Asserts that this fixture's {@link JTable} contains a column whose name matches the given one. * * @param columnName the name of the column to look for. * @return this fixture. * @throws org.assertj.swing.exception.ActionFailedException if a column with a matching name could not be found. */ public JTableFixture requireColumnNamed(String columnName) { columnIndexFor(columnName); return this; }
/** * Simulates a user dragging this fixture's table cell. * * @return this fixture. */ @Override @Nonnull public JTableCellFixture drag() { table.drag(cell()); return this; }
/** * Returns a fixture that verifies the background color of this fixture's table cell. This method uses the * {@link org.assertj.swing.cell.JTableCellReader} from the {@link JTableFixture} that created this fixture. * * @return a fixture that verifies the background color of this fixture's table cell. * @see JTableFixture#replaceCellReader(org.assertj.swing.cell.JTableCellReader) * @see org.assertj.swing.cell.JTableCellReader */ @Nonnull public ColorFixture background() { return table.backgroundAt(cell()); }
public LogsTable hasValueInRow(int row, String content){ await() .ignoreExceptions() .until(() -> Arrays.stream(me().contents()[row]).anyMatch(c -> c.equals(content))); return this; }
/** * Returns a fixture that verifies the font of the given table cell. * * @param cell the given table cell. * @return a fixture that verifies the font of the given table cell. * @throws NullPointerException if the cell is {@code null}. * @throws IndexOutOfBoundsException if any of the indices (row and column) is out of bounds. */ public FontFixture fontAt(@Nonnull TableCell cell) { Font font = driver().font(target(), cell); return new FontFixture(checkNotNull(font), cellProperty(cell, FONT_PROPERTY)); }
/** * @return a {@code JTableHeaderFixture} wrapping the {@code JTableHeader} in this fixture's {@code JTable}. * @throws AssertionError if the {@code JTableHeader} in this fixture's {@code JTable} is {@code null}. */ @Nonnull public JTableHeaderFixture tableHeader() { JTableHeader tableHeader = driver().tableHeaderOf(target()); return new JTableHeaderFixture(robot(), checkNotNull(tableHeader)); }
@RunsInEDT @Override @Nonnull public JTableFixture table(@Nullable String name) { return new JTableFixture(robot(), findByName(name, JTable.class)); }
public void replaceCellWriter(JTableCellWriter cellWriter) { driver().replaceCellWriter(cellWriter); }
/** * Returns the index of the column in this fixture's {@code JTable} whose name matches the given one. * * @param columnName the name of the column to look for. * @return the index of the column whose name matches the given one. * @throws org.assertj.swing.exception.ActionFailedException if a column with a matching name could not be found. */ public int columnIndexFor(@Nonnull Object columnName) { return driver().columnIndex(target(), columnName); }