Example usage for com.google.gwt.resources.client CssResource getText

List of usage examples for com.google.gwt.resources.client CssResource getText

Introduction

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

Prototype

String getText();

Source Link

Document

Provides the contents of the CssResource.

Usage

From source file:com.floatzcss.gwt.client.util.StyleInjectorUtils.java

License:Apache License

/**
 * Helper method to get CSS text from CSS resource
 *
 * @param resource CSS resource/*w w  w. j  a  v  a  2s  .c om*/
 * @return CSS text
 */
private String getCss(CssResource resource) {
    return mediaQuery != null ? mediaQuery + "{" + resource.getText() + "}" : resource.getText();
}

From source file:com.sencha.gxt.core.client.resources.StyleInjectorHelper.java

License:sencha.com license

/**
 * Ensures that the given CssResource is injected into the document. If the given CssResource has already been
 * injected into the document, this method does nothing.
 *
 * @param style       The CssResource to be injected
 * @param immediately Whether to inject the the CssResource immediately. See {@link StyleInjector#inject(boolean)}.
 * @return {@code true} if the CssResource has been injected successfully, {@code false} otherwise. If the style
 *         resource has already been injected, this method returns {@code false}.
 *//*from  w  w  w.  j  av a  2  s  .co m*/
public static boolean ensureInjected(CssResource style, boolean immediately) {
    if (!injected.contains(style.getClass())) {
        injected.add(style.getClass());
        StyleInjector.inject(style.getText(), immediately);
        return true;
    }
    return false;
}