Examples of TableCollection


Examples of org.eclipse.swtbot.swt.finder.utils.TableCollection

  }

  @Test
  public void getsSingleSelection() throws Exception {
    table.select(10);
    TableCollection selection = table.selection();
    assertEquals(1, selection.rowCount());
    assertEquals(4, selection.columnCount());
    assertEquals(new TableCollection().add(new TableRow(new String[] { "Index:10", "databases", "2556", "tomorrow" })), selection);
  }
View Full Code Here

Examples of org.eclipse.swtbot.swt.finder.utils.TableCollection

  public void getsMultipleSingleSelection() throws Exception {
    bot.radio("SWT.MULTI").click();
    table = bot.tableInGroup("Table");
    table.select(new int[] { 5, 10 });

    TableCollection selection = table.selection();
    assertEquals("Index:5", selection.get(0, 0));
    assertEquals("images", selection.get(0, 1));
    assertEquals("91571", selection.get(0, 2));
    assertEquals("yesterday", selection.get(0, 3));

    assertEquals(new TableRow(new String[] { "Index:10", "databases", "2556", "tomorrow" }), selection.get(1));
  }
View Full Code Here

Examples of org.eclipse.swtbot.swt.finder.utils.TableCollection

  }

  @Test
  public void selectsItemsBasedOnString() throws Exception {
    table.select("Index:9");
    TableCollection selection = table.selection();
    assertEquals("Index:9", selection.get(0, 0));
  }
View Full Code Here

Examples of org.eclipse.swtbot.swt.finder.utils.TableCollection

  public void setsMultipleSelection() throws Exception {
    bot.radio("SWT.MULTI").click();
    tree = bot.treeInGroup("Tree");
    tree.select(new String[] { "Node 2", "Node 4" });
    assertEquals(2, tree.selectionCount());
    TableCollection selection = tree.selection();
    assertEquals("Node 2", selection.get(0, 0));
    assertEquals("Node 4", selection.get(1, 0));
  }
View Full Code Here

Examples of org.eclipse.swtbot.swt.finder.utils.TableCollection

  @Test
  public void getsSingleSelection() throws Exception {
    bot.checkBox("Multiple Columns").select();
    tree = bot.treeInGroup("Tree");
    tree.select(2);
    TableCollection selection = tree.selection();
    assertEquals(1, selection.rowCount());
    assertEquals(4, selection.columnCount());
    assertEquals(new TableCollection().add(new TableRow(new String[] { "Node 3", "images", "91571", "yesterday" })), selection);
  }
View Full Code Here

Examples of org.eclipse.swtbot.swt.finder.utils.TableCollection

    bot.radio("SWT.MULTI").click();
    bot.checkBox("Multiple Columns").select();
    tree = bot.treeInGroup("Tree");
    tree.select(new int[] { 1, 2 });

    TableCollection selection = tree.selection();
    assertEquals("Node 2", selection.get(0, 0));
    assertEquals("databases", selection.get(0, 1));
    assertEquals("2556", selection.get(0, 2));
    assertEquals("tomorrow", selection.get(0, 3));

    assertEquals(new TableRow(new String[] { "Node 3", "images", "91571", "yesterday" }), selection.get(1));
  }
View Full Code Here

Examples of org.eclipse.swtbot.swt.finder.utils.TableCollection

  public TableCollection selection() {
    final int columnCount = columnCount();

    return syncExec(new Result<TableCollection>() {
      public TableCollection run() {
        final TableCollection selection = new TableCollection();
        TreeItem[] items = widget.getSelection();
        for (TreeItem item : items) {
          TableRow tableRow = new TableRow();
          if (columnCount == 0)
            tableRow.add(item.getText());
          else
            for (int j = 0; j < columnCount; j++)
              tableRow.add(item.getText(j));
          selection.add(tableRow);
        }
        return selection;
      }
    });
  }
View Full Code Here

Examples of org.eclipse.swtbot.swt.finder.utils.TableCollection

   */
  public TableCollection selection() {
    final int columnCount = columnCount();
    return syncExec(new Result<TableCollection>() {
      public TableCollection run() {
        final TableCollection selection = new TableCollection();
        TableItem[] items = widget.getSelection();
        for (TableItem item : items) {
          TableRow tableRow = new TableRow();
          for (int j = 0; j < columnCount; j++)
            tableRow.add(item.getText(j));
          selection.add(tableRow);
        }
        return selection;
      }
    });
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.