Package org.fest.swing.data

Examples of org.fest.swing.data.TableCell


   * @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 ActionFailedException if a cell with a matching value cannot be found.
   */
  public @Nonnull JTableCellFixture cell(String value) {
    TableCell cell = driver().cell(target(), value);
    return new JTableCellFixture(this, cell);
  }
View Full Code Here


   * @throws NullPointerException if the given regular expression pattern is {@code null}.
   * @throws ActionFailedException if a cell with a matching value cannot be found.
   * @since 1.2
   */
  public @Nonnull JTableCellFixture cell(@Nonnull Pattern valuePattern) {
    TableCell cell = driver().cell(target(), valuePattern);
    return new JTableCellFixture(this, cell);
  }
View Full Code Here

   * @throws NullPointerException if the {@code TableCellFinder} is {@code null}.
   * @throws 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.
   */
  public @Nonnull JTableCellFixture cell(@Nonnull TableCellFinder cellFinder) {
    TableCell cell = driver().cell(target(), cellFinder);
    return new JTableCellFixture(this, cell);
  }
View Full Code Here

   * @throws ActionFailedException if a matching cell could not be found.
   */
  @RunsInEDT
  public @Nonnull TableCell cell(@Nonnull JTable table, @Nonnull TableCellFinder cellFinder) {
    checkNotNull(cellFinder);
    TableCell cell = cellFinder.findCell(table, cellReader());
    checkCellIndicesInBounds(table, cell);
    return cell;
  }
View Full Code Here

* @author Yvonne Wang
*/
public class JTableDriver_cellByText_Test extends JTableDriver_TestCase {
  @Test
  public void should_find_cell_having_value_that_matches_given_pattern() {
    TableCell cell = driver.cell(table, "1.*");
    assertThat(cell.row).isEqualTo(1);
    assertThat(cell.column).isEqualTo(0);
    assertThatCellReaderWasCalled();
  }
View Full Code Here

  @Test
  public void should_show_popup_menu() {
    showWindow();
    driver.click(table);
    ClickRecorder recorder = attachTo(table);
    TableCell cell = row(0).column(1);
    JPopupMenu found = driver.showPopupMenuAt(table, cell);
    assertThat(found).isSameAs(popupMenu);
    assertThat(recorder).clicked(RIGHT_BUTTON).timesClicked(1);
    assertThatCellWasClicked(cell, recorder.pointClicked());
  }
View Full Code Here

    cellFinder = mock(TableCellFinder.class);
  }

  @Test
  public void should_use_TableCellFinder_to_find_a_cell() {
    TableCell cell = row(0).column(0);
    when(cellFinder.findCell(table, driver.cellReader())).thenReturn(cell);
    TableCell found = driver.cell(table, cellFinder);
    assertThat(found).isSameAs(cell);
  }
View Full Code Here

    assertThat(found).isSameAs(cell);
  }

  @Test(expected = IndexOutOfBoundsException.class)
  public void should_throw_error_if_indices_in_found_cell_are_out_of_bounds() {
    TableCell cell = row(-1).column(0);
    when(cellFinder.findCell(table, driver.cellReader())).thenReturn(cell);
    driver.cell(table, cellFinder);
  }
View Full Code Here

public class JTableDriver_clickCell_Test extends JTableDriver_TestCase {
  @Test
  public void should_click_cell() {
    showWindow();
    ClickRecorder recorder = attachTo(table);
    TableCell cell = row(0).column(1);
    driver.click(table, cell, LEFT_BUTTON, 3);
    assertThat(recorder).clicked(LEFT_BUTTON).timesClicked(3);
    assertThatCellWasClicked(cell, recorder.pointClicked());
  }
View Full Code Here

* @author Yvonne Wang
*/
public class JTableDriver_cellByPattern_Test extends JTableDriver_TestCase {
  @Test
  public void should_find_cell_having_value_that_matches_given_pattern() {
    TableCell cell = driver.cell(table, Pattern.compile("1.*"));
    assertThat(cell.row).isEqualTo(1);
    assertThat(cell.column).isEqualTo(0);
    assertThatCellReaderWasCalled();
  }
View Full Code Here

TOP

Related Classes of org.fest.swing.data.TableCell

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.