/** * Simulates a user right-clicking 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 rightClick() { return click(RIGHT_BUTTON); }
.doubleClick() .enterValue("Hello");
/** * Simulates a user double-clicking 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 doubleClick() { table.click(cell(), LEFT_BUTTON, 2); return this; }
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); 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");
/** * Returns a {@link JTableCellFixture} wrapping the table cell specified by the given row and column. * * @param cell the cell of interest. * @return a {@code JTableCellFixture} wrapping the table cell specified by the given row and column. * @throws NullPointerException if the cell is {@code null}. * @throws IndexOutOfBoundsException if any of the indices (row and column) is out of bounds. */ @Nonnull public JTableCellFixture cell(@Nonnull TableCell cell) { driver().checkCellIndicesInBounds(target(), cell); return new JTableCellFixture(this, cell); }
/** * Returns a {@link JTableCellFixture} wrapping the table cell whose value matches the given regular expression * pattern. * * @param valuePattern the regular expression pattern to match. * @return a {@code JTableCellFixture} wrapping the table cell whose value matches the given regular expression * pattern. * @throws NullPointerException if the given regular expression pattern is {@code null}. * @throws org.assertj.swing.exception.ActionFailedException if a cell with a matching value cannot be found. */ @Nonnull public JTableCellFixture cell(@Nonnull Pattern valuePattern) { TableCell cell = driver().cell(target(), valuePattern); return new JTableCellFixture(this, cell); }
/** * Returns the {@code String} representation of the value 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 the {@code String} representation of the value of this fixture's table cell. * @see JTableFixture#replaceCellReader(org.assertj.swing.cell.JTableCellReader) * @see org.assertj.swing.cell.JTableCellReader */ @Override @Nullable public String value() { return table.valueAt(cell()); }
/** * Returns a {@link JTableCellFixture} wrapping the table cell found by the given {@link TableCellFinder}. * * @param cellFinder knows how to find a cell. * @return a {@code JTableCellFixture} wrapping the table cell found by the given {@code TableCellFinder} * @throws NullPointerException if the {@code TableCellFinder} is {@code null}. * @throws org.assertj.swing.exception.ActionFailedException if a matching cell could not be found. * @throws IndexOutOfBoundsException if the row or column indices in the found cell are out of bounds. */ @Nonnull public JTableCellFixture cell(@Nonnull TableCellFinder cellFinder) { TableCell cell = driver().cell(target(), cellFinder); return new JTableCellFixture(this, cell); }
/** * Simulates a user dragging this fixture's table cell. * * @return this fixture. */ @Override @Nonnull public JTableCellFixture drag() { table.drag(cell()); return this; }
/** * Returns a {@link JTableCellFixture} wrapping the table cell whose value matches the given one. * * @param value the value of the cell to look for. It can be a regular expression. * @return a {@code JTableCellFixture} wrapping the table cell whose value matches the given one. * @throws org.assertj.swing.exception.ActionFailedException if a cell with a matching value cannot be found. */ @Nonnull public JTableCellFixture cell(String value) { TableCell cell = driver().cell(target(), value); return new JTableCellFixture(this, cell); }
/** * Returns a fixture that verifies the foreground 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 foreground color of this fixture's table cell. * @see JTableFixture#replaceCellReader(org.assertj.swing.cell.JTableCellReader) * @see org.assertj.swing.cell.JTableCellReader */ @Nonnull public ColorFixture foreground() { return table.foregroundAt(cell()); }
/** * Asserts that this fixture's table cell is not editable. * * @return this fixture. * @throws AssertionError if this fixture's table cell is editable. */ @Nonnull public JTableCellFixture requireNotEditable() { table.requireNotEditable(cell()); return this; }
/** * 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; }
/** * Simulates a user unselecting 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. */ @Nonnull public JTableCellFixture unselect() { table.unselectCell(cell()); return this; }
/** * Shows a pop-up menu using this fixture's table cell as the invoker of the pop-up menu. * * @return a fixture that manages the displayed pop-up menu. * @throws org.assertj.swing.exception.ComponentLookupException if a pop-up menu cannot be found. */ @Override @Nonnull public JPopupMenuFixture showPopupMenu() { return table.showPopupMenuAt(cell()); }
/** * Asserts that the value of this fixture's table cell matches the given regular expression pattern. * * @param pattern the regular expression pattern to match. * @return this fixture. * @throws NullPointerException if the given regular expression pattern is {@code null}. * @throws AssertionError if the value of this fixture's table cell does not match the expected the given regular * expression pattern. */ @Nonnull public JTableCellFixture requireValue(@Nonnull Pattern pattern) { table.requireCellValue(cell(), pattern); return this; }
/** * Simulates a user clicking 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 click() { table.click(cell(), LEFT_BUTTON); return this; }
/** * Asserts that the value of this fixture's table cell matches the given value. * * @param value the expected value of this fixture's table cell. It can be a regular expression. * @return this fixture. * @throws AssertionError if the value of this fixture's table cell does not match the expected one. */ @Nonnull public JTableCellFixture requireValue(@Nullable String value) { table.requireCellValue(cell(), value); return this; }
/** * Returns a fixture that verifies the font 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 font of this fixture's table cell. * @see JTableFixture#replaceCellReader(org.assertj.swing.cell.JTableCellReader) * @see org.assertj.swing.cell.JTableCellReader */ public FontFixture font() { return table.fontAt(cell()); }
/** * 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()); }