@Override public void initWindowCloseHandler() { initHandler(Resources.INSTANCE.initWindowCloseHandler().getText(), new ScheduledCommand() { public void execute() { initWindowCloseHandlerImpl(); } }); }
@Override public void initWindowResizeHandler() { initHandler(Resources.INSTANCE.initWindowResizeHandler().getText(), new ScheduledCommand() { public void execute() { initWindowResizeHandlerImpl(); } }); }
@Override public void initWindowScrollHandler() { initHandler(Resources.INSTANCE.initWindowScrollHandler().getText(), new ScheduledCommand() { public void execute() { initWindowScrollHandlerImpl(); } }); }
/** * Add a stylesheet to the document. * * @param css * the CSS contents of the stylesheet */ public static void inject(TextResource css) { inject(css.getText(), false); }
public static final void forceLocale(String locale_) { locale = locale_; TextResource t = setupLocale(); if (loaded.contains(locale) && t != null) { JavaScriptInjector.inject(t.getText()); } }
public static final void forceLocale(String locale_) { locale = locale_; TextResource t = setupLocale(); if (loaded.contains(locale) && t != null) { JavaScriptInjector.inject(t.getText()); } }
public GeoFencingStandardProvider() { initRegionListener(); TextResource javascript = Resources.RESOURCES.javascript(); JavascriptInjector.inject(javascript.getText()); }
private boolean checkPreloadNative(String familyName, TextResource resource) { if (resource.getName().equals(familyName)) { ScriptInjector.fromString(resource.getText()) .setWindow(ScriptInjector.TOP_WINDOW).inject(); parseFont(familyName); return true; } return false; }
@Override public void onModuleLoad() { if (Window.Navigator.getUserAgent().contains(MSIE) && Window.Navigator.getUserAgent().contains(EIGHT)) { ScriptInjector.fromString(RespondClientBundle.INSTANCE.respond().getText()).setWindow(ScriptInjector.TOP_WINDOW) .inject(); ScriptInjector.fromString(RespondClientBundle.INSTANCE.html5Shiv().getText()).setWindow(ScriptInjector.TOP_WINDOW) .inject(); } } }
/** * Injects the required CSS styles and JavaScript files into the document * header. */ public static void configure() { Resources r = Resources.RESOURCES; injectJs(r.datepickerJs()); TextResource locale = LocaleUtil.getLocaleJsResource(); if (locale != null) { JavaScriptInjector.inject(locale.getText()); } }
/** * Injects the required CSS styles and JavaScript files into the document * header. */ public static void configure() { Resources r = Resources.RESOURCES; injectJs(r.datetimepickerJs()); TextResource locale = LocaleUtil.getLocaleJsResource(); if (locale != null) { JavaScriptInjector.inject(locale.getText()); } }
@Override public void onModuleLoad() { ScriptInjector.fromString(ToggleSwitchClientBundle.INSTANCE.toggleswitch().getText()).setWindow(ScriptInjector.TOP_WINDOW) .inject(); } }
@Override public void onModuleLoad() { ScriptInjector.fromString(DatePickerClientBundle.INSTANCE.datePicker().getText()).setWindow(ScriptInjector.TOP_WINDOW).inject(); } }
@Override public void onModuleLoad() { ScriptInjector.fromString(SelectClientBundle.INSTANCE.select().getText()) .setWindow(ScriptInjector.TOP_WINDOW).inject(); } }
protected static void directInjectJs(TextResource resource, boolean removeTag, boolean sourceUrl) { String text = resource.getText() + (sourceUrl ? "//# sourceURL=" + resource.getName() + ".js" : ""); // Inject the script resource ScriptInjector.fromString(text) .setWindow(ScriptInjector.TOP_WINDOW) .setRemoveTag(removeTag) .inject(); }
static void ensurePromiseApiIsAvailable() { if (!isPromiseApiAvailable()) { ScriptInjector.fromString(PromisePolyfillClientBundle.INSTANCE.promisePolyfill().getText()) .setWindow(ScriptInjector.TOP_WINDOW) .inject(); } }
public static void ensureBootstrapDateRangePickerIsAvailable() { ensureMomentIsAvailable(); if (!isBootstrapDateRangePickerLoaded()) { ScriptInjector.fromString(PatternFlyClientBundle.INSTANCE.bootstrapDateRangePicker().getText()) .setWindow(ScriptInjector.TOP_WINDOW) .inject(); } }
/** * @param scriptResource * javascript file */ public static void inject(TextResource scriptResource) { if (DOM.getElementById(scriptResource.getName()) == null) { ScriptElement element = createScriptElement(scriptResource .getName()); element.setText(scriptResource.getText()); getHead().appendChild(element); } }
private void initialize() { // Inject the language JS is necessary if (language.getJs() != null) { ScriptInjector.fromString(language.getJs().getText()) .setWindow(ScriptInjector.TOP_WINDOW).inject(); } // Initialize initialize(getElement(), options); // Enable/Disable editor setEnabled(enabled); }
protected void setupLanguage(DatePickerLanguage language) { if (language.getJs() != null) { ScriptInjector.fromString(language.getJs().getText()).setWindow(ScriptInjector.TOP_WINDOW).inject(); getPicker().stop(); Scheduler.get().scheduleDeferred(this::load); } }