Example usage for com.google.gwt.safecss.shared SafeStylesUtils forHeight

List of usage examples for com.google.gwt.safecss.shared SafeStylesUtils forHeight

Introduction

In this page you can find the example usage for com.google.gwt.safecss.shared SafeStylesUtils forHeight.

Prototype

public static SafeStyles forHeight(double value, Unit unit) 

Source Link

Document

Set the height css property.

Usage

From source file:stroom.cell.info.client.SvgCell.java

License:Apache License

@Override
public void render(final Context context, final SvgPreset value, final SafeHtmlBuilder sb) {
    if (value == null) {
        sb.append(SafeHtmlUtils.EMPTY_SAFE_HTML);
    } else {/*from  w w w  . ja va2s.  co  m*/
        final SafeStylesBuilder builder = new SafeStylesBuilder();
        builder.append(SafeStylesUtils.forWidth(value.getWidth(), Unit.PX));
        builder.append(SafeStylesUtils.forHeight(value.getHeight(), Unit.PX));

        String className = resources.style().icon();
        if (!value.isEnabled()) {
            className += " " + resources.style().disabled();
        }

        sb.append(template.icon(className, builder.toSafeStyles(), UriUtils.fromString(value.getUrl())));
    }
}