use of org.rstudio.studio.client.projects.model.RProjectBuildContext in project rstudio by rstudio.
the class BuildToolsWebsitePanel method load.
@Override
void load(RProjectOptions options) {
RProjectConfig config = options.getConfig();
pathSelector_.setText(config.getWebsitePath());
RProjectBuildOptions buildOptions = options.getBuildOptions();
chkPreviewAfterBuilding_.setValue(buildOptions.getPreviewWebsite());
chkLivePreviewSite_.setValue(buildOptions.getLivePreviewWebsite());
RProjectBuildContext buildContext = options.getBuildContext();
if (buildContext.isBookdownSite()) {
// change caption
chkPreviewAfterBuilding_.setText("Preview book after building");
// get all available output formats
JsArrayString formatsJson = buildContext.getWebsiteOutputFormats();
ArrayList<String> formatNames = new ArrayList<String>();
ArrayList<String> formats = new ArrayList<String>();
// always include "All Formats"
formatNames.add("(All Formats)");
formats.add("all");
for (int i = 0; i < formatsJson.length(); i++) {
formatNames.add(formatsJson.get(i));
formats.add(formatsJson.get(i));
}
websiteOutputFormat_.setChoices(formatNames.toArray(new String[] {}), formats.toArray(new String[] {}));
websiteOutputFormat_.setValue(buildOptions.getWebsiteOutputFormat());
websiteOutputFormat_.setVisible(true);
}
}
Aggregations