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

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


    final MediaBase media = getMedia();
    if (media == null) {
      return; // don't continue if not supported
    }

    assertAfterLoad(new RepeatingCommand() {
      boolean afterSeek = false;
      @Override
      public boolean execute() {
        if (media.getCurrentTime() >= 1) {
          assertFalse(afterSeek);
View Full Code Here


    final MediaBase media = getMedia();
    if (media == null) {
      return; // don't continue if not supported
    }

    assertAfterLoad(new RepeatingCommand() {
      @Override
      public boolean execute() {
        assertNoErrors(media);
        return false;
      }
View Full Code Here

    }

    assertEquals("Default playback rate should be 1.0", 1.0,
        media.getDefaultPlaybackRate());

    assertAfterLoad(new RepeatingCommand() {
      @Override
      public boolean execute() {
        assertNoErrors(media);

        // set rate to 2.0
View Full Code Here

      @Override
      public void onLoadedMetadata(LoadedMetadataEvent event) {
        assertNoErrors(getMedia());

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

          @Override
          public boolean execute() {
            assertNoErrors(getMedia());
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

            uiService.sendDataToServer(eventInstruction);

            int delay = 1000;
            if (create.containsKey(PROPERTY.FIXDELAY)) delay = create.getInt(PROPERTY.FIXDELAY);

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

                @Override
                public boolean execute() {
                    final PTInstruction eventInstruction = new PTInstruction();
                    eventInstruction.setObjectID(create.getObjectID());
                    eventInstruction.put(TYPE.KEY, TYPE.KEY_.EVENT);
                    eventInstruction.put(PROPERTY.POLL, true);
                    uiService.sendDataToServer(eventInstruction);
                    return !hasCommunicationError;
                }
            }, delay);
        } else {
            super.create(create, uiService);

            final String wsServerURL = GWT.getHostPageBaseURL().replaceFirst("http", "ws") + "ws" + "?" + APPLICATION.VIEW_ID + "=" + UIBuilder.sessionID;

            socketClient = new WebSocketClient(new WebSocketCallback() {

                @Override
                public void message(final String message) {
                    final JSONObject data = JSONParser.parseStrict(message).isObject();
                    if (data.containsKey(Dictionnary.APPLICATION.PING)) return;

                    uiService.update(data);
                }

                @Override
                public void disconnected() {
                    log.info("Disconnected from: " + wsServerURL);
                    uiService.onCommunicationError(new Exception("Websocket connection lost."));
                    uiService.unRegisterObject(getObjectID());
                }

                @Override
                public void connected() {
                    log.info("Connected to: " + wsServerURL);
                }
            });

            log.info("Connecting to: " + wsServerURL);
            socketClient.connect(wsServerURL);

            int ping = 1000;
            if (create.containsKey(PROPERTY.PINGDELAY)) ping = create.getInt(PROPERTY.PINGDELAY);

            if (ping > 0) {
                Scheduler.get().scheduleFixedDelay(new RepeatingCommand() {

                    @Override
                    public boolean execute() {
                        final int timeStamp = (int) (new Date().getTime() * .001);
                        final JSONObject jso = new JSONObject();
View Full Code Here

    @Override
    public void update(final PTInstruction update, final UIService uiService) {
        final int delayMs = update.getInt(PROPERTY.FIXDELAY);
        if (delayMs < 0) {
            Scheduler.get().scheduleFinally(new RepeatingCommand() {

                @Override
                public boolean execute() {
                    executeInstruction(update, uiService);
                    return false;
                }
            });
        } else {
            Scheduler.get().scheduleFixedDelay(new RepeatingCommand() {

                @Override
                public boolean execute() {
                    executeInstruction(update, uiService);
                    return false;
View Full Code Here

            close(window);
        }
    }

    private void checkWindowAlive() {
        Scheduler.get().scheduleFixedDelay(new RepeatingCommand() {

            @Override
            public boolean execute() {
                if (isOpen(window)) return true;
View Full Code Here

        super.add(widget, index);

        if (removeTimeMs > 0) {
            final Widget removeWidget = widget;

            Scheduler.get().scheduleFixedPeriod(new RepeatingCommand() {
                @Override
                public boolean execute() {
                    GwtFancyTimedCssLayout.this.fancyRemove(removeWidget);
                    return false;
                }
View Full Code Here

        children.add(index, widget);

        if (this.isVisible()) {
            wrapperElement.getStyle().setOpacity(0.0);
            Scheduler.get().scheduleFixedDelay(new RepeatingCommand() {

                @Override
                public boolean execute() {
                    wrapperElement.getStyle().setOpacity(1.0);
                    return false;
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.