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

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


  public SWTBotTreeItem getSymbolicRefsItem(SWTBotTree tree,
      File repositoryFile) throws Exception {
    Repository repository = lookupRepository(repositoryFile);
    RepositoryNode root = new RepositoryNode(null, repository);
    AdditionalRefsNode symrefsnode = new AdditionalRefsNode(root, repository);
    SWTBotTreeItem rootItem = tree.getTreeItem(
        labelProvider.getStyledText(root).getString()).expand();
    SWTBotTreeItem symrefsitem = rootItem.getNode(labelProvider
        .getText(symrefsnode));
    return symrefsitem;
  }
View Full Code Here


    Repository repository = lookupRepository(repositoryFile);
    RepositoryNode root = new RepositoryNode(null, repository);
    RemotesNode remotes = new RemotesNode(root, repository);

    String rootText = labelProvider.getStyledText(root).getString();
    SWTBotTreeItem rootItem = tree.getTreeItem(rootText);
    SWTBotTreeItem remotesItem = rootItem.expand().getNode(
        labelProvider.getStyledText(remotes).getString());
    return remotesItem;
  }
View Full Code Here

    createTag("FirstTag", "The first tag");
    touchAndSubmit(null);
    String newObject = getObjectIdOfCommit();
    createTag("SecondTag", "The second tag");
    refreshAndWait();
    SWTBotTreeItem tagsItem = myRepoViewUtil.getTagsItem(tree,
        repositoryFile).expand();
    SWTBotTreeItem[] items = tagsItem.getItems();
    assertEquals("Wrong number of tags", initialCount + 2, items.length);

    assertTrue("Wrong commit id", initialObjid
        .equals(getCommitIdOfTag("FirstTag")));
    assertTrue("Wrong commit id", newObject
View Full Code Here

    int initialCount = myRepoViewUtil.getTagsItem(tree, repositoryFile)
        .expand().rowCount();

    createTag("Delete1", "The first tag");
    refreshAndWait();
    SWTBotTreeItem tagsItem = myRepoViewUtil.getTagsItem(tree,
        repositoryFile).expand();
    SWTBotTreeItem[] items = tagsItem.getItems();
    assertEquals("Wrong number of tags", initialCount + 1, items.length);
    tagsItem.select("Delete1");
    ContextMenuHelper.clickContextMenu(tree,
        myUtil.getPluginLocalizedValue("DeleteTagCommand.name"));
    bot.shell(UIText.DeleteTagCommand_titleConfirm).bot()
        .button(IDialogConstants.OK_LABEL).click();
    TestUtil.joinJobs(JobFamilies.TAG);
    refreshAndWait();
    tagsItem = myRepoViewUtil.getTagsItem(tree, repositoryFile).expand();
    items = tagsItem.getItems();
    assertEquals("Wrong number of tags", initialCount, items.length);
  }
View Full Code Here

        .expand().rowCount();

    createTag("Delete2", "The first tag");
    createTag("Delete3", "The second tag");
    refreshAndWait();
    SWTBotTreeItem tagsItem = myRepoViewUtil.getTagsItem(tree,
        repositoryFile).expand();
    SWTBotTreeItem[] items = tagsItem.getItems();
    assertEquals("Wrong number of tags", initialCount + 2, items.length);
    tagsItem.select("Delete2", "Delete3");
    ContextMenuHelper.clickContextMenu(tree,
        myUtil.getPluginLocalizedValue("DeleteTagCommand.name"));
    bot.shell(UIText.DeleteTagCommand_titleConfirm).bot()
        .button(IDialogConstants.OK_LABEL).click();
    TestUtil.joinJobs(JobFamilies.TAG);
    refreshAndWait();
    tagsItem = myRepoViewUtil.getTagsItem(tree, repositoryFile).expand();
    items = tagsItem.getItems();
    assertEquals("Wrong number of tags", initialCount, items.length);
  }
View Full Code Here

    getOrOpenView().show();

    SWTBotView view = TestUtil.showExplorerView();
    SWTBotTree explorerTree = view.bot().tree();
    SWTBotTreeItem projectItem = getProjectItem(explorerTree, PROJ1)
        .select();
    ContextMenuHelper.clickContextMenuSync(explorerTree, "Show In",
        viewName);
    refreshAndWait();
    assertHasRepo(repositoryFile);
    SWTBotTree viewerTree = getOrOpenView().bot().tree();

    TableCollection selection = viewerTree.selection();
    assertTrue("Selection should contain one element",
        selection.rowCount() == 1);
    String nodeText = selection.get(0).get(0);
    assertTrue("Node text should contain project name", projectItem
        .getText().startsWith(nodeText));

    view.show();
    projectItem.expand().getNode(FOLDER).expand().getNode(FILE1).select();

    ContextMenuHelper.clickContextMenuSync(explorerTree, "Show In",
        viewName);

    selection = viewerTree.selection();
View Full Code Here

   * @throws Exception
   */
  @Test
  public void testExpandFirstLevel() throws Exception {
    SWTBotTree tree = getOrOpenView().bot().tree();
    SWTBotTreeItem item = myRepoViewUtil.getRootItem(tree, repositoryFile)
        .expand();
    SWTBotTreeItem[] children = item.getItems();
    assertEquals("Wrong number of children", 5, children.length);
  }
View Full Code Here

   */
  @Test
  public void testOpen() throws Exception {
    // expand first level
    SWTBotTree tree = getOrOpenView().bot().tree();
    SWTBotTreeItem item = myRepoViewUtil.getRootItem(tree, repositoryFile);
    item.collapse();
    refreshAndWait();
    item = myRepoViewUtil.getRootItem(tree, repositoryFile);
    assertTrue("Item should not be expanded", !item.isExpanded());
    item.doubleClick();
    assertTrue("Item should be expanded", item.isExpanded());
    // open a file in editor
    item = myRepoViewUtil.getWorkdirItem(tree, repositoryFile).expand();
    SWTBotTreeItem fileiItem = item.getNode(PROJ1).expand().getNode(FOLDER)
        .expand().getNode(FILE1).select();
    fileiItem.doubleClick();
    assertTrue(bot.activeEditor().getTitle().equals(FILE1));
    bot.activeEditor().close();
    // open a branch (checkout)
    checkoutWithDoubleClick(tree, "master");
    String contentMaster = getTestFileContent();
View Full Code Here

   * @throws Exception
   */
  @Test
  public void testExpandSymbolicRef() throws Exception {
    SWTBotTree tree = getOrOpenView().bot().tree();
    SWTBotTreeItem item = myRepoViewUtil.getSymbolicRefsItem(tree,
        repositoryFile).expand();
    List<String> children = item.getNodes();
    boolean found = false;
    for (String child : children)
      if (child.contains(Constants.HEAD))
        found = true;
    assertTrue(found);
View Full Code Here

  @Test
  public void testContextMenuRepository() throws Exception {
    // We just check if the dialogs open, the actual commit and import projects
    // is tested elsewhere
    SWTBotTree tree = getOrOpenView().bot().tree();
    SWTBotTreeItem item = myRepoViewUtil.getRootItem(tree, repositoryFile);
    item.select();
    assertClickOpens(tree,
        myUtil.getPluginLocalizedValue("RepoViewCommit.label"),
        UIText.CommitDialog_CommitChanges);
    assertClickOpens(tree,
        myUtil.getPluginLocalizedValue("RepoViewImportProjects.label"),
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.