Search in sources :

Example 81 with Timer

use of com.google.gwt.user.client.Timer in project rstudio by rstudio.

the class ApplicationInterrupt method interruptR.

public void interruptR(final InterruptHandler handler) {
    if (interruptRequestCounter_ == 0) {
        interruptRequestCounter_ = 1;
        interruptUnresponsiveTimer_ = new Timer() {

            @Override
            public void run() {
                showInterruptUnresponsiveDialog();
            }
        };
        interruptUnresponsiveTimer_.schedule(10000);
        eventBus_.fireEvent(new InterruptStatusEvent(InterruptStatusEvent.INTERRUPT_INITIATED));
        server_.interrupt(new VoidServerRequestCallback() {

            @Override
            public void onSuccess() {
                eventBus_.fireEvent(new InterruptStatusEvent(InterruptStatusEvent.INTERRUPT_COMPLETED));
                finishInterrupt(handler);
            }

            @Override
            public void onFailure() {
                finishInterrupt(handler);
            }
        });
    } else {
        interruptRequestCounter_++;
        if (interruptRequestCounter_ >= 3) {
            interruptUnresponsiveTimer_.cancel();
            showInterruptUnresponsiveDialog();
        }
    }
}
Also used : Timer(com.google.gwt.user.client.Timer) InterruptStatusEvent(org.rstudio.studio.client.application.events.InterruptStatusEvent) VoidServerRequestCallback(org.rstudio.studio.client.server.VoidServerRequestCallback)

Example 82 with Timer

use of com.google.gwt.user.client.Timer in project rstudio by rstudio.

the class SlideLabel method show.

public void show(final int autoHideMillis, final Command executeOnComplete) {
    assert autoHideMillis >= 0 || executeOnComplete == null : "Possible error: executeOnComplete will never be called with " + "negative value for autoHideMillis";
    Scheduler.get().scheduleDeferred(new ScheduledCommand() {

        public void execute() {
            stopCurrentAnimation();
            currentAnimation_ = new Animation() {

                @Override
                protected void onStart() {
                    setVisible(true);
                    curtain_.setHeight("0px");
                    height = content_.getOffsetHeight() + 14 + 14;
                    super.onStart();
                }

                @Override
                protected void onUpdate(double progress) {
                    setHeight(height * progress);
                }

                @Override
                protected void onComplete() {
                    currentAnimation_ = null;
                    if (autoHideMillis >= 0) {
                        currentAutoHideTimer_ = new Timer() {

                            @Override
                            public void run() {
                                currentAutoHideTimer_ = null;
                                hide(executeOnComplete);
                            }
                        };
                        currentAutoHideTimer_.schedule(autoHideMillis);
                    }
                }

                private int height;
            };
            currentAnimation_.run(ANIM_MILLIS);
        }
    });
}
Also used : ScheduledCommand(com.google.gwt.core.client.Scheduler.ScheduledCommand) Timer(com.google.gwt.user.client.Timer) Animation(com.google.gwt.animation.client.Animation)

Example 83 with Timer

use of com.google.gwt.user.client.Timer in project rstudio by rstudio.

the class ImageFrame method onLoad.

@Override
protected void onLoad() {
    super.onLoad();
    new Timer() {

        @Override
        public void run() {
            // to probe and retry.
            if (!isReadyForContent(getElement())) {
                this.schedule(200);
            } else {
                String sizing = "width=\"100%\" height=\"100%\"";
                setupContent(getElement(), sizing);
                replaceLocation(getElement(), url_);
            }
        }
    }.schedule(100);
}
Also used : Timer(com.google.gwt.user.client.Timer)

Example 84 with Timer

use of com.google.gwt.user.client.Timer in project rstudio by rstudio.

the class ProgressPanel method beginProgressOperation.

public void beginProgressOperation(int delayMs) {
    clearTimer();
    progressImage_.setVisible(false);
    timer_ = new Timer() {

        public void run() {
            if (timer_ != this)
                // This should never happen, but, just in case
                return;
            progressImage_.setVisible(true);
        }
    };
    timer_.schedule(delayMs);
}
Also used : Timer(com.google.gwt.user.client.Timer)

Example 85 with Timer

use of com.google.gwt.user.client.Timer in project rstudio by rstudio.

the class DesktopApplicationHeader method onDiagnosticsReport.

@Handler
void onDiagnosticsReport() {
    eventBus_.fireEvent(new SendToConsoleEvent("rstudioDiagnosticsReport()", true));
    new Timer() {

        @Override
        public void run() {
            Desktop.getFrame().showFolder("~/rstudio-diagnostics");
        }
    }.schedule(1000);
}
Also used : Timer(com.google.gwt.user.client.Timer) SendToConsoleEvent(org.rstudio.studio.client.workbench.views.console.events.SendToConsoleEvent) ShowFolderHandler(org.rstudio.studio.client.workbench.views.files.events.ShowFolderHandler) SessionInitHandler(org.rstudio.studio.client.workbench.events.SessionInitHandler) Handler(org.rstudio.core.client.command.Handler)

Aggregations

Timer (com.google.gwt.user.client.Timer)133 Command (com.google.gwt.user.client.Command)7 Element (com.google.gwt.dom.client.Element)6 ScheduledCommand (com.google.gwt.core.client.Scheduler.ScheduledCommand)4 Style (com.google.gwt.dom.client.Style)4 Request (com.google.gwt.http.client.Request)4 RequestBuilder (com.google.gwt.http.client.RequestBuilder)4 RequestCallback (com.google.gwt.http.client.RequestCallback)4 RequestException (com.google.gwt.http.client.RequestException)4 Response (com.google.gwt.http.client.Response)4 JSONString (com.google.gwt.json.client.JSONString)4 Widget (com.google.gwt.user.client.ui.Widget)4 ArrayList (java.util.ArrayList)4 ServerError (org.rstudio.studio.client.server.ServerError)4 Label (com.google.gwt.user.client.ui.Label)3 VerticalPanel (com.google.gwt.user.client.ui.VerticalPanel)3 Date (java.util.Date)3 SessionInfo (org.rstudio.studio.client.workbench.model.SessionInfo)3 SliderEvent (com.extjs.gxt.ui.client.event.SliderEvent)2 Animation (com.google.gwt.animation.client.Animation)2