Exemple #1
0
  @Test
  public void getsTextCellBasedOnRowNumberColumnText() throws Exception {
    bot.checkBox("Multiple Columns").select();
    tree = bot.treeInGroup("Tree");

    assertEquals("2556", tree.cell(1, "Size"));
    assertEquals("Node 2", tree.cell(1, "Name"));
    assertEquals("today", tree.cell(3, "Modified"));
  }
Exemple #2
0
  @Test
  public void getsColumnTextBasedOnRowColumnNumbers() throws Exception {
    bot.checkBox("Multiple Columns").select();
    tree = bot.treeInGroup("Tree");

    assertEquals("2556", tree.cell(1, 2));
    assertEquals("Node 2", tree.cell(1, 0));
    assertEquals("today", tree.cell(3, 3));
  }
Exemple #3
0
 @Test
 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));
 }
Exemple #4
0
  @Test
  public void getsAllColumnHeadings() throws Exception {
    bot.checkBox("Multiple Columns").select();
    tree = bot.treeInGroup("Tree");
    ArrayList<String> arrayList = new ArrayList<String>();
    arrayList.add("Name");
    arrayList.add("Type");
    arrayList.add("Size");
    arrayList.add("Modified");

    assertEquals(arrayList, tree.columns());
  }
Exemple #5
0
 public void setUp() throws Exception {
   super.setUp();
   bot = new SWTBot();
   bot.tabItem("Tree").activate();
   bot.checkBox("Listen").deselect();
   bot.button("Clear").click();
   bot.checkBox("Horizontal Fill").select();
   bot.checkBox("Vertical Fill").select();
   bot.checkBox("Header Visible").select();
   bot.checkBox("Multiple Columns").deselect();
   tree = bot.treeInGroup("Tree");
 }
Exemple #6
0
 @Test
 public void expandsNode() throws Exception {
   bot.checkBox("Multiple Columns").select();
   bot.checkBox("Listen").select();
   Widget notifications = bot.textInGroup("Listeners").widget;
   tree = bot.treeInGroup("Tree");
   tree.expandNode("Node 2");
   assertEquals(6, tree.visibleRowCount());
   assertTextContains("Expand [17]: TreeEvent{Tree {} time=", notifications);
   assertTextContains(
       "data=null item=TreeItem {Node 2} detail=0 x=0 y=0 width=0 height=0 stateMask=0 text=null doit=true}",
       notifications);
 }
Exemple #7
0
 @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);
 }
Exemple #8
0
 @Test
 public void expandsNodeToMax() throws Exception {
   bot.checkBox("Multiple Columns").select();
   bot.checkBox("Listen").select();
   tree = bot.treeInGroup("Tree");
   tree.expandNode("Node 2", true);
   assertEquals(7, tree.visibleRowCount());
   assertTextContains(
       "data=null item=TreeItem {Node 2} detail=0 x=0 y=0 width=0 height=0 stateMask=0 text=null doit=true}",
       bot.textInGroup("Listeners").widget);
   assertTextContains(
       "data=null item=TreeItem {Node 2.2} detail=0 x=0 y=0 width=0 height=0 stateMask=0 text=null doit=true}",
       bot.textInGroup("Listeners").widget);
 }
Exemple #9
0
  @Test
  public void getsMultipleSingleSelection() throws Exception {
    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));
  }
Exemple #10
0
 @Test
 public void getsColumnCountOnMultiColumnTree() throws Exception {
   bot.checkBox("Multiple Columns").select();
   tree = bot.treeInGroup("Tree");
   assertEquals(4, tree.columnCount());
 }