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

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

Introduction

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

Prototype

public void setBorderStyle(BorderStyle value) 

Source Link

Usage

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);/* w  ww . j  a va  2  s  .c  om*/

    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 ww.  j  av a2s  .  co 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 a  2  s  .c  o  m*/
    style.setZIndex(1000);
    style.setMargin(0, Style.Unit.PX);
    style.setBorderStyle(BorderStyle.NONE);
    style.setBackgroundColor("blue");
}

From source file:com.goodow.wave.client.wavepanel.blip.SetColor.java

License:Apache License

@Override
public void onBrowserEvent(final Event event) {
    if (DOM.eventGetType(event) == Event.ONCLICK) {
        if (changeElm == null) {
            Window.alert("changeElm is null!");
            return;
        }//from w w w .  ja  va 2  s .co  m

        NodeList<Element> aTags = changeElm.getElementsByTagName("span");
        Element aTag = aTags.getItem(1);
        Element elm = Element.as(event.getEventTarget());
        Style elmStyle = elm.getStyle();
        Style aTagStyle = aTag.getStyle();

        if (elm.getTitle().equals("White") || elm.getTitle().equals("20% Black")) {
            aTagStyle.setBackgroundColor(elmStyle.getBackgroundColor());
            aTagStyle.setColor("black");
            aTagStyle.setBorderStyle(BorderStyle.SOLID);
            aTagStyle.setBorderWidth(1, Unit.PX);
            aTagStyle.setBorderColor("black");
            aTagStyle.setTextDecoration(TextDecoration.NONE);
        } else {
            if (!aTagStyle.getBorderWidth().equals("")) {
                aTagStyle.clearBorderColor();
                aTagStyle.clearBorderStyle();
                aTagStyle.clearBorderWidth();
            }
            aTagStyle.setTextDecoration(TextDecoration.NONE);
            aTagStyle.setBackgroundColor(elmStyle.getBackgroundColor());
            aTagStyle.setColor("white");
        }
        // Window.alert("title:" + elm.getTitle() + ";color:" + elm.getStyle().getBackgroundColor());
    }
}

From source file:com.vaadin.client.ui.VCustomLayout.java

License:Apache License

public VCustomLayout() {
    setElement(DOM.createDiv());//from w  ww  .  ja  va  2  s . c om
    // Clear any unwanted styling
    Style style = getElement().getStyle();
    style.setBorderStyle(BorderStyle.NONE);
    style.setMargin(0, Unit.PX);
    style.setPadding(0, Unit.PX);

    if (BrowserInfo.get().isIE()) {
        style.setPosition(Position.RELATIVE);
    }

    setStyleName(CLASSNAME);
}

From source file:com.vaadin.terminal.gwt.client.SimpleTree.java

License:Open Source License

public SimpleTree() {
    setElement(Document.get().createDivElement());
    Style style = getElement().getStyle();
    style.setProperty("whiteSpace", "nowrap");
    style.setPadding(3, Unit.PX);//from www  .j a va 2  s.c o  m

    style = handle.getStyle();
    style.setDisplay(Display.NONE);
    style.setProperty("textAlign", "center");
    style.setWidth(10, Unit.PX);
    style.setCursor(Cursor.POINTER);
    style.setBorderStyle(BorderStyle.SOLID);
    style.setBorderColor("#666");
    style.setBorderWidth(1, Unit.PX);
    style.setMarginRight(3, Unit.PX);
    style.setProperty("borderRadius", "4px");
    handle.setInnerHTML("+");
    getElement().appendChild(handle);
    getElement().appendChild(text);
    style = children.getStyle();
    style.setPaddingLeft(20, Unit.PX);
    style.setDisplay(Display.NONE);

    getElement().appendChild(children);
    addDomHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
            if (event.getNativeEvent().getEventTarget().cast() == handle) {
                if (children.getStyle().getDisplay().intern() == Display.NONE.getCssName()) {
                    open(event.getNativeEvent().getShiftKey());
                } else {
                    close();
                }

            } else if (event.getNativeEvent().getEventTarget().cast() == text) {
                select(event);
            }
        }
    }, ClickEvent.getType());
}

From source file:com.vaadin.tests.widgetset.client.WidgetUtilTestWidget.java

License:Apache License

private void setBorder(Element e) {
    Style borderStyle = e.getStyle();
    borderStyle.setBorderStyle(BorderStyle.SOLID);
    borderStyle.setBorderWidth(1.8, Unit.PX);
}

From source file:de.bonprix.gridstacklayout.client.GridStackLayoutWidget.java

License:Open Source License

public GridStackLayoutWidget() {
    this.gridstackId = DOM.createUniqueId();

    this.gridstackDiv = DOM.createDiv();
    this.gridstackDiv.addClassName("grid-stack");
    this.gridstackDiv.setId(this.gridstackId);
    setElement(this.gridstackDiv);

    // Clear any unwanted styling
    final Style style = getElement().getStyle();
    style.setBorderStyle(BorderStyle.NONE);
    style.setMargin(0, Unit.PX);//w  ww  .j  a  va2s  .c o m
    style.setPadding(0, Unit.PX);

    if (BrowserInfo.get().isIE()) {
        style.setPosition(Position.RELATIVE);
    }

    setStyleName(CLASSNAME);

    addAttachHandler(new Handler() {
        @Override
        public void onAttachOrDetach(final AttachEvent event) {
            checkInit();
        }
    });

    setStackedModeWidth(60 * DEFAULT_COLUMNS);
}

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

License:Apache License

private void applyStyle(boolean selected, boolean focusHighlighted, Color background) {
    updateCssStyle(CSS.selected(), (focusHighlighted && !isLeaf()) || selected);
    updateCssStyle(CSS.paired(), getSource().get(Cell.PAIR_HIGHLIGHTED));

    String backgroundColor = null;
    if (isLeaf() && focusHighlighted) {
        backgroundColor = CSS.currentHighlightColor();
    } else if (background != null) {
        backgroundColor = background.toCssColor();
    }//w  ww. j a  v  a  2 s .  c  o  m
    String underline = getSource().get(Cell.RED_UNDERLINE) ? CSS.redUnderline()
            : (getSource().get(Cell.YELLOW_UNDERLINE) ? CSS.yellowUnderline() : null);
    applyBackground(backgroundColor, underline);

    Style style = getTarget().getStyle();
    Color borderColor = getSource().get(Cell.BORDER_COLOR);
    style.setBorderStyle(borderColor == null ? Style.BorderStyle.NONE : Style.BorderStyle.SOLID);
    style.setBorderWidth(borderColor == null ? 0 : 1, Style.Unit.PX);
    style.setBorderColor(borderColor == null ? null : borderColor.toCssColor());

    updateCssStyle(CSS.hidden(), !getSource().get(Cell.VISIBLE));
    updateCssStyle(CSS.hasShadow(), getSource().get(Cell.HAS_SHADOW));
}

From source file:org.eclipse.che.ide.ui.smartTree.SpeedSearch.java

License:Open Source License

private void initSearchPopUp() {
    this.searchPopUp = new SearchPopUp();
    Style style = this.searchPopUp.getElement().getStyle();

    style.setBackgroundColor("grey");
    style.setBorderStyle(Style.BorderStyle.SOLID);
    style.setBorderColor("#dbdbdb");
    style.setBorderWidth(1, Style.Unit.PX);
    style.setPadding(2, Style.Unit.PX);
    style.setPosition(Style.Position.FIXED);
    style.setTop(100, Style.Unit.PX);
    style.setLeft(20, Style.Unit.PX);
}