Example usage for com.google.gwt.core.client ScriptInjector fromString

List of usage examples for com.google.gwt.core.client ScriptInjector fromString

Introduction

In this page you can find the example usage for com.google.gwt.core.client ScriptInjector fromString.

Prototype

public static FromString fromString(String scriptBody) 

Source Link

Document

Build an injection call for directly setting the script text in the DOM.

Usage

From source file:org.gwtbootstrap3.extras.select.client.SelectEntryPoint.java

License:Apache License

@Override
public void onModuleLoad() {
    ScriptInjector.fromString(SelectClientBundle.INSTANCE.selectJs().getText())
            .setWindow(ScriptInjector.TOP_WINDOW).inject();
}

From source file:org.gwtbootstrap3.extras.select.client.ui.Select.java

License:Apache License

@Override
public void setLanguage(final SelectLanguage language) {
    this.language = language;

    // Inject the JS for the language
    if (language.getJs() != null) {
        ScriptInjector.fromString(language.getJs().getText()).setWindow(ScriptInjector.TOP_WINDOW).inject();
    }/*from w ww .ja va 2 s. c o m*/
}

From source file:org.gwtbootstrap3.extras.select.client.ui.SelectBase.java

License:Apache License

@Override
protected void onLoad() {
    super.onLoad();
    // Inject the language JS is necessary
    if (language.getJs() != null) {
        ScriptInjector.fromString(language.getJs().getText()).setWindow(ScriptInjector.TOP_WINDOW).inject();
    }// w w w .j a va2  s . c o m
    initialize(getElement(), options);
    bindSelectEvents(getElement());
}

From source file:org.gwtbootstrap3.extras.slider.client.SliderEntryPoint.java

License:Apache License

@Override
public void onModuleLoad() {
    if (!isSliderLoaded()) {
        ScriptInjector.fromString(SliderClientBundle.INSTANCE.slider().getText())
                .setWindow(ScriptInjector.TOP_WINDOW).inject();
    }/*w w w.  ja  va 2  s.c om*/
}

From source file:org.gwtbootstrap3.extras.summernote.client.SummernoteEntryPoint.java

License:Apache License

@Override
public void onModuleLoad() {
    ScriptInjector.fromString(SummernoteClientBundle.INSTANCE.summernote().getText())
            .setWindow(ScriptInjector.TOP_WINDOW).inject();
}

From source file:org.gwtbootstrap3.extras.summernote.client.ui.base.SummernoteBase.java

License:Apache License

private void initialize() {
    // Inject the language JS is necessary
    if (language.getJs() != null) {
        ScriptInjector.fromString(language.getJs().getText()).setWindow(ScriptInjector.TOP_WINDOW).inject();
    }//from  ww  w  .  j av a  2  s  . co  m
    // Initialize
    initialize(getElement(), options);
}

From source file:org.gwtbootstrap3.extras.tagsinput.client.TagsInputEntryPoint.java

License:Apache License

@Override
public void onModuleLoad() {
    ScriptInjector.fromString(TagsInputClientBundle.INSTANCE.tagsinput().getText())
            .setWindow(ScriptInjector.TOP_WINDOW).inject();
}

From source file:org.gwtbootstrap3.extras.toggleswitch.client.ToggleSwitchEntryPoint.java

License:Apache License

@Override
public void onModuleLoad() {
    ScriptInjector.fromString(ToggleSwitchClientBundle.INSTANCE.toggleswitch().getText())
            .setWindow(ScriptInjector.TOP_WINDOW).inject();
}

From source file:org.gwtbootstrap3.extras.typeahead.client.TypeaheadEntryPoint.java

License:Apache License

@Override
public void onModuleLoad() {
    ScriptInjector.fromString(TypeaheadClientBundle.INSTANCE.typeahead().getText())
            .setWindow(ScriptInjector.TOP_WINDOW).inject();
}

From source file:org.gwtvisualizationwrappers.client.cytoscape.CytoscapeGraph242.java

License:Apache License

/**
 * Construct and show a cytoscape graph.
 * //from w w  w. ja  v a2  s. co m
 * @param containerId Element ID to put the graph into.
 * @param cytoscapeGraphJson Exported JSON from Cytoscape.
 * http://wiki.cytoscape.org/Cytoscape_3/UserManual#Cytoscape_3.2BAC8-UserManual.2BAC8-CytoscapeJs.Data_Exchange_between_Cytoscape_and_Cytoscape.js
        
{
elements:{
   nodes:[],
   edges:[]
}
style:[{
 selector: 'node',
 style: {
 }
}]
}
 */
public void show(String containerId, String cyjs, String styleJson) {
    //lazy load the cytoscape.js source
    if (!isCytoscape242Loaded()) {
        ScriptInjector.fromString(CytoscapeJsClientBundle.INSTANCE.cytoscape2_4_2().getText())
                .setWindow(ScriptInjector.TOP_WINDOW).inject();
        _init242();
    }

    _initGraph(containerId, cyjs, styleJson);
}