use of org.rstudio.core.client.widget.ProgressOperation in project rstudio by rstudio.
the class Plots method onRemovePlot.
void onRemovePlot() {
// delete plot gesture indicates we are done with locator
safeClearLocator();
// confirm
globalDisplay_.showYesNoMessage(GlobalDisplay.MSG_QUESTION, "Remove Plot", "Are you sure you want to remove the current plot?", new ProgressOperation() {
public void execute(final ProgressIndicator indicator) {
indicator.onProgress("Removing plot...");
server_.removePlot(new VoidServerRequestCallback(indicator));
}
}, true);
view_.bringToFront();
}
use of org.rstudio.core.client.widget.ProgressOperation in project rstudio by rstudio.
the class Presentation method onClearPresentationCache.
@Handler
void onClearPresentationCache() {
globalDisplay_.showYesNoMessage(MessageDialog.INFO, "Clear Knitr Cache", "Clearing the Knitr cache will discard previously cached " + "output and re-run all of the R code chunks within the " + "presentation.\n\n" + "Are you sure you want to clear the cache now?", false, new ProgressOperation() {
@Override
public void execute(final ProgressIndicator indicator) {
indicator.onProgress("Clearing Knitr Cache...");
server_.clearPresentationCache(new ServerRequestCallback<Void>() {
@Override
public void onResponseReceived(Void response) {
indicator.onCompleted();
refreshPresentation();
}
@Override
public void onError(ServerError error) {
indicator.onCompleted();
globalDisplay_.showErrorMessage("Error Clearing Cache", getErrorMessage(error));
}
});
}
}, new ProgressOperation() {
@Override
public void execute(ProgressIndicator indicator) {
indicator.onCompleted();
}
}, true);
}
Aggregations