Example usage for com.vaadin.ui AbstractSplitPanel setMaxSplitPosition

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

Introduction

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

Prototype

public void setMaxSplitPosition(float pos, Unit unit) 

Source Link

Document

Sets the maximum split position to the given position and unit.

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;/*from  ww w .  j a  v  a2 s  .c  om*/
        } 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 void doSetValue(Object source, Object value) {
    AbstractSplitPanel component = (AbstractSplitPanel) source;
    component.setMaxSplitPosition(component.getMaxSplitPosition(), (Unit) value);
}