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

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


    assertEquals("//Shell/-1//TabFolder/0//TabItem/5", string);
  }

  @Test
  public void getsPathFromInvalidString() throws Exception {
    TreePath path = new PathGenerator().getPathFromString("//", display);
    assertEquals(null, path);
  }
View Full Code Here


  }

  @Test
  @SuppressWarnings("unchecked")
  public void getsPathFromString() throws Exception {
    TreePath path = new PathGenerator().getPathFromString("//Shell/0//TabFolder/0//TabItem/5", display);
    Matcher<TabItem> withText = withText("Dialog");
    List<TabItem> tabItems = controlFinder.findControls(allOf(widgetOfType(TabItem.class), withText));
    TreePath expected = controlFinder.getPath(tabItems.get(0));

    assertEquals(expected, path);
  }
View Full Code Here

  public void getsControlPath() throws Exception {
    selectCTabFolder();
    Matcher<CTabItem> withText = withText("CTabItem 1");
    List<CTabItem> labels = controlFinder.findControls(allOf(widgetOfType(CTabItem.class), withText));
    Widget w = labels.get(0);
    TreePath path = controlFinder.getPath(w);
    assertEquals(8, path.getSegmentCount());
  }
View Full Code Here

    buf.append("\tBounds: " + control.getBounds() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
    buf.append("\n"); //$NON-NLS-1$
  }

  public void getLocationInformation(Control control, StringBuffer buf) {
    TreePath path = controlFinder.getPath(control);
    String stringFromPath = new PathGenerator().getPathAsString(path);
    buf.append("Location: \n").append(stringFromPath).append("\n\n"); //$NON-NLS-1$ //$NON-NLS-2$
  }
View Full Code Here

  public void getParentInformation(Control control, StringBuffer buf) {
    Composite parent = control.getParent();
    if (parent != null) {
      buf.append("Parent Tree:\n"); //$NON-NLS-1$

      TreePath parents = controlFinder.getPath(control).getParentPath();

      int segmentCount = parents.getSegmentCount();
      for (int i = segmentCount - 1; i >= 0; i--) {
        String prefix = ""; //$NON-NLS-1$
        Widget segment = (Widget) parents.getSegment(i);
        for (int j = 0; j < segmentCount - i - 1; j++)
          prefix += "\t"; //$NON-NLS-1$

        buf.append(prefix + renderWidget(segment) + "[" + SWTUtils.widgetIndex(segment) + "]" + "@" + "\n"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
        if (segment instanceof Composite) {
View Full Code Here

TOP

Related Classes of org.eclipse.swtbot.swt.finder.utils.TreePath

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.