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();
}
}
}
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);
}
});
}
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);
}
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);
}
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);
}
Aggregations