Package org.eclipse.swtbot.swt.finder.exceptions

Examples of org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException


        matchingItems.add(item);
      texts.add(text);
    }

    if (matchingItems.isEmpty())
      throw new WidgetNotFoundException(
          "Tree item element containg text \"" + searchText
              + "\" was not found. Existing tree items:\n"
              + StringUtils.join(texts, "\n"));
    else if (matchingItems.size() > 1)
      throw new WidgetNotFoundException(
          "Tree item element containg text \""
              + searchText
              + "\" could not be uniquely identified. All tree items:\n"
              + StringUtils.join(texts, "\n"));
View Full Code Here


            return theItem;
          }
        });
    if (menuItem == null)
      throw new WidgetNotFoundException("Could not find menu: "
          + Arrays.asList(texts));

    // click
    click(menuItem, sync);
View Full Code Here

              enabled.set(true);
            return theItem;
          }
        });
    if (menuItem == null)
      throw new WidgetNotFoundException("Could not find menu: "
          + Arrays.asList(texts));
    // hide
    UIThreadRunnable.syncExec(new VoidResult() {
      public void run() {
        if (menuItem.isDisposed())
View Full Code Here

   * @param graphicalViewer the graphical viewer to wrap
   * @throws WidgetNotFoundException if graphical viewer is null
   */
  public SWTBotGefViewer(final GraphicalViewer graphicalViewer) throws WidgetNotFoundException {
    if (graphicalViewer == null) {
      throw new WidgetNotFoundException("The graphical viewer is null.");
    }
    this.graphicalViewer = graphicalViewer;
    init();
  }
View Full Code Here

        editDomain = graphicalViewer.getEditDomain();
      }
    });

    if (graphicalViewer == null) {
      throw new WidgetNotFoundException("Editor does not adapt to a GraphicalViewer");
    }
  }
View Full Code Here

  }

  public SWTBotGefEditPart mainEditPart() throws WidgetNotFoundException {
    List<SWTBotGefEditPart> children = rootEditPart().children();
    if (children.size() != 1) {
      throw new WidgetNotFoundException(String.format("Root edit part has %s children", children.size()));
    }
    return children.get(0);
  }
View Full Code Here

        if (entries.size() > 0) {
          final PaletteEntry paletteEntry = entries.get(index);
          if (paletteEntry instanceof ToolEntry) {
            editDomain.getPaletteViewer().setActiveTool((ToolEntry) paletteEntry);
          } else {
            exception[0] = new WidgetNotFoundException(String.format("%s is not a tool entry, it's a %s", labelMatcher
                .toString(), paletteEntry.getClass().getName()));
          }
        } else {
          exception[0] = new WidgetNotFoundException(labelMatcher.toString());
        }
      }
    });
    if (exception[0] != null) {
      throw exception[0];
View Full Code Here

    List<? extends Text> controls = bot().widgets(widgetOfType(Text.class), canvas.widget);
    if (controls.size() == 1) {
      final Text textControl = controls.get(0);
      canvas.typeText(textControl, text);
    } else {
      throw new WidgetNotFoundException(String.format(
          "Expected to find one text control, but found %s.  Is the editor in direct-edit mode?", controls.size()));
    }
  }
View Full Code Here

   * @param label the label to retrieve edit part to click on
   */
  public void click(final String label) {
    SWTBotGefEditPart selectedEP = getEditPart(label);
    if (selectedEP == null) {
      throw new WidgetNotFoundException(String.format("Expected to find widget %s", label));
    }
    click(selectedEP);
  }
View Full Code Here

   * @param label the label to retrieve edit part to double click on
   */
  public void doubleClick(final String label) {
    SWTBotGefEditPart selectedEP = getEditPart(label);
    if (selectedEP == null) {
      throw new WidgetNotFoundException(String.format("Expected to find widget %s", label));
    }
    doubleClick(selectedEP);
  }
View Full Code Here

TOP

Related Classes of org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException

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.