use of com.google.gwt.core.client.JsArrayString in project rstudio by rstudio.
the class PaneConfig method createDefault.
public static PaneConfig createDefault() {
JsArrayString panes = createArray().cast();
panes.push(SOURCE);
panes.push(CONSOLE);
panes.push("TabSet1");
panes.push("TabSet2");
JsArrayString tabSet1 = createArray().cast();
tabSet1.push("Environment");
tabSet1.push("History");
tabSet1.push("Connections");
tabSet1.push("Build");
tabSet1.push("VCS");
tabSet1.push("Presentation");
JsArrayString tabSet2 = createArray().cast();
tabSet2.push("Files");
tabSet2.push("Plots");
tabSet2.push("Packages");
tabSet2.push("Help");
tabSet2.push("Viewer");
return create(panes, tabSet1, tabSet2, false, true);
}
use of com.google.gwt.core.client.JsArrayString in project rstudio by rstudio.
the class HelpSearchOracle method requestSuggestions.
@Override
public void requestSuggestions(final Request request, final Callback callback) {
String query = request.getQuery();
server_.suggestTopics(query, new ServerRequestCallback<JsArrayString>() {
@Override
public void onError(ServerError error) {
}
@Override
public void onResponseReceived(JsArrayString suggestions) {
int maxCount = Math.min(suggestions.length(), request.getLimit());
ArrayList<SearchSuggestion> results = new ArrayList<SearchSuggestion>();
for (int i = 0; i < maxCount; i++) results.add(new SearchSuggestion(suggestions.get(i)));
callback.onSuggestionsReady(request, new Response(results));
}
});
;
}
use of com.google.gwt.core.client.JsArrayString in project rstudio by rstudio.
the class Source method openEditPublishedDocs.
private void openEditPublishedDocs() {
// will be done after the switch)
if (ApplicationAction.isSwitchProject())
return;
// check for edit_published url parameter
final String kEditPublished = "edit_published";
String editPublished = StringUtil.notNull(Window.Location.getParameter(kEditPublished));
// to determine source files to edit
if (editPublished.length() > 0) {
// remove it from the url
ApplicationUtils.removeQueryParam(kEditPublished);
server_.getEditPublishedDocs(editPublished, new SimpleRequestCallback<JsArrayString>() {
@Override
public void onResponseReceived(JsArrayString docs) {
new SourceFilesOpener(docs).run();
}
});
}
}
use of com.google.gwt.core.client.JsArrayString in project rstudio by rstudio.
the class ChunkOutputWidget method cacheEditorStyle.
public static void cacheEditorStyle(String foregroundColor, String backgroundColor, String aceEditorColor) {
// use a muted version of the text color for the outline
ColorUtil.RGBColor text = ColorUtil.RGBColor.fromCss(aceEditorColor);
// dark themes require a slightly more pronounced color
ColorUtil.RGBColor outline = new ColorUtil.RGBColor(text.red(), text.green(), text.blue(), text.isDark() ? 0.12 : 0.18);
String border = outline.asRgb();
// highlight color used in data chunks
ColorUtil.RGBColor highlight = new ColorUtil.RGBColor(text.red(), text.green(), text.blue(), 0.02);
// synthesize a surface color by blending the keyword color with the
// background
JsArrayString classes = JsArrayString.createArray().cast();
classes.push("ace_editor");
classes.push("ace_keyword");
ColorUtil.RGBColor surface = ColorUtil.RGBColor.fromCss(DomUtils.extractCssValue(classes, "color"));
surface = surface.mixedWith(ColorUtil.RGBColor.fromCss(backgroundColor), 0.02, 1);
s_colors = new EditorThemeListener.Colors(foregroundColor, backgroundColor, border, highlight.asRgb(), surface.asRgb());
}
use of com.google.gwt.core.client.JsArrayString in project rstudio by rstudio.
the class TextEditingTargetRMarkdownHelper method transferOptions.
private RmdFrontMatterOutputOptions transferOptions(RmdFrontMatter frontMatter, RmdTemplate template, String format) {
RmdFrontMatterOutputOptions result = RmdFrontMatterOutputOptions.create();
// loop over each option applicable to the new format; if it's
// transferable, try to find it in one of the other formats
JsArrayString options = template.getFormat(format).getOptions();
for (int i = 0; i < options.length(); i++) {
String optionName = options.get(i);
RmdTemplateFormatOption option = template.getOption(optionName);
if (!option.isTransferable())
continue;
// option is transferable, is it present in another front matter entry?
JsArrayString formats = frontMatter.getFormatList();
for (int j = 0; j < formats.length(); j++) {
RmdFrontMatterOutputOptions outOptions = frontMatter.getOutputOption(formats.get(j));
if (outOptions == null)
continue;
String val = outOptions.getOptionValue(optionName);
if (val != null)
result.setOptionValue(option, val);
}
}
return result;
}
Aggregations