List of usage examples for com.google.gwt.dom.client StyleInjector injectStylesheetAtStart
public static StyleElement injectStylesheetAtStart(String contents)
From source file:org.cruxframework.crux.plugin.bootstrap.client.ModuleLoader.java
License:Apache License
private void injectBoostrap3() { final CruxBootstrap3Resources resources = GWT.create(CruxBootstrap3Resources.class); Scheduler.get().scheduleFixedDelay(new RepeatingCommand() { @Override/*from www . j ava 2 s . c om*/ public boolean execute() { //Cascade Style Sheet String bootstrapCSS = resources.css().getText(); String bootstrapModalCSS = resources.bootstrapModalCSS().getText(); String bootstrapSelectCSS = resources.bootstrapSelectCSS().getText(); String bootstrapThemeCSS = resources.themeCss().getText(); String docsCSS = resources.docs().getText(); StyleInjector.injectStylesheetAtStart(bootstrapCSS); StyleInjector.injectStylesheetAtStart(bootstrapThemeCSS); StyleInjector.injectStylesheetAtStart(bootstrapSelectCSS); StyleInjector.injectStylesheetAtStart(bootstrapModalCSS); StyleInjector.injectStylesheetAtStart(docsCSS); //JavaScript String bootstrapJS = resources.bootstrapJS().getText(); String jquery = resources.jquery().getText(); String modalJS = resources.bootstrapModal().getText(); String modalManagerJS = resources.bootstrapModalManager().getText(); String selectJS = resources.bootstrapSelect().getText(); String html5shiv = resources.html5shiv().getText(); ScriptInjector.fromString(jquery).setWindow(ScriptInjector.TOP_WINDOW).inject(); ScriptInjector.fromString(bootstrapJS).setWindow(ScriptInjector.TOP_WINDOW).inject(); ScriptInjector.fromString(modalManagerJS).setWindow(ScriptInjector.TOP_WINDOW).inject(); ScriptInjector.fromString(modalJS).setWindow(ScriptInjector.TOP_WINDOW).inject(); ScriptInjector.fromString(selectJS).setWindow(ScriptInjector.TOP_WINDOW).inject(); ScriptInjector.fromString(html5shiv).setWindow(ScriptInjector.TOP_WINDOW).inject(); resources.font().ensureInjected(); return false; } }, 300); }