use of org.rstudio.studio.client.common.vcs.ProcessResult in project rstudio by rstudio.
the class Ignore method showDialog.
public void showDialog(final IgnoreList ignoreList, final Strategy strategy) {
// show progress
final ProgressIndicator globalIndicator = new GlobalProgressDelayer(globalDisplay_, 500, "Getting ignored files for path...").getIndicator();
// get existing ignores
final String fullPath = projPathToFullPath(ignoreList.getPath());
strategy.getIgnores(fullPath, new ServerRequestCallback<ProcessResult>() {
@Override
public void onResponseReceived(final ProcessResult result) {
globalIndicator.onCompleted();
if (checkForProcessError(strategy.getDialogCaption(), result))
return;
// show the ignore dialog
String ignored = getIgnored(ignoreList, result.getOutput());
showDialog(fullPath, ignored, strategy);
}
@Override
public void onError(ServerError error) {
globalIndicator.onError(error.getUserMessage());
}
});
}
use of org.rstudio.studio.client.common.vcs.ProcessResult in project rstudio by rstudio.
the class Ignore method showDialog.
private void showDialog(final String initialPath, String ignores, final Strategy strategy) {
final Display display = pDisplay_.get();
final ProgressIndicator indicator = display.progressIndicator();
display.setDialogCaption(strategy.getDialogCaption());
display.setIgnoresCaption(strategy.getIgnoresCaption());
display.setHelpLinkName(strategy.getHelpLinkName());
display.setCurrentPath(initialPath);
display.setIgnored(ignores);
display.scrollToBottom();
display.addPathChangedHandler(new ValueChangeHandler<String>() {
@Override
public void onValueChange(ValueChangeEvent<String> event) {
display.setIgnored("");
indicator.onProgress("Getting ignored files for path...");
strategy.getIgnores(display.getCurrentPath(), new ServerRequestCallback<ProcessResult>() {
@Override
public void onResponseReceived(final ProcessResult result) {
indicator.clearProgress();
if (checkForProcessError(strategy.getDialogCaption(), result))
return;
display.setIgnored(result.getOutput());
display.focusIgnored();
}
@Override
public void onError(ServerError error) {
indicator.onError(error.getUserMessage());
}
});
}
});
display.saveButton().addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
indicator.onProgress("Setting ignored files for path...");
strategy.setIgnores(display.getCurrentPath(), display.getIgnored(), new ServerRequestCallback<ProcessResult>() {
@Override
public void onResponseReceived(ProcessResult result) {
indicator.onCompleted();
checkForProcessError(strategy.getDialogCaption(), result);
}
@Override
public void onError(ServerError error) {
indicator.onError(error.getUserMessage());
}
});
}
});
display.showModal();
}
Aggregations