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:org.jbpm.dashboard.renderer.client.panel.ProcessDashboardView.java

License:Apache License

protected DisplayerContainer createChartContainer(Map<String, Displayer> m, boolean showHeader) {
    DisplayerContainer container = new DisplayerContainer(m, showHeader);
    Style s = container.getView().getHeaderStyle();
    s.setBackgroundColor("white");
    s = container.getView().getBodyStyle();
    s.setBackgroundColor("white");
    s.setPaddingBottom(30, Style.Unit.PX);
    return container;
}

From source file:org.jbpm.dashboard.renderer.client.panel.widgets.MetricViewExt.java

License:Apache License

public void applySettings(DisplayerSettings displayerSettings) {
    this.displayerSettings = displayerSettings;
    int w = displayerSettings.getChartWidth();
    int h = displayerSettings.getChartHeight();
    int mtop = displayerSettings.getChartMarginTop();
    int mbottom = displayerSettings.getChartMarginBottom();
    int mleft = displayerSettings.getChartMarginLeft();
    int mright = displayerSettings.getChartMarginRight();

    // Hero panel (size)
    Style style = centerPanel.getElement().getStyle();
    style.setPadding(0, Style.Unit.PX);
    style.setWidth(w, Style.Unit.PX);
    style.setHeight(h, Style.Unit.PX);
    style.setTextAlign(Style.TextAlign.CENTER);
    style.setVerticalAlign(Style.VerticalAlign.MIDDLE);
    if (!StringUtils.isBlank(displayerSettings.getChartBackgroundColor())) {
        style.setBackgroundColor("#" + displayerSettings.getChartBackgroundColor());
    }/*  ww  w . java2  s  .  c o  m*/

    // Center panel (paddings)
    style = centerPanel.getElement().getStyle();
    style.setPaddingTop(mtop, Style.Unit.PX);
    style.setPaddingBottom(mbottom, Style.Unit.PX);
    style.setPaddingLeft(mleft, Style.Unit.PX);
    style.setPaddingRight(mright, Style.Unit.PX);

    // Title panel
    titlePanel.setVisible(displayerSettings.isTitleVisible());
    titlePanel.setText(displayerSettings.getTitle());
}

From source file:org.jbpm.dashboard.renderer.client.panel.widgets.MetricViewExt.java

License:Apache License

public void filterOn() {
    Style style = titlePanel.getElement().getStyle();
    style.setColor("#FFFFFF");
    style = metricHeading.getElement().getStyle();
    style.setColor("#FFFFFF");
    style = centerPanel.getElement().getStyle();
    style.setBackgroundColor("blue");
}

From source file:org.jbpm.form.builder.ng.model.common.panels.FieldSetPanel.java

License:Apache License

public FieldSetPanel() {
    super();//from   w w  w  . j  av a  2 s. c  om
    Style divStyle = getElement().getStyle();
    Style lgndStyle = legend.getStyle();

    divStyle.setBorderWidth(2, Unit.PX);
    divStyle.setBorderStyle(BorderStyle.SOLID);
    divStyle.setMarginTop(0.5, Unit.EM);
    divStyle.setMarginBottom(0.5, Unit.EM);
    divStyle.setMarginRight(0, Unit.PX);
    divStyle.setMarginLeft(0, Unit.PX);
    divStyle.setPaddingTop(0, Unit.PX);
    divStyle.setPaddingBottom(0, Unit.PX);
    divStyle.setPaddingRight(0.5, Unit.EM);
    divStyle.setPaddingLeft(0.5, Unit.EM);

    lgndStyle.setFontSize(100.0, Unit.PCT);
    lgndStyle.setFontWeight(FontWeight.NORMAL);
    lgndStyle.setMarginTop(-0.5, Unit.EM);
    lgndStyle.setMarginRight(0, Unit.PX);
    lgndStyle.setMarginLeft(0, Unit.PX);
    lgndStyle.setMarginBottom(0, Unit.PX);
    lgndStyle.setBackgroundColor("white");
    lgndStyle.setColor("black");
    lgndStyle.setFloat(Style.Float.LEFT);
    lgndStyle.setPaddingTop(0, Unit.PX);
    lgndStyle.setPaddingBottom(0, Unit.PX);
    lgndStyle.setPaddingRight(2, Unit.PX);
    lgndStyle.setPaddingLeft(2, Unit.PX);

    getElement().appendChild(legend);
}

From source file:org.komodo.web.client.panels.vdb.VdbEditPanel.java

License:Apache License

