Package org.eclipse.swtbot.swt.finder.utils

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


  @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

    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

  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

   */
  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

Related Classes of org.eclipse.swtbot.swt.finder.utils.TableCollection

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.