Package com.google.gwt.user.client

Examples of com.google.gwt.user.client.Timer


        show();
        readStoredState();

        Window.addResizeHandler(new com.google.gwt.event.logical.shared.ResizeHandler() {

            Timer t = new Timer() {
                @Override
                public void run() {
                    applyPositionAndSize();
                }
            };

            @Override
            public void onResize(ResizeEvent event) {
                t.cancel();
                // TODO less
                t.schedule(1000);
            }
        });
    }
View Full Code Here


                // removing the captionWrap
                focusedElement.focus();
            } else if (currentFocus != focusedElement) {
                // Focus is either moved somewhere else on purpose or IE has
                // lost it. Investigate further.
                Timer focusTimer = new Timer() {

                    @Override
                    public void run() {
                        if (Util.getFocusedElement() == null) {
                            // This should never become an infinite loop and
                            // even if it does it will be stopped once something
                            // is done with the browser.
                            schedule(25);
                        } else if (Util.getFocusedElement().equals(
                                Document.get().getBody())) {
                            // Focus found it's way to BodyElement. Now it can
                            // be restored
                            focusedElement.focus();
                        }
                    }
                };
                if (BrowserInfo.get().isIE8()) {
                    // IE8 can't fix the focus immediately. It will fail.
                    focusTimer.schedule(25);
                } else {
                    // Newer IE versions can handle things immediately.
                    focusTimer.run();
                }
            }
        }
    }
View Full Code Here

        if (locked && scrollTimer != null) {
            scrollTimer.cancel();
            scrollTimer = null;

        } else if (!locked && scrollTimer == null) {
            scrollTimer = new Timer() {
                @Override
                public void run() {
                    Element el = (Element) contentElement.getLastChild();
                    if (el != null) {
                        el = el.getFirstChildElement();
View Full Code Here

                     * 500, as per RFC 2616 section 10.5.4.
                     */
                    String delay = response.getHeader("Retry-After");
                    if (delay != null) {
                        VConsole.log("503, retrying in " + delay + "msec");
                        (new Timer() {
                            @Override
                            public void run() {
                                doUidlRequest(uri, payload);
                            }
                        }).schedule(Integer.parseInt(delay));
View Full Code Here

        rb.setCallback(requestCallback);

        final Request request = rb.send();
        if (webkitMaybeIgnoringRequests && BrowserInfo.get().isWebkit()) {
            final int retryTimeout = 250;
            new Timer() {
                @Override
                public void run() {
                    // Use native js to access private field in Request
                    if (resendRequest(request) && webkitMaybeIgnoringRequests) {
                        // Schedule retry if still needed
View Full Code Here

    static final int MAX_CSS_WAITS = 100;

    protected void handleWhenCSSLoaded(final String jsonText,
            final ValueMap json) {
        if (!isCSSLoaded() && cssWaits < MAX_CSS_WAITS) {
            (new Timer() {
                @Override
                public void run() {
                    handleWhenCSSLoaded(jsonText, json);
                }
            }).schedule(50);
View Full Code Here

                        final ValueMap timedRedirect = meta
                                .getValueMap("timedRedirect");
                        if (redirectTimer != null) {
                            redirectTimer.cancel();
                        }
                        redirectTimer = new Timer() {
                            @Override
                            public void run() {
                                redirect(timedRedirect.getString("url"));
                            }
                        };
View Full Code Here

                    }
                }, event);
                if (BrowserInfo.get().isOpera()) {
                    // Opera onerror never fired, assume error if no onload in x
                    // seconds
                    new Timer() {
                        @Override
                        public void run() {
                            if (!loadedResources.contains(url)) {
                                fireError(event);
                            }
View Full Code Here

      messageMultiplier.setValue(1);
    }

    final int multipler = messageMultiplier.getValue();

    sendTimer = new Timer() {
      private boolean hasStarted;

      @Override
      public void run() {
        hasStarted = true;
View Full Code Here

public class TimeIncrementer implements IDynamic {

  @Override
  public void start() {
    // Starts a timer at a frequency of 1/sec
    new Timer() {
      @Override
      public void run() {
        // Cycle through all 'span' elements
        NodeList<Element> list = RootPanel.getBodyElement().getElementsByTagName("span");
        for (int i = 0; i < list.getLength(); i++) {
View Full Code Here

TOP

Related Classes of com.google.gwt.user.client.Timer

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.