Example usage for com.google.gwt.dom.client Style getColor

List of usage examples for com.google.gwt.dom.client Style getColor

Introduction

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

Prototype

public String getColor() 

Source Link

Usage

From source file:org.clevermore.monitor.client.servers.ServersWidget.java

License:Apache License

private void blinkCertButton() {
    Boolean blink = Boolean.valueOf(certs.getElement().getAttribute("blink"));
    if (!blink) {
        certs.getElement().setAttribute("blink", "true");
        Scheduler.get().scheduleFixedDelay(new RepeatingCommand() {

            @Override// w  w  w.  ja  v a2 s .c om
            public boolean execute() {
                Boolean blink = Boolean.valueOf(certs.getElement().getAttribute("blink"));
                Style style = certs.getElement().getStyle();
                if (blink) {
                    style.setColor("red".equals(style.getColor()) ? "green" : "red");
                    style.setFontWeight(FontWeight.BOLDER);
                } else {
                    style.setColor("black");
                    style.setFontWeight(FontWeight.NORMAL);
                }
                return blink;
            }
        }, 1000);
    }
}

From source file:org.rstudio.studio.client.application.ApplicationThemes.java

License:Open Source License

@Override
public void onComputeThemeColors(ComputeThemeColorsEvent event) {
    // Establish defaults
    String foreground = "#000000";
    String background = "#FFFFFF";

    // We're very exception sensitive here since this code runs in a
    // WaitForMethod (and therefore can hold the server while we wait for it
    // to return).
    try {/* w ww .j  a  v  a  2  s.c  om*/
        // Create a sampler element to read runtime styles; hide it and position
        // it offscreen to ensure it doesn't flicker.
        Element sampler = Document.get().createElement("div");
        sampler.addClassName("ace_editor ace_content");
        sampler.getStyle().setVisibility(Visibility.HIDDEN);
        sampler.getStyle().setPosition(Position.ABSOLUTE);
        sampler.getStyle().setTop(-10000, Unit.PX);
        sampler.getStyle().setLeft(-10000, Unit.PX);

        // Append the sampler element to the root panel, read its content, and
        // remove it.
        root_.appendChild(sampler);
        Style style = DomUtils.getComputedStyles(sampler);
        foreground = style.getColor();
        background = style.getBackgroundColor();
        root_.removeChild(sampler);
    } catch (Exception e) {
        Debug.logException(e);
    }

    // Send the server the computed colors
    server_.setComputedThemeColors(foreground, background, new VoidServerRequestCallback());
}

From source file:org.rstudio.studio.client.workbench.views.source.DocumentOutlineWidget.java

License:Open Source License

private void updateStyles(Widget widget, Style computed) {
    Style outlineStyles = widget.getElement().getStyle();
    outlineStyles.setBackgroundColor(computed.getBackgroundColor());
    outlineStyles.setColor(computed.getColor());
}