Package org.eclipse.swtbot.swt.finder.widgets

Examples of org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem


      assertEquals("Wrong branch", nodeTexts[1], repo.getBranch());
  }

  private void checkout(String[] nodeTexts) throws Exception {
    SWTBotShell dialog = openCheckoutBranchDialog();
    SWTBotTreeItem parentNode = dialog.bot().tree()
        .getTreeItem(nodeTexts[0]).expand();
    TestUtil.getChildNode(parentNode, nodeTexts[1]).select();
    TableCollection tc = dialog.bot().tree().selection();
    assertEquals("Wrong selection count", 1, tc.rowCount());
    assertTrue("Wrong item selected", tc.get(0, 0).startsWith(nodeTexts[1]));
View Full Code Here


      assertEquals(rows[i].isSelected(),
          bot.tree().getAllItems()[i].isChecked());
      assertEquals(rows[i].getProject(), bot.tree().cell(i, 0));
      assertEquals(rows[i].getPath(), bot.tree().cell(i, 1));
      assertEquals(rows[i].getRepository(), bot.tree().cell(i, 2));
      SWTBotTreeItem subteeItems = bot.tree().getAllItems()[i];
      Row[] subrows = rows[i].getSubrows();
      if (subrows != null) {
        assertEquals("Row " + i + " is a tree:", subrows.length,
            subteeItems.getItems().length);
        assertNotNull("Rows " + i + " is not a tree",
            subteeItems.getItems());
        for (int j = 0; j < subrows.length; ++j) {
          Row r = subrows[j];
          assertEquals(r.isSelected(),
              subteeItems.getItems()[j].isChecked());
          assertEquals(r.getProject(), subteeItems.cell(j, 0));
          assertEquals(r.getPath(), subteeItems.cell(j, 1));
          assertEquals(r.getRepository(), subteeItems.cell(j, 2));
        }
      } else
        assertEquals("Row " + i + " is a tree:", 0,
            subteeItems.getItems().length);
    }
  }
View Full Code Here

  public int getRowCount() {
    return commitDialog.bot().tree().rowCount();
  }

  public String getEntryText(int rowIndex) {
    SWTBotTreeItem treeItem = commitDialog.bot().tree().getAllItems()[rowIndex];
    return treeItem.cell(1);
  }
View Full Code Here

        .styledTextWithLabel(UIText.CommitDialog_CommitMessage)
        .getText();
  }

  public boolean isEntryChecked(int rowIndex) {
    SWTBotTreeItem treeItem = commitDialog.bot().tree().getAllItems()[rowIndex];
    return treeItem.isChecked();
  }
View Full Code Here

    getGitConfigurationPreferencePage();
  }

  private void getGitConfigurationPreferencePage() {
    preferencePage = new Eclipse().openPreferencePage(preferencePage);
    SWTBotTreeItem team = preferencePage.bot().tree().getTreeItem("Team");
    team.expand()
        .getNode(util.getPluginLocalizedValue("GitPreferences_name"))
        .expand()
        .getNode(util.getPluginLocalizedValue("ConfigurationPage.name"))
        .select();
  }
View Full Code Here

  @Test
  public void testNodes() throws Exception {
    SWTBotTree configTree = preferencePage.bot().tree(1);
    for (String section : config.getSections()) {
      SWTBotTreeItem sectionItem = configTree.getTreeItem(section);
      for (String subsection : config.getSubsections(section)) {
        SWTBotTreeItem subsectionItem = sectionItem.getNode(subsection);
        for (String entryName : config.getNames(section, subsection))
          try {
            subsectionItem.getNode(entryName);
          } catch (WidgetNotFoundException e) {
            subsectionItem.getNode(entryName + "[0]");
          }

      }
      for (String entryName : config.getNames(section))
        try {
View Full Code Here

    TestUtil.showExplorerView();
  }

  protected void changeFilesInProject() throws Exception {
    SWTBot packageExlBot = bot.viewByTitle("Package Explorer").bot();
    SWTBotTreeItem coreTreeItem = selectProject(PROJ1, packageExlBot.tree());
    SWTBotTreeItem rootNode = coreTreeItem.expand().getNode(0)
        .expand().select();
    rootNode.getNode(0).select().doubleClick();

    SWTBotEditor corePomEditor = bot.editorByTitle(FILE1);
    corePomEditor.toTextEditor()
        .insertText("<!-- EGit jUnit test case -->");
    corePomEditor.saveAndClose();

    rootNode.getNode(1).select().doubleClick();
    SWTBotEditor uiPomEditor = bot.editorByTitle(FILE2);
    uiPomEditor.toTextEditor().insertText("<!-- EGit jUnit test case -->");
    uiPomEditor.saveAndClose();
    coreTreeItem.collapse();
  }
View Full Code Here

    TestUtil.joinJobs(JobFamilies.COMMIT);
  }

  protected CompareEditorTester getCompareEditor(SWTBotTreeItem projectNode,
      final String fileName) {
    SWTBotTreeItem folderNode = waitForNodeWithText(projectNode, FOLDER);
    waitForNodeWithText(folderNode, fileName).doubleClick();

    return CompareEditorTester.forTitleContaining(fileName);
  }
View Full Code Here

    // then
    SWTBotTree syncViewTree = bot.viewByTitle("Synchronize").bot().tree();
    assertEquals(1, syncViewTree.getAllItems().length);

    SWTBotTreeItem projectTree = waitForNodeWithText(syncViewTree, PROJ1);
    assertEquals(1, projectTree.getItems().length);

    SWTBotTreeItem folderTree = waitForNodeWithText(projectTree, FOLDER);
    assertEquals(1, folderTree.getItems().length);

    SWTBotTreeItem fileTree = folderTree.getItems()[0];
    assertEquals("test.txt", fileTree.getText());
  }
View Full Code Here

    // when
    launchSynchronization(EMPTY_PROJECT, "", "", true);

    // then
    SWTBotTree syncViewTree = bot.viewByTitle("Synchronize").bot().tree();
    SWTBotTreeItem projectTree = waitForNodeWithText(syncViewTree,
        EMPTY_PROJECT);
    assertEquals(1, syncViewTree.getAllItems().length);

    SWTBotTreeItem folderTree = waitForNodeWithText(projectTree, FOLDER);
    assertEquals(2, folderTree.getItems().length);

    SWTBotTreeItem fileTree = folderTree.getItems()[0];
    assertEquals(FILE1, fileTree.getText());
    fileTree = folderTree.getItems()[1];
    assertEquals(FILE2, fileTree.getText());
  }
View Full Code Here

TOP

Related Classes of org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem

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.