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

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

Introduction

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

Prototype

public void setPaddingRight(double value, Unit unit) 

Source Link

Usage

From source file:org.uberfire.ext.wires.core.grids.client.widget.dom.impl.TextBoxDOMElement.java

License:Apache License

public TextBoxDOMElement(final TextBox widget, final GridLayer gridLayer, final GridWidget gridWidget) {
    super(widget, gridLayer, gridWidget);
    final Style style = widget.getElement().getStyle();
    style.setWidth(100, Style.Unit.PCT);
    style.setHeight(HEIGHT, Style.Unit.PX);
    style.setPaddingLeft(2, Style.Unit.PX);
    style.setPaddingRight(2, Style.Unit.PX);
    style.setFontSize(10, Style.Unit.PX);

    // --- Workaround for BS2 ---
    style.setPosition(Style.Position.RELATIVE);
    style.setPaddingTop(0, Style.Unit.PX);
    style.setPaddingBottom(0, Style.Unit.PX);
    style.setProperty("WebkitBoxSizing", "border-box");
    style.setProperty("MozBoxSizing", "border-box");
    style.setProperty("boxSizing", "border-box");
    style.setProperty("lineHeight", "normal");
    // --- End workaround ---

    getContainer().getElement().getStyle().setPaddingLeft(5, Style.Unit.PX);
    getContainer().getElement().getStyle().setPaddingRight(5, Style.Unit.PX);
    getContainer().setWidget(widget);//ww w .  j  a v  a  2s .  c o m
}

From source file:stroom.explorer.client.presenter.TypeFilterPresenter.java

License:Apache License

@Inject
public TypeFilterPresenter(final EventBus eventBus) {
    super(eventBus, new CellTableViewImpl<DocumentType>(false, (Resources) GWT.create(BasicResources.class)));
    this.eventBus = eventBus;

    // Checked.//from w ww .  j a v  a  2  s . co  m
    final Column<DocumentType, TickBoxState> checkedColumn = new Column<DocumentType, TickBoxState>(
            new TickBoxCell(false, true)) {
        @Override
        public TickBoxState getValue(final DocumentType object) {
            return TickBoxState.fromBoolean(selected.contains(object.getType()));
        }
    };
    checkedColumn.setFieldUpdater(new FieldUpdater<DocumentType, TickBoxState>() {
        @Override
        public void update(final int index, final DocumentType object, final TickBoxState value) {
            if (selected.contains(object.getType())) {
                selected.remove(object.getType());
            } else {
                selected.add(object.getType());
            }

            DataSelectionEvent.fire(TypeFilterPresenter.this, TypeFilterPresenter.this, false);
        }
    });
    getView().addColumn(checkedColumn);

    // Icon.
    final Column<DocumentType, SafeUri> iconColumn = new Column<DocumentType, SafeUri>(new SafeImageCell()) {
        @Override
        public SafeUri getValue(final DocumentType object) {
            return UriUtils.fromString(ImageUtil.getImageURL() + object.getIconUrl());
        }
    };
    getView().addColumn(iconColumn);

    // Text.
    final Column<DocumentType, String> textColumn = new Column<DocumentType, String>(new TextCell()) {
        @Override
        public String getValue(final DocumentType object) {
            return object.getType();
        }
    };
    getView().addColumn(textColumn);

    final Style style = getView().asWidget().getElement().getStyle();
    style.setPaddingLeft(1, Unit.PX);
    style.setPaddingRight(3, Unit.PX);
    style.setPaddingTop(2, Unit.PX);
    style.setPaddingBottom(1, Unit.PX);
}