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

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

Introduction

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

Prototype

JavaScriptObject TOP_WINDOW

To view the source code for com.google.gwt.core.client ScriptInjector TOP_WINDOW.

Click Source Link

Document

Returns the top level window object.

Usage

From source file:org.gwtbootstrap3.extras.datetimepicker.client.DateTimePickerEntryPoint.java

License:Apache License

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

From source file:org.gwtbootstrap3.extras.datetimepicker.client.ui.base.DateTimePickerBase.java

License:Apache License

/** {@inheritDoc} */
@Override/*from ww w.  j  av a 2s .co m*/
public void setLanguage(final DateTimePickerLanguage 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 source file:org.gwtbootstrap3.extras.fullcalendar.client.FullCalendarEntryPoint.java

License:Apache License

@Override
public void onModuleLoad() {
    StyleInjector.injectAtEnd(FullCalendarClientBundle.INSTANCE.fullCalendarCss().getText());
    StyleInjector.injectAtEnd(//from  w  ww  . j  a v  a2s. c o  m
            "@media print {" + FullCalendarClientBundle.INSTANCE.fullCalendarPrintCss().getText() + "}");

    if (!isMomentPresent()) {
        ScriptInjector.fromString(FullCalendarClientBundle.INSTANCE.getMomentJS().getText())
                .setWindow(ScriptInjector.TOP_WINDOW).inject();
    }

    if (!isCalendarPresent()) {
        ScriptInjector.fromString(FullCalendarClientBundle.INSTANCE.getFullCalendarJS().getText())
                .setWindow(ScriptInjector.TOP_WINDOW).inject();
    }

    if (!isDragAndResizePresent()) {
        ScriptInjector.fromString(FullCalendarClientBundle.INSTANCE.getCustomDragResizeJS().getText())
                .setWindow(ScriptInjector.TOP_WINDOW).inject();
    }
}

From source file:org.gwtbootstrap3.extras.fullcalendar.client.ui.EventSource.java

License:Apache License

public EventSource(final String url, final String color, final String backgroundColor, final String textColor,
        final String borderColor, final String className, final boolean isEditable,
        final boolean isStartEditable, final boolean isDurationEditable, final boolean allDayDefault,
        final boolean ignoreTimeZone, final boolean isGoogle//if true include google script file
) {/*from   w  w w  .  ja v a 2  s.c o m*/
    if (isGoogle && !GCAL_ADDED) {
        GCAL_ADDED = true;
        ScriptInjector.fromString(FullCalendarClientBundle.INSTANCE.getGoogleCalJS().getText())
                .setWindow(ScriptInjector.TOP_WINDOW).inject();
    }
    newEvent(url, color, backgroundColor, textColor, borderColor, className, isEditable, isStartEditable,
            isDurationEditable, allDayDefault, ignoreTimeZone);
}

From source file:org.gwtbootstrap3.extras.fullcalendar.client.ui.FullCalendar.java

License:Apache License

private void ensureInjected(final Language language) {
    if (!languageScripts.isEmpty()) {
        for (final JavaScriptObject script : languageScripts.values()) {
            try {
                final Element ele = (Element) script;
                ele.removeFromParent();//from w  w w  .j a  v  a  2  s.  co  m
            } catch (final Exception e) {
                // TODO: handle exception
            }
        }
    }
    final JavaScriptObject scriptElement = ScriptInjector.fromString(language.getResource().getText())
            .setWindow(ScriptInjector.TOP_WINDOW).inject();
    languageScripts.put(language.getCode(), scriptElement);
}

From source file:org.gwtbootstrap3.extras.gallery.client.GalleryEntryPoint.java

License:Apache License

private void inject(TextResource resource) {
    ScriptInjector.fromString(resource.getText()).setWindow(ScriptInjector.TOP_WINDOW).inject();
}

From source file:org.gwtbootstrap3.extras.growl.client.GrowlEntryPoint.java

License:Apache License

@Override
public void onModuleLoad() {
    if (!isGrowlPresent()) {
        ScriptInjector.fromString(GrowlClientBundle.INSTANCE.growlJS().getText())
                .setWindow(ScriptInjector.TOP_WINDOW).inject();
    }//from w  ww . jav  a 2s  . c  o  m
}

From source file:org.gwtbootstrap3.extras.notify.client.NotifyEntryPoint.java

License:Apache License

@Override
public void onModuleLoad() {
    if (!isNotifyLoaded()) {
        ScriptInjector.fromString(NotifyClientBundle.INSTANCE.notifyJS().getText())
                .setWindow(ScriptInjector.TOP_WINDOW).inject();
    }/*from w  w  w.j a  va 2s.co m*/
}

From source file:org.gwtbootstrap3.extras.respond.client.RespondEntryPoint.java

License:Apache License

@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();
    }/*from ww  w  .  j av  a 2s.c  om*/
}

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();
}