public void before() {
   aListener = new _XRangeSelection.MyRangeSelectionListener(log);
   // workaround for i34499
   XModel xModel = (XModel) tEnv.getObjRelation("FirstModel");
   if (xModel == null)
     throw new StatusException(Status.failed("Object relation FirstModel' not set."));
   XWindow xWindow = xModel.getCurrentController().getFrame().getContainerWindow();
   XTopWindow xTopWindow = UnoRuntime.queryInterface(XTopWindow.class, xWindow);
   xTopWindow.toFront();
   util.utils.shortWait(500);
 }
Example #2
0
  /**
   * Removes a listener added before.
   *
   * <p>Has <b>OK</b> status always.
   *
   * <p>The following method tests are to be completed successfully before :
   *
   * <ul>
   *   <li><code> toBack </code> : to have a definite method execution order.
   * </ul>
   */
  public void _removeTopWindowListener() {
    executeMethod("toBack()");

    oObj.removeTopWindowListener(listener);

    tRes.tested("removeTopWindowListener()", true);
  }
Example #3
0
  /**
   * Adds a listener .
   *
   * <p>Has <b>OK</b> status always (listener calls are checked in other methods.
   *
   * <p>
   */
  public void _addTopWindowListener() {
    listener = new TestListener(log);

    oObj.addTopWindowListener(listener);

    tRes.tested("addTopWindowListener()", true);
  }
Example #4
0
  /**
   * Moves the window to front and check the listener calls.
   *
   * <p>Has <b>OK</b> status if listener <code>activated</code> method was called.
   */
  public void _toFront() {
    requiredMethod("addTopWindowListener()");
    listener.initListener();
    oObj.toFront();
    waitForEventIdle();

    tRes.tested("toFront()", listener.activated && !listener.deactivated);
  }
Example #5
0
  /**
   * Creates a simple menu bar and adds to the window.
   *
   * <p>Has <b>OK</b> status if no runtime exceptions occurred.
   */
  public void _setMenuBar() {
    XMenuBar menu = null;
    boolean result = true;

    try {
      menu =
          UnoRuntime.queryInterface(
              XMenuBar.class, tParam.getMSF().createInstance("com.sun.star.awt.MenuBar"));
    } catch (com.sun.star.uno.Exception e) {
      log.println("Can't instanciate MenuBar service");
      result = false;
    }

    menu.insertItem((short) 1, "MenuItem", com.sun.star.awt.MenuItemStyle.CHECKABLE, (short) 1);

    oObj.setMenuBar(menu);

    tRes.tested("setMenuBar()", result);
  }
Example #6
0
 /**
  * This method doesn't do anything the Office implementation.
  *
  * <p>So it has always <b>OK</b> status
  */
 public void _toBack() {
   oObj.toBack();
   tRes.tested("toBack()", true);
 }