Example usage for com.google.gwt.dom.client StyleInjector injectAtStart

List of usage examples for com.google.gwt.dom.client StyleInjector injectAtStart

Introduction

In this page you can find the example usage for com.google.gwt.dom.client StyleInjector injectAtStart.

Prototype

public static void injectAtStart(String css) 

Source Link

Document

Add stylesheet data to the document as though it were declared before all stylesheets previously created by #inject(String) .

Usage

From source file:com.allen_sauer.gwt.dnd.client.util.DragEntryPoint.java

License:Apache License

@Override
public void onModuleLoad() {
    setVersion();
    StyleInjector.injectAtStart(DragClientBundle.INSTANCE.css().getText());
}

From source file:com.allen_sauer.gwt.voices.demo.client.VoicesDemo.java

License:Apache License

public void onModuleLoad2() {
    RootPanel mainPanel = RootPanel.get("demo-main-panel");
    StyleInjector.injectAtStart(DemoClientBundle.INSTANCE.css().getText());

    // text area to log sound events as they are triggered
    final HTML eventTextArea = new HTML();
    RootPanel.get("demo-event-text-area").add(eventTextArea);

    DemoSoundHandler demoSoundHandler = new DemoSoundHandler(eventTextArea);

    DisclosurePanel soundSupportMatrix = new DisclosurePanel("Sound Support Matrix for this browser");
    soundSupportMatrix.setContent(new SupportedMimeTypeSummary());
    mainPanel.add(soundSupportMatrix);/* ww w. j  ava  2  s  . c o  m*/

    DisclosurePanel crowdSourceSupportMatrix = new DisclosurePanel(
            "HTML5 MIME Type support in popular browsers");
    Frame crowdSourceFrame = new Frame("https://crowd-source-dot-gwt-voices.appspot.com/?embed=true");
    crowdSourceFrame.setPixelSize(3000, 600);
    crowdSourceFrame.getElement().getStyle().setBorderStyle(BorderStyle.NONE);
    crowdSourceSupportMatrix.setContent(crowdSourceFrame);
    mainPanel.add(crowdSourceSupportMatrix);

    // initialize mimeTypeSoundMap
    for (ThirdPartySound thirdPartySound : thirdPartySounds) {
        String mimeType = thirdPartySound.getMimeType();
        assert MIME_TYPES.contains(mimeType) : "MIME_TYPES must contain '" + mimeType + "'";
        ArrayList<ThirdPartySound> freesoundList = mimeTypeSoundMap.get(mimeType);
        if (freesoundList == null) {
            freesoundList = new ArrayList<ThirdPartySound>();
            mimeTypeSoundMap.put(mimeType, freesoundList);
        }
        freesoundList.add(thirdPartySound);
    }

    // display one panel for each unique MIME type, using the order supplied by
    // MIME_TYPES
    for (String mimeType : MIME_TYPES) {
        ArrayList<ThirdPartySound> soundList = mimeTypeSoundMap.get(mimeType);
        if (soundList != null) {
            SoundController sc = new SoundController();
            for (SoundType soundType : SoundType.values()) {
                maybeShowType(mainPanel, demoSoundHandler, mimeType, soundList, sc, soundType);
            }
        }
    }
    DOM.getElementById("demo-loading").removeFromParent();
}

From source file:org.vaadin.sasha.portallayout.client.dnd.util.DragEntryPoint.java

License:Apache License

public void onModuleLoad() {
    setVersion();
    StyleInjector.injectAtStart(DragClientBundle.INSTANCE.css().getText());
}