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

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

Introduction

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

Prototype

public void setBackgroundColor(String value) 

Source Link

Usage

From source file:cc.alcina.framework.gwt.client.widget.GlassDisplayer.java

License:Apache License

public void show(boolean show) {
    RootPanel.get().setStyleName("glass-showing", show);
    if (!show) {/*from www . jav a2 s.  c  o m*/
        if (glass != null) {
            glass.hide();
        }
        return;
    }
    if (glass == null) {
        glass = new PopupPanel();
        fp = new FlowPanelClickable();
        fp.setStyleName("alcina-GlassPanel");
        fp.setWidth(Window.getClientWidth() + "px");
        fp.setHeight(Math.max(Document.get().getBody().getOffsetHeight(), Window.getClientHeight()) + "px");
        Style style = fp.getElement().getStyle();
        style.setBackgroundColor("#000");
        updateOpacity();
        glass.setStyleName("alcina-GlassPopup");
        glass.add(fp);
        glass.setAnimationEnabled(false);
    }
    glass.show();
}

From source file:cc.kune.initials.InitialLabel.java

License:GNU Affero Public License

public void setStyle(final int height, final int fontSize) {
    final Style style = getElement().getStyle();
    style.setBackgroundColor(AvatarCompositeFactory.getColorProvider().getColor(name));
    style.setLineHeight(height, Unit.PX);
    style.setFontSize(fontSize, Unit.PX);
}

From source file:co.fxl.gui.gwt.GWTElement.java

License:Open Source License

protected IColor newBackgroundColor() {
    GWTWidgetStyle style = new GWTWidgetStyle("background-color-", container.widget);
    return new GWTStyleColor(style) {
        @Override/*ww w  .  j a  v a2  s .  co m*/
        void setColor(String color, com.google.gwt.dom.client.Style stylable) {
            stylable.setBackgroundColor(color);
        }
    };
}

From source file:co.fxl.gui.gwt.GWTPanel.java

License:Open Source License

@Override
public IColor color() {
    GWTWidgetStyle style = new GWTWidgetStyle("background-color-", container.widget);
    return new GWTStyleColor(style) {

        @Override/*from   www. j av  a2  s. c  o  m*/
        void setColor(String color, com.google.gwt.dom.client.Style stylable) {
            stylable.setBackgroundColor(color);
        }
    };
}

From source file:co.fxl.gui.gwt.GWTPasswordField.java

License:Open Source License

@Override
public IColor color() {
    GWTWidgetStyle style = new GWTWidgetStyle("background-color-", container.widget);
    return new GWTStyleColor(style) {
        @Override//from w  ww .j a  va  2  s .  c o  m
        void setColor(String color, com.google.gwt.dom.client.Style stylable) {
            stylable.setBackgroundColor(color);
        }
    };
}

From source file:co.fxl.gui.gwt.GWTTextAreaTemplate.java

License:Open Source License

@Override
public final IColor color() {
    GWTWidgetStyle style = new GWTWidgetStyle("background-color-", container.widget);
    return new GWTStyleColor(style) {
        @Override//from w  w w .  j a  v a2  s . c  o m
        void setColor(String color, com.google.gwt.dom.client.Style stylable) {
            stylable.setBackgroundColor(color);
        }
    };
}

From source file:com.ait.lienzo.client.widget.panel.mediators.PanelPreviewMediator.java

License:Apache License

@Override
protected void onEnable() {
    final LienzoBoundsPanel panel = getPanel();
    final int panelWidthPx = panel.getWidthPx();
    final int panelHeightPx = panel.getHeightPx();
    final Style style = previewPanel.getElement().getStyle();
    style.setPosition(Style.Position.ABSOLUTE);
    style.setTop(0, Style.Unit.PX);
    style.setLeft(0, Style.Unit.PX);
    style.setBorderStyle(Style.BorderStyle.NONE);
    style.setBackgroundColor(PREVIEW_BG_COLOR);
    previewPanel.setPixelSize(panelWidthPx, panelHeightPx);
    previewPanel.setVisible(true);//from w  w w  . j  a v a2  s  .c  o  m

    final BoundingBox areaBox = area.get();
    final double fitLevel = PanelTransformUtils.computeZoomLevelFitToWidth(areaBox.getWidth(),
            areaBox.getHeight(), panel);

    final Viewport viewport = previewLayer.getViewport();
    final Transform transform = new Transform();
    transform.translate(areaBox.getX(), areaBox.getY());
    transform.scale(fitLevel, fitLevel);
    viewport.setTransform(transform);

    getLayer().drawWithTransforms(previewLayer.getContext(), 1,
            new BoundingBox(0, 0, panelWidthPx, panelHeightPx), new Supplier<Transform>() {
                @Override
                public Transform get() {
                    return transform;
                }
            });

    mediator.setMaxScale(maxScale);
    mediator.setEnabled(true);
    getLayer().setVisible(false);
}

From source file:com.alkacon.geranium.client.util.DebugLog.java

License:Open Source License

/**
 * Constructor.<p>//from  w w w. j av a2 s.  c  o  m
 */
