use of org.eclipse.che.plugin.requirejs.ide.conf.RequirejsConfig in project che by eclipse.
the class RequireJsLoader method require.
public void require(final Callback<JavaScriptObject[], Throwable> callback, final String[] requiredScripts, final String[] moduleKeys) {
// require with default config
final RequirejsConfig defaultConfig = RequirejsConfig.create();
/** Using GWT.getModuleBaseForStaticFiles() blocks CodeMirror to run under Super Dev Mode */
defaultConfig.setBaseUrl(GWT.getModuleBaseURL());
defaultConfig.setWaitSeconds(0);
require(new RequirejsCallback() {
@Override
public void onReady(final JsArray<RequirejsModule> modules) {
final JavaScriptObject[] result = new JavaScriptObject[modules.length()];
for (int i = 0; i < modules.length(); i++) {
result[i] = modules.get(i);
}
callback.onSuccess(result);
}
}, new RequirejsErrorHandler() {
@Override
public void onError(final RequireError error) {
callback.onFailure(new JavaScriptException(error));
}
}, defaultConfig, requiredScripts, moduleKeys);
}
Aggregations