Package org.uispec4j.interception.toolkit

Examples of org.uispec4j.interception.toolkit.UISpecDisplay


   *
   * @throws Error if no popup is shown before the timeout expires.
   */
  public static MenuItem run(final Trigger trigger) {
    PopupHandler interceptor = new PopupHandler();
    final UISpecDisplay display = UISpecDisplay.instance();
    try {
      display.add(interceptor);
      display.setCurrentPopup(null);
      TriggerRunner.runInSwingThread(trigger);
      UISpecAssert.waitUntil("No popup was shown",
                             new Assertion() {
                               public void check() {
                                 if (display.getCurrentPopup() == null) {
                                   AssertAdapter.fail("No popup shown");
                                 }
                                 ;
                               }
                             },
                             UISpec4J.getWindowInterceptionTimeLimit());
      return new MenuItem(display.getCurrentPopup());
    }
    finally {
      display.remove(interceptor);
    }
  }
View Full Code Here

TOP

Related Classes of org.uispec4j.interception.toolkit.UISpecDisplay

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.