Example usage for com.vaadin.ui AbstractSplitPanel getMinSplitPositionUnit

List of usage examples for com.vaadin.ui AbstractSplitPanel getMinSplitPositionUnit

Introduction

In this page you can find the example usage for com.vaadin.ui AbstractSplitPanel getMinSplitPositionUnit.

Prototype

public Unit getMinSplitPositionUnit() 

Source Link

Document

Returns the unit of the minimum position of the splitter.

Usage

From source file:org.lunifera.runtime.web.vaadin.databinding.component.internal.SplitPanelMinSplitPositionProperty.java

License:Open Source License

protected void doSetValue(Object source, Object value) {
    AbstractSplitPanel component = (AbstractSplitPanel) source;
    Unit unit = component.getMinSplitPositionUnit();

    int pos = (Integer) value;
    if (unit != Unit.PIXELS && unit != Unit.PERCENTAGE) {
        if (pos <= 100) {
            unit = Unit.PERCENTAGE;/*  w ww .j av a2s. c o m*/
        } else {
            unit = Unit.PIXELS;
        }
    }
    component.setMinSplitPosition((Integer) value, unit);
}

From source file:org.lunifera.runtime.web.vaadin.databinding.component.internal.SplitPanelMinSplitPositionUnitProperty.java

License:Open Source License

protected Object doGetValue(Object source) {
    AbstractSplitPanel component = (AbstractSplitPanel) source;
    return component.getMinSplitPositionUnit();
}