Package org.eclipse.swtbot.swt.finder.results

Examples of org.eclipse.swtbot.swt.finder.results.VoidResult


   * @return this same instance.
   */
  public SWTBotTree select(final String... items) {
    assertEnabled();
    setFocus();
    asyncExec(new VoidResult() {
      public void run() {
        TreeItem[] treeItems = widget.getItems();
        List<TreeItem> selection = new ArrayList<TreeItem>();
        for (TreeItem treeItem : treeItems) {
          for (String item : items) {
View Full Code Here


   *
   * @return this same instance.
   */
  public SWTBotTree unselect() {
    assertEnabled();
    asyncExec(new VoidResult() {
      public void run() {
        log.debug(MessageFormat.format("Unselecting all in {0}", widget)); //$NON-NLS-1$
        widget.deselectAll();
      }
    });
View Full Code Here

   * @return this same instance.
   */
  public SWTBotTree select(final int... indices) {
    assertEnabled();
    setFocus();
    asyncExec(new VoidResult() {
      public void run() {
        log.debug(MessageFormat.format("Selecting rows [{0}] in tree{1}", StringUtils.join(indices, ", "), this)); //$NON-NLS-1$ //$NON-NLS-2$
        if (hasStyle(widget, SWT.MULTI) && indices.length > 1)
          log.warn("Tree does not support SWT.MULTI, cannot make multiple selections"); //$NON-NLS-1$
        TreeItem items[] = new TreeItem[indices.length];
View Full Code Here

        return new Object[] { SWTBotEvents.toString(createEvent), AbstractSWTBot.this.toString() };
      }
    });

    log.trace(MessageFormat.format("Enquing event {0} on {1}", result)); //$NON-NLS-1$
    asyncExec(new VoidResult() {
      public void run() {
        if ((widget == null) || widget.isDisposed()) {
          log.trace(MessageFormat.format("Not notifying {0} is null or has been disposed", AbstractSWTBot.this)); //$NON-NLS-1$
          return;
        }
        if (!isEnabledInternal()) {
          log.warn(MessageFormat.format("Widget is not enabled: {0}", AbstractSWTBot.this)); //$NON-NLS-1$
          return;
        }
        log.trace(MessageFormat.format("Sending event {0} to {1}", result)); //$NON-NLS-1$
        widget.notifyListeners(eventType, createEvent);
        log.debug(MessageFormat.format("Sent event {0} to {1}", result)); //$NON-NLS-1$
      }
    });

    UIThreadRunnable.syncExec(new VoidResult() {
      public void run() {
        // do nothing, just wait for sync.
      }
    });
View Full Code Here

   * @since 1.2
   */
  public void setFocus() {
    assertEnabled();
    log.debug(MessageFormat.format("Attempting to set focus on {0}", this));
    syncExec(new VoidResult() {
      public void run() {
        if (widget instanceof Control) {
          Control control = (Control) widget;
          control.getShell().forceActive();
          control.getShell().forceFocus();
View Full Code Here

   * @param post Whether or not {@link Display#post} should be used
   * @return itself.
   */
  protected AbstractSWTBot<T> click(final int x, final int y, final boolean post) {
    if (post) {
      asyncExec(new VoidResult() {
        public void run() {
          moveMouse(x, y);
          mouseDown(x, y, 1);
          mouseUp(x, y, 1);
        }
View Full Code Here

   * @param post Whether or not {@link Display#post} should be used
   * @return itself.
   */
  protected AbstractSWTBot<T> rightClick(final int x, final int y, final boolean post) {
    if (post) {
      syncExec(new VoidResult() {
        public void run() {
          moveMouse(x, y);
          mouseDown(x, y, 3);
          mouseUp(x, y, 3);
        }
View Full Code Here

   *
   * @param x the x coordinate
   * @param y the y coordinate
   */
  void moveMouse(final int x, final int y) {
    asyncExec(new VoidResult() {
      public void run() {
        Event event = createMouseEvent(x, y, 0, 0, 0);
        event.type = SWT.MouseMove;
        display.post(event);
      }
View Full Code Here

   * @param x the x coordinate
   * @param y the y coordinate
   * @param button the mouse button to be pressed
   */
  private void mouseDown(final int x, final int y, final int button) {
    asyncExec(new VoidResult() {
      public void run() {
        Event event = createMouseEvent(x, y, button, 0, 0);
        event.type = SWT.MouseDown;
        display.post(event);
      }
View Full Code Here

   * @param x the x coordinate
   * @param y the y coordinate
   * @param button the mouse button to be pressed
   */
  private void mouseUp(final int x, final int y, final int button) {
    asyncExec(new VoidResult() {
      public void run() {
        Event event = createMouseEvent(x, y, button, 0, 0);
        event.type = SWT.MouseUp;
        display.post(event);
      }
View Full Code Here

TOP

Related Classes of org.eclipse.swtbot.swt.finder.results.VoidResult

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.