Example usage for com.vaadin.server SizeWithUnit parseStringSize

List of usage examples for com.vaadin.server SizeWithUnit parseStringSize

Introduction

In this page you can find the example usage for com.vaadin.server SizeWithUnit parseStringSize.

Prototype

public static SizeWithUnit parseStringSize(String s) 

Source Link

Document

Returns an object whose numeric value and unit are taken from the string s.

Usage

From source file:com.haulmont.cuba.web.toolkit.ui.CubaSuggestionField.java

License:Apache License

public void setPopupWidth(String popupWidth) {
    if (popupWidth == null || popupWidth.isEmpty()) {
        throw new IllegalArgumentException("Popup width cannot be empty");
    }//from  w w  w.  j av a2 s  .  c  o  m

    if (Objects.equals(getState(false).popupWidth, popupWidth))
        return;

    if (isPredefinedPopupWidth(popupWidth)) {
        getState().popupWidth = popupWidth;
        return;
    }

    // try to parse to be sure that string is correct
    SizeWithUnit.parseStringSize(popupWidth);

    getState().popupWidth = popupWidth;
}