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

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

Introduction

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

Prototype

public void setMarginLeft(double value, Unit unit) 

Source Link

Usage

From source file:scrum.client.collaboration.EmoticonsWidget.java

License:Open Source License

private Widget createEmoticonWidget(Emoticon emoticon) {
    Image img = new Image(getEmotionImage(emoticon.getEmotion()), 0, 0, 16, 16);
    img.setTitle(emoticon.getTooltip());
    Style imgStyle = img.getElement().getStyle();
    imgStyle.setMarginLeft(1, Unit.PX);
    imgStyle.setMarginTop(1, Unit.PX);//from   w  w  w  . j  av a  2 s .  c om
    return img;
}

From source file:se.softhouse.garden.orchid.vaadin.widgetset.client.ui.VOrchidScrollTable.java

License:Open Source License

private void announceScrollPosition() {
    if (this.scrollPositionElement == null) {
        this.scrollPositionElement = DOM.createDiv();
        this.scrollPositionElement.setClassName(CLASSNAME + "-scrollposition");
        this.scrollPositionElement.getStyle().setPosition(Position.ABSOLUTE);
        this.scrollPositionElement.getStyle().setDisplay(Display.NONE);
        getElement().appendChild(this.scrollPositionElement);
    }/*w  ww.  j  a  v a  2 s  .  c o  m*/

    Style style = this.scrollPositionElement.getStyle();
    style.setMarginLeft(getElement().getOffsetWidth() / 2 - 80, Unit.PX);
    style.setMarginTop(-this.scrollBodyPanel.getOffsetHeight(), Unit.PX);

    // indexes go from 1-totalRows, as rowheaders in index-mode indicate
    int last = (this.firstRowInViewPort + this.pageLength);
    if (last > this.totalRows) {
        last = this.totalRows;
    }
    this.scrollPositionElement
            .setInnerHTML("<span>" + (this.firstRowInViewPort + 1) + " &ndash; " + (last) + "..." + "</span>");
    style.setDisplay(Display.BLOCK);
}