@SuppressWarnings("unused")
private DebugLog() {

    if (!DEBUG) {
        return;
    }
    m_html = new HTML();
    initWidget(m_html);
    Style style = getElement().getStyle();
    style.setWidth(200, Unit.PX);
    style.setHeight(500, Unit.PX);
    style.setPadding(10, Unit.PX);
    style.setOverflow(Overflow.AUTO);
    style.setBorderStyle(BorderStyle.SOLID);
    style.setBorderColor(I_LayoutBundle.INSTANCE.constants().css().borderColor());
    style.setBorderWidth(1, Unit.PX);
    style.setPosition(Position.FIXED);
    style.setTop(50, Unit.PX);
    style.setRight(50, Unit.PX);
    style.setBackgroundColor(I_LayoutBundle.INSTANCE.constants().css().backgroundColorDialog());
    style.setZIndex(10);
}

From source file:com.allen_sauer.gwt.dnd.client.MouseDragHandler.java

License:Apache License

private void initCapturingWidget() {
    capturingWidget = new FocusPanel();
    capturingWidget.addMouseMoveHandler(this);
    capturingWidget.addMouseUpHandler(this);
    capturingWidget.addTouchMoveHandler(this);
    capturingWidget.addTouchEndHandler(this);
    capturingWidget.addTouchCancelHandler(this);
    Style style = capturingWidget.getElement().getStyle();
    // workaround for IE8 opacity http://code.google.com/p/google-web-toolkit/issues/detail?id=5538
    style.setProperty("filter", "alpha(opacity=0)");
    style.setOpacity(0);//from  w ww .  ja  v  a2 s.c  o m
    style.setZIndex(1000);
    style.setMargin(0, Style.Unit.PX);
    style.setBorderStyle(BorderStyle.NONE);
    style.setBackgroundColor("blue");
}

From source file:com.bearsoft.gwt.ui.widgets.DecoratorBox.java

public void setWidget(HasValue<T> w) {
    if (decorated != w) {
        if (changeValueHandler != null) {
            changeValueHandler.removeHandler();
        }//from ww w.j  a va2  s .  c o  m
        if (keyDownHandler != null)
            keyDownHandler.removeHandler();
        if (keyUpHandler != null)
            keyUpHandler.removeHandler();
        if (keyPressHandler != null)
            keyPressHandler.removeHandler();
        if (focusHandler != null)
            focusHandler.removeHandler();
        if (blurHandler != null)
            blurHandler.removeHandler();
        if (decorated instanceof Widget) {
            ((Widget) decorated).removeFromParent();
        }
        decorated = w;
        if (decorated != null) {
            changeValueHandler = decorated.addValueChangeHandler(new ValueChangeHandler<T>() {

                @Override
                public void onValueChange(ValueChangeEvent<T> event) {
                    fireValueChangeEvent();
                }
            });
            if (decorated instanceof Widget) {
                CommonResources.INSTANCE.commons().ensureInjected();
                ((Widget) decorated).getElement()
                        .addClassName(CommonResources.INSTANCE.commons().borderSized());
                Style style = ((Widget) decorated).getElement().getStyle();
                style.setBorderWidth(0, Style.Unit.PX);
                style.setPadding(0, Style.Unit.PX);
                style.setMargin(0, Style.Unit.PX);
                style.setPosition(Style.Position.ABSOLUTE);
                style.setDisplay(Style.Display.INLINE_BLOCK);
                style.setLeft(0, Style.Unit.PX);
                style.setTop(0, Style.Unit.PX);
                style.setHeight(100, Style.Unit.PCT);
                style.setWidth(100, Style.Unit.PCT);
                style.setOutlineStyle(Style.OutlineStyle.NONE);
                style.setBackgroundColor("inherit");
                style.setColor("inherit");
                contentWrapper.setWidget((Widget) decorated);
            }
            if (decorated instanceof HasKeyDownHandlers) {
                keyDownHandler = ((HasKeyDownHandlers) decorated).addKeyDownHandler(new KeyDownHandler() {

                    @Override
                    public void onKeyDown(KeyDownEvent event) {
                        KeyDownEvent.fireNativeEvent(event.getNativeEvent(), DecoratorBox.this);
                    }
                });
            }
            if (decorated instanceof HasKeyUpHandlers) {
                keyUpHandler = ((HasKeyUpHandlers) decorated).addKeyUpHandler(new KeyUpHandler() {

                    @Override
                    public void onKeyUp(KeyUpEvent event) {
                        KeyUpEvent.fireNativeEvent(event.getNativeEvent(), DecoratorBox.this);
                    }
                });
            }
            if (decorated instanceof HasKeyPressHandlers) {
                keyPressHandler = ((HasKeyPressHandlers) decorated).addKeyPressHandler(new KeyPressHandler() {

                    @Override
                    public void onKeyPress(KeyPressEvent event) {
                        KeyPressEvent.fireNativeEvent(event.getNativeEvent(), DecoratorBox.this);
                    }
                });
            }
            if (decorated instanceof HasFocusHandlers) {
                focusHandler = ((HasFocusHandlers) decorated).addFocusHandler(new FocusHandler() {

                    @Override
                    public void onFocus(FocusEvent event) {
                        DecoratorBox.this.getElement().addClassName(DECORATOR_FOCUSED_CLASS_NAME);
                        FocusEvent.fireNativeEvent(event.getNativeEvent(), DecoratorBox.this);
                    }

                });
            }
            if (decorated instanceof HasBlurHandlers) {
                blurHandler = ((HasBlurHandlers) decorated).addBlurHandler(new BlurHandler() {

                    @Override
                    public void onBlur(BlurEvent event) {
                        DecoratorBox.this.getElement().removeClassName(DECORATOR_FOCUSED_CLASS_NAME);
                        BlurEvent.fireNativeEvent(event.getNativeEvent(), DecoratorBox.this);
                    }

                });
            }
        }
    }
}