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

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

Introduction

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

Prototype

public static StyleElement injectStylesheet(String contents) 

Source Link

Document

Add a stylesheet to the document.

Usage

From source file:com.dotweblabs.friendscube.app.client.local.ErrorPage.java

License:Apache License

@PageShowing
public void showing() {
    style = StyleInjector.injectStylesheet(
            "html { background-color: #fff; -webkit-background-size: cover; -moz-background-size: cover;-o-background-size: cover; background-size: cover; } "
                    + "body { background:transparent; }");
}

From source file:com.dotweblabs.friendscube.app.client.local.FriendFeedsPage.java

License:Apache License

@PostConstruct
public void buildUI() {
    StyleInjector.injectStylesheet(".friendscube-profile {width:100%; height:100%;}");
}

From source file:com.dotweblabs.friendscube.app.client.local.LoginPage.java

License:Apache License

@PageShowing
public void showing() {
    style = StyleInjector.injectStylesheet(
            "html { background: url(img/form_bg.jpg) no-repeat center center fixed; -webkit-background-size: cover; -moz-background-size: cover;-o-background-size: cover; background-size: cover; } "
                    + "body { background:transparent; }");
    loadCss();// ww  w.ja  va  2  s  .c o m
    loadJS();
}

From source file:gwt.material.design.themes.client.ThemeLoader.java

License:Apache License

/**
 * Load a provided {@link ThemeBundle} asynchronously.
 *
 * @param bundle The required theme bundle.
 * @param callback The async callback.//ww  w  .j  ava2 s. c o  m
 */
public static void loadAsync(final ThemeBundle bundle, final ThemeAsyncCallback callback) {
    GWT.runAsync(new RunAsyncCallback() {
        @Override
        public void onSuccess() {
            if (bundle != null) {
                if (elements == null) {
                    elements = new ArrayList<>();
                } else {
                    unload();
                }

                // More resources might be loaded in the future.
                elements.add(StyleInjector.injectStylesheet(bundle.style().getText()));
                elements.add(StyleInjector.injectStylesheet(bundle.overrides().getText()));
            }

            if (callback != null) {
                callback.onSuccess(elements.size());
            }
        }

        @Override
        public void onFailure(Throwable reason) {
            if (callback != null) {
                callback.onFailure(reason);
            }
        }
    });
}

From source file:jetbrains.jetpad.cell.toDom.Tooltip.java

License:Apache License

private static Registration injectCornerStyle(String id, Cell cell) {
    Color borderColor = cell.get(Cell.BORDER_COLOR);
    String border = borderColor == null ? "none" : "1px solid " + borderColor.toCssColor();
    Color backgroundColor = cell.get(Cell.BACKGROUND);
    String background = backgroundColor == null ? Color.WHITE.toCssColor() : backgroundColor.toCssColor();
    final StyleElement styleElement = StyleInjector.injectStylesheet("." + id + "::before { border-top: "
            + border + "; border-left: " + border + "; " + "background: linear-gradient(135deg, " + background
            + " 0%, " + background + " 70%, rgba(0,0,0,0) 71%, rgba(0,0,0,0) 100%) }");
    StyleInjector.flush();/*from   w  w w. ja  v a  2s .c o m*/
    return new Registration() {
        @Override
        protected void doRemove() {
            styleElement.removeFromParent();
        }
    };
}

From source file:org.kuali.student.common.ui.client.CommonUI.java

License:Educational Community License

public void onModuleLoad() {
    KSErrorDialog.bindUncaughtExceptionHandler();
    KSBlockingProgressIndicator.initialize();
    resetStyle = StyleInjector.injectStylesheet(Theme.INSTANCE.getCommonCss().getResetCssString());
    initStyle = StyleInjector.injectStylesheet(Theme.INSTANCE.getCommonCss().getInitializeCssString());
    commonStyle = StyleInjector.injectStylesheet(Theme.INSTANCE.getCommonCss().getCssString());
}

From source file:org.kuali.student.core.organization.ui.client.view.OrgEntryPoint.java

License:Educational Community License

@Override
public void onModuleLoad() {
    final ApplicationContext context = Application.getApplicationContext();
    final String injectString = OrgTheme.INSTANCE.getOrgCss().getCssString();
    StyleInjector.injectStylesheet(injectString);

    loadApp(context);//from ww  w .  ja va  2 s . c  o m

    try {
        List<MessageInfo> messages = getSerializedObject("i18nMessages");
        context.addMessages(messages);

    } catch (Exception e) {
        GWT.log("Error on ModuleLoad", e);
    }

    History.fireCurrentHistoryState();

    if (DOM.getElementById("loadingSpinner") != null)
        DOM.removeChild(ApplicationPanel.get().getElement(), DOM.getElementById("loadingSpinner"));
}

From source file:org.kuali.student.lum.lu.ui.main.client.LUMMainEntryPoint.java

License:Educational Community License

@Override
public void onModuleLoad() {
    final ApplicationContext context = Application.getApplicationContext();

    final String injectString = LumTheme.INSTANCE.getLumCss().getCssString();
    StyleInjector.injectStylesheet(injectString);

    try {/* www .  j av  a2 s  .  c o m*/
        loadMessages(context);
        loadApp(context);
    } catch (Exception e) {
        GWT.log("Error loading entrypoint", e);
    }
}

From source file:org.onebusaway.webapp.gwt.viewkit.ViewKitEntryPoint.java

License:Apache License

@Override
public void onModuleLoad() {
    StyleInjector.injectStylesheet(ViewKitResources.INSTANCE.getCSS().getText());
}