use of com.google.gwt.core.client.JsArrayString in project che by eclipse.
the class RequireJsLoader method requireScripts.
private void requireScripts(final RequirejsCallback callback, final RequirejsErrorHandler errorHandler, final RequirejsConfig config, final String[] requiredScripts, final String[] moduleKeys) {
final JsArrayString jsReqScripts = (JsArrayString) JavaScriptObject.createArray();
for (final String script : requiredScripts) {
jsReqScripts.push(script);
}
Requirejs.config(config).require(jsReqScripts, new RequirejsCallback() {
@Override
public void onReady(final JsArray<RequirejsModule> result) {
for (int i = 0; i < Math.min(result.length(), moduleKeys.length); i++) {
String itemtoString = "null";
if (result.get(i) != null) {
itemtoString = result.get(i).toString();
}
if (itemtoString.length() > 30) {
itemtoString = itemtoString.substring(0, 27) + "...";
}
Log.debug(RequireJsLoader.class, "Add module reference - name=" + moduleKeys[i] + " object=" + itemtoString);
moduleHolder.setModule(moduleKeys[i], result.get(i));
}
callback.onReady(result);
}
}, errorHandler);
}
use of com.google.gwt.core.client.JsArrayString in project che by eclipse.
the class OrionContentTypeOverlay method setExtension.
public final void setExtension(String... fileExtensions) {
JsArrayString arr = JavaScriptObject.createArray().cast();
for (String value : fileExtensions) {
arr.push(value);
}
setExtension(arr);
}
use of com.google.gwt.core.client.JsArrayString in project che by eclipse.
the class OrionLinkedModelDataOverlay method setValues.
@Override
public final void setValues(List<String> values) {
JsArrayString arr = JavaScriptObject.createArray().cast();
for (String value : values) {
arr.push(value);
}
setValues(arr);
}
use of com.google.gwt.core.client.JsArrayString in project che by eclipse.
the class WorkerGlobalScope method importScripts.
public final void importScripts(String[] urls) {
JsArrayString jsUrls = JsArrayString.createArray().cast();
for (int i = 0, l = urls.length; i < l; ++i) {
jsUrls.set(i, urls[i]);
}
importScripts(jsUrls);
}
use of com.google.gwt.core.client.JsArrayString in project rstudio by rstudio.
the class UserCommandManager method onRegisterUserCommand.
private void onRegisterUserCommand(RegisterUserCommandEvent event) {
final String name = event.getData().getName();
JsArrayString shortcutStrings = event.getData().getShortcuts();
for (int i = 0; i < shortcutStrings.length(); i++) {
String shortcutString = shortcutStrings.get(i);
KeySequence sequence = KeySequence.fromShortcutString(shortcutString);
assert sequence != null : "Failed to parse string '" + shortcutString + "'";
KeyboardShortcut shortcut = new KeyboardShortcut(sequence);
UserCommand command = new UserCommand(name, new Command() {
@Override
public void execute() {
events_.fireEvent(new ExecuteUserCommandEvent(name));
}
});
commandMap_.put(shortcut, command);
}
}
Aggregations