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

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


  public SWTBotToolbarPushButton toolbarPushButton(String tooltip) throws WidgetNotFoundException {
    SWTBotToolbarButton abstractButton = toolbarButton(tooltip);
    if (abstractButton instanceof SWTBotToolbarPushButton)
      return (SWTBotToolbarPushButton) abstractButton;

    throw new WidgetNotFoundException("Unable to find toolitem with the given tooltip '" + tooltip + "'"); //$NON-NLS-1$ //$NON-NLS-2$
  }
View Full Code Here


  public SWTBotToolbarToggleButton toolbarToggleButton(String tooltip) throws WidgetNotFoundException {
    SWTBotToolbarButton abstractButton = toolbarButton(tooltip);
    if (abstractButton instanceof SWTBotToolbarToggleButton)
      return (SWTBotToolbarToggleButton) abstractButton;

    throw new WidgetNotFoundException("Unable to find toolitem with the given tooltip '" + tooltip + "'"); //$NON-NLS-1$ //$NON-NLS-2$
  }
View Full Code Here

      if (item.getToolTipText().equals(tooltip)) {
        return item;
      }
    }

    throw new WidgetNotFoundException("Unable to find toolitem with the given tooltip '" + tooltip + "'"); //$NON-NLS-1$ //$NON-NLS-2$
  }
View Full Code Here

    boolean shouldFindInvisibleControls = finder.shouldFindInvisibleControls();
    finder.setShouldFindInvisibleControls(true);
    try {
      return bot.widgets(matcher, control);
    } catch (Exception e) {
      throw new WidgetNotFoundException("Could not find any control inside the view " + partReference.getPartName(), e); //$NON-NLS-1$
    } finally {
      finder.setShouldFindInvisibleControls(shouldFindInvisibleControls);
    }
  }
View Full Code Here

        List<SWTBotCommand> command = finder.findCommand(equalTo(label));
        return command.get(index);
      }
      return menuItems.get(index);
    } catch (Exception e) {
      throw new WidgetNotFoundException("Could not find view menu with label " + label + " at index " + index, e); //$NON-NLS-1$ //$NON-NLS-2$
    }
  }
View Full Code Here

        try {
          IWorkbench workbench = PlatformUI.getWorkbench();
          workbench.showPerspective(perspectiveDescriptor.getId(), workbench.getActiveWorkbenchWindow());
        } catch (Exception e) {
          // TODO: what's the correct exception for such an error? Own exception class?
          throw new WidgetNotFoundException(e.getMessage(), e);
        }
      }
    });
  }
View Full Code Here

        }
        return results;
      }
    });
    if (foundItems.isEmpty())
      throw new WidgetNotFoundException("Could not find node with text: " + nodeText); //$NON-NLS-1$
    return foundItems;
  }
View Full Code Here

        public boolean test() throws Exception {
          return getItem(nodeText) != null;
        }
      });
    } catch (TimeoutException e) {
      throw new WidgetNotFoundException("Timed out waiting for tree item " + nodeText, e); //$NON-NLS-1$
    }
    return new SWTBotTreeItem(getItem(nodeText));
  }
View Full Code Here

  public void waitUntilWidgetAppears(ICondition waitForWidget) {
    try {
      waitUntil(waitForWidget);
    } catch (TimeoutException e) {
      throw new WidgetNotFoundException("Could not find widget.", e); //$NON-NLS-1$
    }
  }
View Full Code Here

   */
  @SuppressWarnings("unchecked")
  public SWTBotTrayItem trayItemWithTooltip(String tooltip, int index) {
    java.util.List<SWTBotTrayItem> items = trayItems(allOf(widgetOfType(TrayItem.class), withTooltip(tooltip)));
    if (items.isEmpty() || items.size() <= index)
      throw new WidgetNotFoundException("Widget does not contain an item at index " + index);
    return items.get(index);
  }
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.