Esempio n. 1
0
  /* (non-Javadoc)
   * @see com.windowtester.runtime.IUIContext#dragTo(com.windowtester.runtime.locator.ILocator, int)
   */
  public IWidgetLocator dragTo(ILocator locator, int mods) throws WidgetSearchException {

    /*
     * This is a bit tricky since we don't want to handle conditions WHILE a key is
     * down and the actual drag is being done in a subclass who is free to handle conditions...
     *
     * The current work-around is to "go native"
     *
     */
    // LogHandler.log("modifiers in dragTo ignored -- not implemented");
    // go native so that conditions are not handled while the key is down
    boolean isStatePreDragNative = applicationContext.isNative(); // cache for restore
    applicationContext.setNative();
    try {
      getDriver().mouseDown(mods);
      return dragTo(locator);
    } finally {
      getDriver().mouseUp(mods);
      // restore state
      if (!isStatePreDragNative) applicationContext.setDefault();
    }
  }