Package com.google.gwt.core.client.Scheduler

Examples of com.google.gwt.core.client.Scheduler.RepeatingCommand


   private void sendPing(final String afterRestartCommand,
                         int delayMs,
                         final int maxRetries,
                         final Command onCompleted)
   { 
      Scheduler.get().scheduleFixedDelay(new RepeatingCommand() {

         private int retries_ = 0;
         private boolean pingDelivered_ = false;
         private boolean pingInFlight_ = false;
        
View Full Code Here


      else
      {
         // poll for document availability then perform initialization
         // tasks once it's available (addLoadHandler wasn't always
         // getting called at least under Cocoa WebKit)
         Scheduler.get().scheduleFixedDelay(new RepeatingCommand() {

            @Override
            public boolean execute()
            {
               // see if the document is ready
View Full Code Here

      // if we don't have a valid window object yet, try again until we do
      // (every 100ms, up to 5s)
      if (window_ == null)
      {
         windowRetries_ = 0;
         Scheduler.get().scheduleFixedPeriod(new RepeatingCommand()
         {
            @Override
            public boolean execute()
            {
               if (window_ == null && windowRetries_ < MAX_WINDOW_RETRIES)
View Full Code Here

      getElement().getStyle().setBackgroundColor("white");
   }
      
   public void navigate(final String url)
   {
      RepeatingCommand navigateCommand = new RepeatingCommand() {
         @Override
         public boolean execute()
         {
            if (getIFrame() != null && getWindow() != null)
            {
               // if this is the same page but without an anchor qualification
               // then reload (so we preserve the anchor location)
               if (isBasePageOfCurrentAnchor(url))
               {
                  getWindow().reload();
               }
               // if it's the same page then set the anchor and force a reload
               else if (isSamePage(url))
               {
                  getWindow().replaceLocationHref(url);
                  getWindow().reload();
               }
               // otherwise a new url, merely replacing will force a reload
               else
               {
                  getWindow().replaceLocationHref(url);
               }
              
               if (autoFocus_)
                  getWindow().focus();
              
               return false;
            }
            else
            {
               return true;
            }
         }
      };

      if (navigateCommand.execute())
         Scheduler.get().scheduleFixedDelay(navigateCommand, 50);     
   }
View Full Code Here

      return false;
   }

   public void playbackActions(final RpcObjectList<ConsoleAction> actions)
   {
      Scheduler.get().scheduleIncremental(new RepeatingCommand()
      {
         private int i = actions.length() - 1;
         private int chunksize = 1000;

         public boolean execute()
View Full Code Here

    final JavaScriptObject injectedElement =
        ScriptInjector.fromUrl(scriptUrl).setRemoveTag(false).inject();

    // We'll check using a callback in another test. This test will poll to see
    // that the script had an effect.
    Scheduler.get().scheduleFixedDelay(new RepeatingCommand() {
      int numLoops = 0;

      @Override
      public boolean execute() {
        numLoops++;
View Full Code Here

    assertFalse(nativeTest6Worked());
    JavaScriptObject injectedElement = ScriptInjector.fromUrl(scriptUrl).setRemoveTag(false)
        .setWindow(ScriptInjector.TOP_WINDOW).inject();
    // We'll check using a callback in another test. This test will poll to see
    // that the script had an effect.
    Scheduler.get().scheduleFixedDelay(new RepeatingCommand() {
      int numLoops = 0;

      @Override
      public boolean execute() {
        numLoops++;
View Full Code Here

    ResizeHelper.assertSize(width, height);
    ResizeHelper.resizeBy(10, 20);
    ResizeHelper.assertSize(width + 10, height + 20);

    delayTestFinish(1000);
    Scheduler.get().scheduleFixedDelay(new RepeatingCommand() {
      @Override
      public boolean execute() {
        if (!handler.isCalled()) {
          return true; // we still didn't receive the callback, let's wait more
        }
View Full Code Here

    Prefetcher.prefetch(prefetchSplitPoint);

    assertFalse(prefetchSplitPoint.isLoaded());
    Prefetcher.start();

    Scheduler.get().scheduleFixedDelay(new RepeatingCommand() {

      @Override
      public boolean execute() {
        // gwtTearDown() will set this flag to stop the repeating timer if
        // the test case is already finished due to a timeout.
View Full Code Here

    staticWrittenByAsync = 0;

    assertRunAsyncIsAsync();

    // Give it little bit more time to loaded and try runAsync again
    Scheduler.get().scheduleFixedPeriod(new RepeatingCommand() {
      @Override public boolean execute() {
        if (staticWrittenByAsync == 0) {
          return true;
        }
View Full Code Here

TOP

Related Classes of com.google.gwt.core.client.Scheduler.RepeatingCommand

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.