Example usage for com.vaadin.ui AbstractSplitPanel getMaxSplitPositionUnit

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

Introduction

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

Prototype

public Unit getMaxSplitPositionUnit() 

Source Link

Document

Returns the unit of the maximum position of the splitter.

Usage

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

License:Open Source License

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

    int pos = (Integer) value;
    if (unit != Unit.PIXELS && unit != Unit.PERCENTAGE) {
        if (pos <= 100) {
            unit = Unit.PERCENTAGE;/*ww w.  j  a  v  a 2 s. c o  m*/
        } else {
            unit = Unit.PIXELS;
        }
    }
    component.setMaxSplitPosition((Integer) value, unit);
}

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

License:Open Source License

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

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

License:Open Source License

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

    int pos = (Integer) value;
    if (unit != Unit.PIXELS && unit != Unit.PERCENTAGE) {
        if (pos <= 100) {
            unit = Unit.PERCENTAGE;//from   w w  w. j  a  v a2s  .co m
        } else {
            unit = Unit.PIXELS;
        }
    }
    component.setSplitPosition((Integer) value, unit);
}