Example usage for com.google.gwt.resources.client TextResource getName

List of usage examples for com.google.gwt.resources.client TextResource getName

Introduction

In this page you can find the example usage for com.google.gwt.resources.client TextResource getName.

Prototype

String getName();

Source Link

Document

Returns the name of the function within the ClientBundle used to create the ResourcePrototype.

Usage

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:gwt.material.design.addins.client.MaterialResourceInjector.java

License:Apache License

public static void injectJs(TextResource resource, final boolean removeTag, boolean sourceUrl,
        boolean isScheduleDeferred) {
    final String text = resource.getText() + (sourceUrl ? "//# sourceURL=" + resource.getName() + ".js" : "");

    if (isScheduleDeferred) {
        Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() {

            @Override/*from  ww  w  . j a  v  a 2s  .com*/
            public void execute() {
                // Inject the script resource
                ScriptInjector.fromString(text).setWindow(ScriptInjector.TOP_WINDOW).setRemoveTag(removeTag)
                        .inject();
            }
        });
    } else {
        ScriptInjector.fromString(text).setWindow(ScriptInjector.TOP_WINDOW).setRemoveTag(removeTag).inject();
    }
}

From source file:gwt.material.design.components.client.GwtMDC.java

License:Apache License

public static void injectJs(TextResource resource, boolean removeTag, boolean sourceUrl) {

    final 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:org.jboss.hal.meta.description.StaticResourceDescription.java

License:Apache License

public static ResourceDescription from(TextResource resource) {
    try {//w w w . j  a v a2s .  c o  m
        return new ResourceDescription(ModelNode.fromBase64(resource.getText()));
    } catch (IllegalArgumentException e) {
        throw new IllegalArgumentException(
                "Unable to read static resource description from " + resource.getName());
    }
}