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

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


    }


    public String getSelectedConnection()
    {
        TableCollection selection = getConnectionsTree().selection();
        if ( selection != null && selection.rowCount() == 1 )
        {
            TableRow row = selection.get( 0 );
            return row.get( 0 );
        }
        return null;
    }
View Full Code Here


        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();
    assertTrue("Selection should contain one eelement",
        selection.rowCount() == 1);
    nodeText = selection.get(0).get(0);
      assertEquals("Node text should contain file name", FILE1, nodeText);
  }
View Full Code Here

    item.select();
    ContextMenuHelper.clickContextMenu(tree, myUtil
        .getPluginLocalizedValue("ImportProjectsCommand"));
    SWTBotShell shell = bot.shell(wizardTitle);
    bot.radio(UIText.GitSelectWizardPage_ImportExistingButton).click();
    TableCollection selected = shell.bot().tree().selection();
    String wizardNode = selected.get(0, 0);
    // wizard directory should be working dir
    assertEquals(myRepoViewUtil.getWorkdirItem(tree, repositoryFile)
        .getText(), wizardNode);
    shell.close();
    // start wizard from .git
    myRepoViewUtil.getWorkdirItem(tree, repositoryFile).expand().getNode(
        Constants.DOT_GIT).select();
    ContextMenuHelper.clickContextMenu(tree, myUtil
        .getPluginLocalizedValue("ImportProjectsCommand"));
    shell = bot.shell(wizardTitle);
    selected = shell.bot().tree().selection();
    wizardNode = selected.get(0, 0);
    // wizard directory should be .git
    assertEquals(Constants.DOT_GIT, wizardNode);
    shell.bot().button(IDialogConstants.NEXT_LABEL).click();
    shell.bot().label("Import Projects"); // wait for import projects page
    assertEquals(0, shell.bot().tree().getAllItems().length);
View Full Code Here

        .getPluginLocalizedValue("ImportProjectsCommand"));
    SWTBotShell shell = bot.shell(wizardTitle);
    shell = bot.shell(wizardTitle);
    // try import existing project first
    bot.radio(UIText.GitSelectWizardPage_ImportExistingButton).click();
    TableCollection selected = shell.bot().tree().selection();
    String wizardNode = selected.get(0, 0);
    // wizard directory should be PROJ2
    assertEquals(PROJ2, wizardNode);
    shell.bot().button(IDialogConstants.NEXT_LABEL).click();
    shell.bot().text(" " + UIText.GitProjectsImportPage_NoProjectsMessage);
    assertEquals(0, shell.bot().tree().getAllItems().length);
View Full Code Here

  }

  private void checkoutAndVerify(String[] nodeTexts)
      throws IOException, Exception {
    SWTBotShell dialog = openCheckoutBranchDialog();
    TableCollection tc = dialog.bot().tree().selection();
    assertEquals("Wrong selection count", 0, tc.rowCount());

    SWTBotTreeItem parentNode = dialog.bot().tree()
        .getTreeItem(nodeTexts[0]).expand();
    TestUtil.getChildNode(parentNode, nodeTexts[1]).select();
    tc = dialog.bot().tree().selection();
    assertEquals("Wrong selection count", 1, tc.rowCount());
    assertTrue("Wrong item selected", tc.get(0, 0).startsWith(nodeTexts[1]));

    Repository repo = lookupRepository(repositoryFile);

    dialog.bot().button(UIText.CheckoutDialog_OkCheckout).click();
    TestUtil.joinJobs(JobFamilies.CHECKOUT);
View Full Code Here

  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]));

    dialog.bot().button(UIText.CheckoutDialog_OkCheckout).click();
    TestUtil.joinJobs(JobFamilies.CHECKOUT);
  }
View Full Code Here

    assertEquals("tomorrow", table.cell(7, "Modified"));
  }

  @Test
  public void getsSelectionCount() throws Exception {
    TableCollection selection = table.selection();
    assertEquals(new TableCollection(), selection);
    assertEquals(0, selection.columnCount());
    assertEquals(0, selection.rowCount());
    assertEquals(0, table.selectionCount());
  }
View Full Code Here

  }

  @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

  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

  }

  @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

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.