List of usage examples for com.google.gwt.resources.client TextResource getText
String getText();
From source file:cc.alcina.framework.gwt.client.widget.Svg.java
License:Apache License
/** * Creates an empty span panel./* w ww. j a va 2s.c o m*/ */ public Svg(TextResource textResource) { String svg = textResource.getText(); DivElement div = Document.get().createDivElement(); div.setInnerHTML(svg); setElement((Element) div.getChild(0)); }
From source file:client.VikiDatastruct.java
License:Apache License
protected void inject(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(); }
From source file:com.ait.tooling.nativetools.client.util.Client.java
License:Open Source License
public final Client injectJs(final TextResource js) { return injectJs(js.getText()); }
From source file:com.ait.tooling.nativetools.client.util.Client.java
License:Open Source License
public final Client injectJs(final TextResource js, final boolean removeTag) { return injectJs(js.getText(), removeTag); }
From source file:com.ait.tooling.nativetools.client.util.Client.java
License:Open Source License
public final Client injectStyle(final TextResource css) { return injectStyle(css.getText()); }
From source file:com.ait.toolkit.core.client.Util.java
License:Open Source License
public static void injectJs(TextResource js) { injectJs(js.getText()); }
From source file:com.ait.toolkit.core.client.Util.java
License:Open Source License
public static void injectStyle(TextResource css) { StyleInjector.inject(css.getText()); }
From source file:com.bramosystems.oss.player.showcase.client.StageController.java
License:Apache License
private void loadDoc(ExternalTextResource res) { panel.setWidget(docPane);/*w ww. ja va 2 s . c o m*/ try { res.getText(new ResourceCallback<TextResource>() { @Override public void onError(ResourceException e) { docPane.setHTML("<h2>Resource loading failed!</h2><br/>" + e.getMessage()); } @Override public void onSuccess(TextResource resource) { docPane.setHTML(resource.getText()); } }); } catch (ResourceException ex) { docPane.setHTML("<h2>Resource loading failed!</h2><br/>" + ex.getMessage()); } }
From source file:com.github.gwtbootstrap.client.ui.resources.prettify.PrettifyHelper.java
License:Apache License
/** * will import the language if needed./* w ww .j av a2 s .co m*/ */ public void setLang(String lang) { int i = PrettifyResources.speciallangs.indexOf(lang); // XXX thats very very very very ugly, sorry. if (i > -1 && !importedLangs.contains(i)) { TextResource tr = null; switch (i) { case 0: tr = PrettifyResources.RESOURCES.apollo(); break; case 1: tr = PrettifyResources.RESOURCES.clj(); break; case 2: tr = PrettifyResources.RESOURCES.css(); break; case 3: tr = PrettifyResources.RESOURCES.go(); break; case 4: tr = PrettifyResources.RESOURCES.hs(); break; case 5: tr = PrettifyResources.RESOURCES.lisp(); break; case 6: tr = PrettifyResources.RESOURCES.lua(); break; case 7: tr = PrettifyResources.RESOURCES.ml(); break; case 8: tr = PrettifyResources.RESOURCES.ml(); break; case 9: tr = PrettifyResources.RESOURCES.n(); break; case 10: tr = PrettifyResources.RESOURCES.proto(); break; case 11: tr = PrettifyResources.RESOURCES.scala(); break; case 12: tr = PrettifyResources.RESOURCES.sql(); break; case 13: tr = PrettifyResources.RESOURCES.tex(); break; case 14: tr = PrettifyResources.RESOURCES.vb(); break; case 15: tr = PrettifyResources.RESOURCES.vhdl(); break; case 16: tr = PrettifyResources.RESOURCES.wiki(); break; case 17: tr = PrettifyResources.RESOURCES.xq(); break; default: break; } if (tr != null) { JavaScriptInjector.inject(tr.getText()); importedLangs.add(i); } } }
From source file:com.github.gwtbootstrap.client.ui.resources.ResourceInjector.java
License:Apache License
private static void injectCss(TextResource r) { StyleInjector.inject(r.getText()); }