private Widget createObjectPropertiesPanel() {
    Style objPropPanelStyle = objectPropertiesPanel.getElement().getStyle();

    /*//from   www.j  a v a  2 s.  c  o m
     * Want to position the properties panel so its always to the right
     * of the diagram panel, even when zoomed in. Float: left fails to
     * work at this point since zoom in enough and the properties
     * panel jumps down below.
     */

    /*
     * Set the position of the properties panel to absolute so that we
     * are now in charge of its location
     */
    objPropPanelStyle.setPosition(Position.ABSOLUTE);

    /*
     * Set its position as being on same level as diagram panel
     */
    objPropPanelStyle.setTop(0, Unit.EM);

    /*
     * Move it to the right of the diagram panel which is the
     * diagram panel width + border width + an extra 2 units
     * to account for the vertical scrollbar width
     */
    objPropPanelStyle.setLeft(DIAGRAM_PANEL_WIDTH + BORDER_WIDTH + 2, Unit.EM);

    /*
     * Set its width and height to appropriate values
     */
    objPropPanelStyle.setWidth((DIAGRAM_PANEL_WIDTH * 3) / 5, Unit.EM);
    objPropPanelStyle.setHeight(EDIT_PANEL_HEIGHT, Unit.EM);

    /*
     * Set its background colour to a subtle shade that just frames the panel
     */
    objPropPanelStyle.setBackgroundColor("#fAfAfA"); //$NON-NLS-1$

    /*
     * Set overflow to use scrollbars if required
     */
    objPropPanelStyle.setOverflow(Overflow.AUTO);

    /*
     * Add the title
     */
    Label propertyTitle = new Label("Property Editor"); //$NON-NLS-1$
    Style titleStyle = propertyTitle.getElement().getStyle();

    /*
     * Centre the title
     * Set its font size and make it bold
     * Set its height as this ensures a value we can know when
     * passing on the remaining content area to the sub panels, ie.
     * SUB_PANEL_HEIGHT = DIAGRAM_PANEL_HEIGHT
     *                                          - PROPERTY_TITLE_HEIGHT + (BORDER_WIDTH * 2)
     */
    titleStyle.setTextAlign(TextAlign.CENTER);
    titleStyle.setFontSize(1, Unit.EM);
    titleStyle.setFontWeight(FontWeight.BOLD);
    titleStyle.setLineHeight(PROPERTY_TITLE_HEIGHT, Unit.EM);
    titleStyle.setHeight(PROPERTY_TITLE_HEIGHT, Unit.EM);
    objectPropertiesPanel.add(propertyTitle);

    return objectPropertiesPanel;
}

From source file:org.nsesa.editor.gwt.core.client.ui.document.sourcefile.marker.MarkerViewImpl.java

License:EUPL

@Override
public FocusWidget addMarker(final double top, final String color) {

    int height = getOffsetHeight();

    double v = height * top;

    LOG.info("Drawing marker at " + (int) v);

    Anchor marker = new Anchor("<div></div>", true);
    mainPanel.add(marker);/* w ww .j  ava2  s  .  c om*/
    final Style style = marker.getElement().getFirstChildElement().getStyle();
    style.setPosition(Style.Position.ABSOLUTE);
    style.setTop((int) v, Style.Unit.PX);
    style.setWidth(100, Style.Unit.PCT);
    style.setHeight(5, Style.Unit.PX);
    style.setBorderWidth(1.0, Style.Unit.PX);
    style.setBackgroundColor(color);
    return marker;

}

From source file:org.opencms.gwt.client.util.CmsDebugLog.java

License:Open Source License

/**
 * Constructor.<p>//from  w ww . j  a v  a2s.c  om
 */
@SuppressWarnings("unused")
private CmsDebugLog() {

    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_CmsLayoutBundle.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_CmsLayoutBundle.INSTANCE.constants().css().backgroundColorDialog());
    style.setZIndex(10);
}

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());
}

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

License:Open Source License

public ConsoleProgressDialog(String title, ConsoleProcess consoleProcess) {
    consoleProcess_ = consoleProcess;/*from   w  w w  .  ja v  a 2  s .co  m*/

    setText(title);

    registrations_ = new HandlerRegistrations();
    registrations_.add(consoleProcess.addConsoleOutputHandler(this));
    registrations_.add(consoleProcess.addProcessExitHandler(this));

    output_ = new PreWidget();
    output_.getElement().getStyle().setMargin(0, Unit.PX);
    output_.getElement().getStyle().setFontSize(11, Unit.PX);

    scrollPanel_ = new BottomScrollPanel(output_);
    scrollPanel_.setSize("640px", "200px");

    Style style = scrollPanel_.getElement().getStyle();
    style.setBackgroundColor("white");
    style.setBorderStyle(BorderStyle.SOLID);
    style.setBorderColor("#BBB");
    style.setBorderWidth(1, Style.Unit.PX);
    style.setMargin(0, Unit.PX);
    style.setMarginBottom(3, Unit.PX);
    style.setPadding(4, Unit.PX);

    status_ = new Label("The process is executing...");

    button_ = new ThemedButton("Stop", this);
    addOkButton(button_);

    consoleProcess.start(new SimpleRequestCallback<Void>() {
        @Override
        public void onError(ServerError error) {
            // Show error and stop
            super.onError(error);
            closeDialog();
        }
    });
}

From source file:org.uberfire.ext.widgets.table.client.ResizableMovableHeader.java

License:Apache License

private static void setLine(final Style style, final int width, final int top, final int height,
        final String color) {
    style.setPosition(Position.ABSOLUTE);
    style.setTop(top, PX);/*w  w w.  j ava  2 s  . co  m*/
    style.setHeight(height, PX);
    style.setWidth(width, PX);
    style.setBackgroundColor(color);
    style.setZIndex(Integer.MAX_VALUE);
}