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

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


   * @throws WidgetNotFoundException if the widget is not found or is disposed.
   */
  @SuppressWarnings({"unchecked", "rawtypes"})
  public SWTBotCombo comboBox(String text, int index) {
    Matcher matcher = allOf(widgetOfType(Combo.class), withText(text));
    return new SWTBotCombo((Combo) widget(matcher, index), matcher);
  }
View Full Code Here


   * @throws WidgetNotFoundException if the widget is not found or is disposed.
   */
  @SuppressWarnings({"unchecked", "rawtypes"})
  public SWTBotCombo comboBoxWithId(String key, String value, int index) {
    Matcher matcher = allOf(widgetOfType(Combo.class), withId(key, value));
    return new SWTBotCombo((Combo) widget(matcher, index), matcher);
  }
View Full Code Here

    String previous = rw.parseCommit(repo.resolve("HEAD")).name();

    touchAndSubmit(null);
    SWTBotShell pushDialog = openPushDialog();

    SWTBotCombo destinationCombo = pushDialog.bot().comboBox();
    String[] items = destinationCombo.items();
    for (int i = 0; i < items.length; i++) {
      if (items[i].startsWith(destination))
        destinationCombo.setSelection(i);
    }

    pushDialog.bot().button(IDialogConstants.NEXT_LABEL).click();
    if (withConfirmPage)
      pushDialog.bot().button(IDialogConstants.NEXT_LABEL).click();
    pushDialog.bot().button(IDialogConstants.FINISH_LABEL).click();
    SWTBotShell confirm = bot.shell(NLS.bind(UIText.PushResultDialog_title,
        destination));
    String result = confirm.bot().tree().getAllItems()[0].getText();

    assertTrue("Wrong result", result.contains(previous.substring(0, 7)));

    confirm.close();

    pushDialog = openPushDialog();

    destinationCombo = pushDialog.bot().comboBox();
    for (int i = 0; i < items.length; i++) {
      if (items[i].startsWith(destination))
        destinationCombo.setSelection(i);
    }

    pushDialog.bot().button(IDialogConstants.NEXT_LABEL).click();
    if (withConfirmPage)
      pushDialog.bot().button(IDialogConstants.NEXT_LABEL).click();
View Full Code Here

    createRepoDialog.bot()
        .textWithLabel(UIText.CreateRepositoryPage_DirectoryLabel)
        .setText(repoFolder.getAbsolutePath());
    createRepoDialog.bot().button(IDialogConstants.FINISH_LABEL).click();

    SWTBotCombo combo = bot
        .comboBoxWithLabel(UIText.ExistingOrNewPage_ExistingRepositoryLabel);
    assertTrue(combo.getText().startsWith(repoName));
    Repository targetRepo = lookupRepository(new File(repoFolder,
        Constants.DOT_GIT));

    assertTrue(combo.getText()
        .endsWith(targetRepo.getDirectory().getPath()));
    assertEquals(
        targetRepo.getWorkTree().getPath(),
        bot.textWithLabel(
            UIText.ExistingOrNewPage_WorkingDirectoryLabel)
View Full Code Here

  public PushBranchWizardTester(SWTBot wizard) {
    this.wizard = wizard;
  }

  public void selectRemote(String remoteName) {
    SWTBotCombo remoteCombo = wizard
        .comboBoxWithLabel(UIText.PushBranchPage_RemoteLabel);
    String[] items = remoteCombo.items();
    for (String item : items) {
      if (item.startsWith(remoteName + ":")) {
        remoteCombo.setSelection(item);
        return;
      }
    }
    throw new IllegalStateException("Could not select remote '"
        + remoteName + "', items were: " + Arrays.toString(items));
View Full Code Here

    SWTBotText uri = uri();
    uri.setText(uri.getText() + toAppend);
  }

  public void setPushDestination(String destination) {
    SWTBotCombo destinationCombo = bot.comboBox();
    String[] items = destinationCombo.items();
    for (int i = 0; i < items.length; i++)
      if (items[i].startsWith(destination)) {
        destinationCombo.setSelection(i);
        return;
      }
    fail("Could not find destination " + destination);
  }
View Full Code Here

  public PushTagsWizardTester(SWTBot wizard) {
    this.wizard = wizard;
  }

  public void selectRemote(String remoteName) {
    SWTBotCombo remoteCombo = wizard
        .comboBoxWithLabel(UIText.PushTagsPage_RemoteLabel);
    String[] items = remoteCombo.items();
    for (String item : items) {
      if (item.startsWith(remoteName + ":")) {
        remoteCombo.setSelection(item);
        return;
      }
    }
    throw new IllegalStateException("Could not select remote '"
        + remoteName + "', items were: " + Arrays.toString(items));
View Full Code Here

   * @throws WidgetNotFoundException if the widget is not found or is disposed.
   */
  @SuppressWarnings({"unchecked", "rawtypes"})
  public SWTBotCombo comboBoxWithLabel(String label, int index) {
    Matcher matcher = allOf(widgetOfType(Combo.class), withLabel(label));
    return new SWTBotCombo((Combo) widget(matcher, index), matcher);
  }
View Full Code Here

   * @throws WidgetNotFoundException if the widget is not found or is disposed.
   */
  @SuppressWarnings({"unchecked", "rawtypes"})
  public SWTBotCombo comboBox(String text, int index) {
    Matcher matcher = allOf(widgetOfType(Combo.class), withText(text));
    return new SWTBotCombo((Combo) widget(matcher, index), matcher);
  }
View Full Code Here

   * @throws WidgetNotFoundException if the widget is not found or is disposed.
   */
  @SuppressWarnings({"unchecked", "rawtypes"})
  public SWTBotCombo comboBoxWithId(String key, String value, int index) {
    Matcher matcher = allOf(widgetOfType(Combo.class), withId(key, value));
    return new SWTBotCombo((Combo) widget(matcher, index), matcher);
  }
View Full Code Here

TOP

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

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.