use of org.rstudio.core.client.widget.ProgressIndicator in project rstudio by rstudio.
the class Projects method onShowDiagnosticsProject.
@Handler
public void onShowDiagnosticsProject() {
final ProgressIndicator indicator = globalDisplay_.getProgressIndicator("Lint");
indicator.onProgress("Analyzing project sources...");
projServer_.analyzeProject(new ServerRequestCallback<Void>() {
@Override
public void onResponseReceived(Void response) {
indicator.onCompleted();
}
@Override
public void onError(ServerError error) {
Debug.logError(error);
indicator.onCompleted();
}
});
}
use of org.rstudio.core.client.widget.ProgressIndicator in project rstudio by rstudio.
the class Projects method handleNewProject.
private void handleNewProject(boolean forceSaveAll, final boolean allowOpenInNewWindow) {
// first resolve the quit context (potentially saving edited documents
// and determining whether to save the R environment on exit)
applicationQuit_.prepareForQuit("Save Current Workspace", forceSaveAll, new ApplicationQuit.QuitContext() {
@Override
public void onReadyToQuit(final boolean saveChanges) {
projServer_.getNewProjectContext(new SimpleRequestCallback<NewProjectContext>() {
@Override
public void onResponseReceived(NewProjectContext context) {
NewProjectWizard wiz = new NewProjectWizard(session_.getSessionInfo(), pUIPrefs_.get(), pWorkbenchContext_.get(), new NewProjectInput(FileSystemItem.createDir(pUIPrefs_.get().defaultProjectLocation().getValue()), context), allowOpenInNewWindow, new ProgressOperationWithInput<NewProjectResult>() {
@Override
public void execute(NewProjectResult newProject, ProgressIndicator indicator) {
indicator.onCompleted();
createNewProject(newProject, saveChanges);
}
});
wiz.showModal();
}
});
}
});
}
use of org.rstudio.core.client.widget.ProgressIndicator in project rstudio by rstudio.
the class RSConnect method publishWithWizard.
private void publishWithWizard(final RSConnectPublishInput input) {
RSConnectPublishWizard wizard = new RSConnectPublishWizard(input, new ProgressOperationWithInput<RSConnectPublishResult>() {
@Override
public void execute(RSConnectPublishResult result, ProgressIndicator indicator) {
switch(result.getPublishType()) {
case RSConnectPublishResult.PUBLISH_STATIC:
case RSConnectPublishResult.PUBLISH_CODE:
// always launch the browser--the wizard implies we're
// doing a first-time publish, and we may need to do some
// post-publish configuration
fireRSConnectPublishEvent(result, true);
indicator.onCompleted();
break;
case RSConnectPublishResult.PUBLISH_RPUBS:
uploadToRPubs(input, result, indicator);
break;
}
}
});
wizard.showModal();
}
use of org.rstudio.core.client.widget.ProgressIndicator in project rstudio by rstudio.
the class HTMLPreviewPresenter method onSaveHtmlPreviewAs.
@Handler
public void onSaveHtmlPreviewAs() {
if (lastSuccessfulPreview_ != null) {
FileSystemItem defaultDir = savePreviewDir_ != null ? FileSystemItem.createDir(savePreviewDir_) : FileSystemItem.home();
final FileSystemItem sourceFile = FileSystemItem.createFile(lastSuccessfulPreview_.getHtmlFile());
FileSystemItem initialFilePath = FileSystemItem.createFile(defaultDir.completePath(sourceFile.getStem()));
fileDialogs_.saveFile("Save File As", fileSystemContext_, initialFilePath, sourceFile.getExtension(), false, new ProgressOperationWithInput<FileSystemItem>() {
@Override
public void execute(FileSystemItem targetFile, ProgressIndicator indicator) {
if (targetFile == null || sourceFile.equalTo(targetFile)) {
indicator.onCompleted();
return;
}
indicator.onProgress("Saving File...");
server_.copyFile(sourceFile, targetFile, true, new VoidServerRequestCallback(indicator));
savePreviewDir_ = targetFile.getParentPathString();
session_.persistClientState();
}
});
}
}
use of org.rstudio.core.client.widget.ProgressIndicator in project rstudio by rstudio.
the class ProfilerEditingTarget method saveNewFile.
private void saveNewFile(final String suggestedPath) {
FileSystemItem fsi;
if (suggestedPath != null)
fsi = FileSystemItem.createFile(suggestedPath).getParentPath();
else
fsi = workbenchContext_.getDefaultFileDialogDir();
fileDialogs_.saveFile("Save File - " + getName().getValue(), fileContext_, fsi, fileType_.getDefaultExtension(), false, new ProgressOperationWithInput<FileSystemItem>() {
public void execute(final FileSystemItem saveItem, final ProgressIndicator indicator) {
if (saveItem == null)
return;
workbenchContext_.setDefaultFileDialogDir(saveItem.getParentPath());
final String toPath = saveItem.getPath();
server_.copyProfile(htmlLocalPath_, toPath, new ServerRequestCallback<JavaScriptObject>() {
@Override
public void onResponseReceived(JavaScriptObject response) {
savePropertiesWithPath(saveItem.getPath());
persistDocumentProperty("isUserSaved", "saved");
isUserSaved_ = true;
indicator.onCompleted();
}
@Override
public void onError(ServerError error) {
Debug.logError(error);
indicator.onCompleted();
globalDisplay_.showErrorMessage("Failed to Save Profile", error.getMessage());
}
});
}
});
}
Aggregations