use of org.rstudio.studio.client.packrat.model.PackratPrerequisites in project rstudio by rstudio.
the class ProjectPackratPreferencesPane method verifyPrerequisites.
private void verifyPrerequisites() {
final ProgressIndicator indicator = getProgressIndicator();
indicator.onProgress("Verifying prequisites...");
server_.getPackratPrerequisites(new ServerRequestCallback<PackratPrerequisites>() {
@Override
public void onResponseReceived(PackratPrerequisites prereqs) {
indicator.onCompleted();
if (prereqs.getBuildToolsAvailable()) {
if (prereqs.getPackageAvailable()) {
setUsePackrat(true);
} else {
setUsePackrat(false);
// install packrat (with short delay to allow
// the progress indicator to clear)
new Timer() {
@Override
public void run() {
dependencyManager_.withPackrat("Managing packages with packrat", new Command() {
@Override
public void execute() {
setUsePackrat(true);
}
});
}
}.schedule(250);
}
} else {
setUsePackrat(false);
// install build tools (with short delay to allow
// the progress indicator to clear)
new Timer() {
@Override
public void run() {
server_.installBuildTools("Managing packages with Packrat", new SimpleRequestCallback<Boolean>() {
});
}
}.schedule(250);
}
}
@Override
public void onError(ServerError error) {
setUsePackrat(false);
indicator.onError(error.getUserMessage());
}
});
}
Aggregations