Package org.netbeans.jemmy

Examples of org.netbeans.jemmy.Timeout


    public void scrollToMinimum(ComponentOperator oper, int orientation) {
  startDragging(oper);
  Point pnt = new Point(0, 0);
  drag(oper, pnt);
  Timeout sleepTime = oper.getTimeouts().create("Waiter.TimeDelta");
  while(((JScrollBarOperator)oper).getValue() >
        ((JScrollBarOperator)oper).getMinimum()) {
      sleepTime.sleep();
  }
  drop(oper, pnt);
    }
View Full Code Here


    public void scrollToMaximum(ComponentOperator oper, int orientation) {
  startDragging(oper);
  Point pnt = new Point(oper.getWidth() - 1, oper.getHeight() - 1);
  drag(oper, pnt);
  Timeout sleepTime = oper.getTimeouts().create("Waiter.TimeDelta");
  while(((JScrollBarOperator)oper).getValue() >
        (((JScrollBarOperator)oper).getMaximum() -
         ((JScrollBarOperator)oper).getVisibleAmount())) {
      sleepTime.sleep();
  }
  drop(oper, pnt);
    }
View Full Code Here

                            x = lessButton.getWidth() / 2;
                        } else {
                            return(null);
                        }
                        DriverManager.getMouseDriver(oper).
                            clickMouse(oper, x, y, 1, oper.getDefaultMouseButton(), 0, new Timeout("", 0));
                    }
                    return(null);
                }
            });
    }
View Full Code Here

    public void selectItems(final ComponentOperator oper, int[] indices) {
        ((JTreeOperator)oper).clearSelection();
        checkSupported(oper);
        final MouseDriver mdriver = DriverManager.getMouseDriver(oper);
        final JTreeOperator toper = (JTreeOperator)oper;
        final Timeout clickTime = oper.getTimeouts().create("ComponentOperator.MouseClickTimeout");
        QueueTool qt = new QueueTool();
        for(int i = 0; i < indices.length; i++) {
            final int index = i;
            if(!queueTool.isDispatchThread()) {
                toper.scrollToRow(indices[i]);
View Full Code Here

   
    /**
     * Creates a new instance of AppleMenuDriver
     */
    public AppleMenuDriver() {
        super(new Timeout("apple.system.menu.delay", 100),
                new String[] {"org.netbeans.jemmy.operators.JMenuBarOperator"});
    }
View Full Code Here

        super(new Timeout("apple.system.menu.delay", 100),
                new String[] {"org.netbeans.jemmy.operators.JMenuBarOperator"});
    }
   
    public Object pushMenu(ComponentOperator oper, PathChooser chooser) {
        Timeout maxTime = oper.getTimeouts().create("ComponentOperator.WaitComponentTimeout");
        JMenuBar bar = (JMenuBar)(oper.getSource());
        activateMenu(bar);
        MenuElement menuObject;
        maxTime.start();
        while(!chooser.checkPathComponent(0, (menuObject = getSelectedElement(bar)))) {
            pressKey(KeyEvent.VK_RIGHT, 0);
            releaseKey(KeyEvent.VK_RIGHT, 0);
            if(maxTime.expired()) {
                throw(new TimeoutExpiredException("AppleMenuDriver: can not find an appropriate menu!"));
            }
        }
        for(int depth = 1; depth < chooser.getDepth(); depth++) {
            // TODO - wait for menu item
View Full Code Here

     */
    protected void doPushAndWait(ComponentOperator oper, ScrollAdjuster adj) {
  int direction = adj.getScrollDirection();
  int orientation = adj.getScrollOrientation();
  if(direction != adj.DO_NOT_TOUCH_SCROLL_DIRECTION) {
      Timeout delta = getScrollDeltaTimeout(oper);
      startPushAndWait(oper, direction, orientation);
      while(adj.getScrollDirection() == direction) {
    delta.sleep();
      }
      stopPushAndWait(oper, direction, orientation);
  }
    }
View Full Code Here

    }
    public void enterText(ComponentOperator oper, String text) {
  changeText(oper, text);
  DriverManager.getKeyDriver(oper).
      pushKey(oper, KeyEvent.VK_ENTER, 0,
        new Timeout("", 0));
    }
View Full Code Here

    }
    public void clearText(ComponentOperator oper) {
  DriverManager.getFocusDriver(oper).giveFocus(oper);
  checkSupported(oper);
  KeyDriver kdriver = DriverManager.getKeyDriver(oper);
  Timeout pushTime = oper.getTimeouts().create("ComponentOperator.PushKeyTimeout");
  Timeout betweenTime = getBetweenTimeout(oper);
  while(getCaretPosition(oper) > 0) {
      kdriver.typeKey(oper, KeyEvent.VK_BACK_SPACE, (char)KeyEvent.VK_BACK_SPACE, 0, pushTime);
      betweenTime.sleep();
  }
  while(getText(oper).length() > 0) {
      kdriver.pushKey(oper, KeyEvent.VK_DELETE, 0, pushTime);
      betweenTime.sleep();
  }
    }
View Full Code Here

    }
    public void typeText(ComponentOperator oper, String text, int caretPosition) {
  changeCaretPosition(oper, caretPosition);
  KeyDriver kDriver = DriverManager.getKeyDriver(oper);
  CharBindingMap map = oper.getCharBindingMap();
  Timeout pushTime = oper.getTimeouts().create("ComponentOperator.PushKeyTimeout");
  Timeout betweenTime = getBetweenTimeout(oper);
  char[] crs = text.toCharArray();
  for(int i = 0; i < crs.length; i++) {
      kDriver.typeKey(oper, map.getCharKey(crs[i]), crs[i], map.getCharModifiers(crs[i]), pushTime);
      betweenTime.sleep();
  }
    }
View Full Code Here

TOP

Related Classes of org.netbeans.jemmy.Timeout

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.