Package org.netbeans.jemmy.operators

Examples of org.netbeans.jemmy.operators.JTreeOperator


    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]);
            }
            final Point p = toper.getPointToClick(indices[index]);
            queueTool.invokeSmoothly(new QueueTool.QueueAction("Path selecting") {
                    public Object launch() {
                        mdriver.clickMouse(oper, p.x, p.y, 1, Operator.getDefaultMouseButton(),
                                           (index == 0) ? 0 : InputEvent.CTRL_MASK, clickTime);
                        return(null);
View Full Code Here


        //end of 1.5 workaround
    }

    public void expandItem(ComponentOperator oper, final int index) {
  checkSupported(oper);
  final JTreeOperator toper = (JTreeOperator)oper;
  final MouseDriver mdriver = DriverManager.getMouseDriver(oper);
  if(!toper.isExpanded(index)) {
            queueTool.invokeSmoothly(new QueueTool.QueueAction("Path selecting") {
                    public Object launch() {
                        Point p = toper.getPointToClick(index);
                        mdriver.clickMouse(toper, p.x, p.y, 2, Operator.getDefaultMouseButton(),
                                           0, toper.getTimeouts().
                                           create("ComponentOperator.MouseClickTimeout"));
                        return(null);
                    }
                });
  }
View Full Code Here

  }
    }

    public void collapseItem(ComponentOperator oper, final int index) {
  checkSupported(oper);
  final JTreeOperator toper = (JTreeOperator)oper;
  final MouseDriver mdriver = DriverManager.getMouseDriver(oper);
  if(toper.isExpanded(index)) {
            queueTool.invokeSmoothly(new QueueTool.QueueAction("Path selecting") {
                    public Object launch() {
                        Point p = toper.getPointToClick(index);
                        mdriver.clickMouse(toper, p.x, p.y, 2, Operator.getDefaultMouseButton(),
                                           0, toper.getTimeouts().
                                           create("ComponentOperator.MouseClickTimeout"));
                        return(null);
                    }
                });
  }
View Full Code Here

  startEditingAndReturnEditor(oper, index, waitEditorTime);
    }

    private JTextComponentOperator startEditingAndReturnEditor(ComponentOperator oper, final int index, Timeout waitEditorTime) {
  checkSupported(oper);
  final JTreeOperator toper = (JTreeOperator)oper;
  final MouseDriver mdriver = DriverManager.getMouseDriver(oper);
        queueTool.invokeSmoothly(new QueueTool.QueueAction("Path selecting") {
                public Object launch() {
                    Point p = toper.getPointToClick(index);
                    mdriver.clickMouse(toper, p.x, p.y, 1, Operator.getDefaultMouseButton(),
         0, toper.getTimeouts().
         create("ComponentOperator.MouseClickTimeout"));
                    return(null);
                }
            });
  oper.getTimeouts().sleep("JTreeOperator.BeforeEditTimeout");
        queueTool.invokeSmoothly(new QueueTool.QueueAction("Path selecting") {
                public Object launch() {
                    Point p = toper.getPointToClick(index);
                    mdriver.clickMouse(toper, p.x, p.y, 1, Operator.getDefaultMouseButton(),
                                       0, toper.getTimeouts().
                                       create("ComponentOperator.MouseClickTimeout"));
                    return(null);
                }
            });
  toper.getTimeouts().
      setTimeout("ComponentOperator.WaitComponentTimeout", waitEditorTime.getValue());
  return(new JTextComponentOperator((JTextComponent)toper.
            waitSubComponent(new JTextComponentOperator.
                 JTextComponentFinder())));
    }
View Full Code Here

  startEditing(oper, index, waitEditorTime);
    }

    private JTextComponentOperator startEditingAndReturnEditor(ComponentOperator oper, int index, Timeout waitEditorTime) {
  checkSupported(oper);
  JTreeOperator toper = (JTreeOperator)oper;
  toper.startEditingAtPath(toper.getPathForRow(index));
  toper.getTimeouts().
      setTimeout("ComponentOperator.WaitComponentTimeout", waitEditorTime.getValue());
  return(new JTextComponentOperator((JTextComponent)toper.
            waitSubComponent(new JTextComponentOperator.
                 JTextComponentFinder())));
    }
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");
        for(int i = 0; i < indices.length; i++) {
            final int index = i;
            if(!queueTool.isDispatchThread()) {
                toper.scrollToRow(indices[i]);
            }
            final Point p = toper.getPointToClick(indices[index]);
            queueTool.invokeSmoothly(new QueueTool.QueueAction("Path selecting") {
                    public Object launch() {
                        mdriver.clickMouse(oper, p.x, p.y, 1, Operator.getDefaultMouseButton(),
                                           (index == 0) ? 0 : InputEvent.CTRL_MASK, clickTime);
                        return(null);
View Full Code Here

        //end of 1.5 workaround
    }

    public void expandItem(ComponentOperator oper, final int index) {
  checkSupported(oper);
  final JTreeOperator toper = (JTreeOperator)oper;
  final MouseDriver mdriver = DriverManager.getMouseDriver(oper);
  if(!toper.isExpanded(index)) {
            queueTool.invokeSmoothly(new QueueTool.QueueAction("Path selecting") {
                    public Object launch() {
                        Point p = toper.getPointToClick(index);
                        mdriver.clickMouse(toper, p.x, p.y, 2, Operator.getDefaultMouseButton(),
                                           0, toper.getTimeouts().
                                           create("ComponentOperator.MouseClickTimeout"));
                        return(null);
                    }
                });
  }
View Full Code Here

  }
    }

    public void collapseItem(ComponentOperator oper, final int index) {
  checkSupported(oper);
  final JTreeOperator toper = (JTreeOperator)oper;
  final MouseDriver mdriver = DriverManager.getMouseDriver(oper);
  if(toper.isExpanded(index)) {
            queueTool.invokeSmoothly(new QueueTool.QueueAction("Path selecting") {
                    public Object launch() {
                        Point p = toper.getPointToClick(index);
                        mdriver.clickMouse(toper, p.x, p.y, 2, Operator.getDefaultMouseButton(),
                                           0, toper.getTimeouts().
                                           create("ComponentOperator.MouseClickTimeout"));
                        return(null);
                    }
                });
  }
View Full Code Here

  startEditingAndReturnEditor(oper, index, waitEditorTime);
    }

    private JTextComponentOperator startEditingAndReturnEditor(ComponentOperator oper, final int index, Timeout waitEditorTime) {
  checkSupported(oper);
  final JTreeOperator toper = (JTreeOperator)oper;
  final MouseDriver mdriver = DriverManager.getMouseDriver(oper);
        queueTool.invokeSmoothly(new QueueTool.QueueAction("Path selecting") {
                public Object launch() {
                    Point p = toper.getPointToClick(index);
                    mdriver.clickMouse(toper, p.x, p.y, 1, Operator.getDefaultMouseButton(),
         0, toper.getTimeouts().
         create("ComponentOperator.MouseClickTimeout"));
                    return(null);
                }
            });
  oper.getTimeouts().sleep("JTreeOperator.BeforeEditTimeout");
        queueTool.invokeSmoothly(new QueueTool.QueueAction("Path selecting") {
                public Object launch() {
                    Point p = toper.getPointToClick(index);
                    mdriver.clickMouse(toper, p.x, p.y, 1, Operator.getDefaultMouseButton(),
                                       0, toper.getTimeouts().
                                       create("ComponentOperator.MouseClickTimeout"));
                    return(null);
                }
            });
  toper.getTimeouts().
      setTimeout("ComponentOperator.WaitComponentTimeout", waitEditorTime.getValue());
  return(new JTextComponentOperator((JTextComponent)toper.
            waitSubComponent(new JTextComponentOperator.
                 JTextComponentFinder())));
    }
View Full Code Here

  startEditing(oper, index, waitEditorTime);
    }

    private JTextComponentOperator startEditingAndReturnEditor(ComponentOperator oper, int index, Timeout waitEditorTime) {
  checkSupported(oper);
  JTreeOperator toper = (JTreeOperator)oper;
  toper.startEditingAtPath(toper.getPathForRow(index));
  toper.getTimeouts().
      setTimeout("ComponentOperator.WaitComponentTimeout", waitEditorTime.getValue());
  return(new JTextComponentOperator((JTextComponent)toper.
            waitSubComponent(new JTextComponentOperator.
                 JTextComponentFinder())));
    }
View Full Code Here

TOP

Related Classes of org.netbeans.jemmy.operators.JTreeOperator

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.