Example usage for com.vaadin.ui AbstractSplitPanel setMinSplitPosition

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

Introduction

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

Prototype

public void setMinSplitPosition(float pos, Unit unit) 

Source Link

Document

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

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;//from ww w . ja  v 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 void doSetValue(Object source, Object value) {
    AbstractSplitPanel component = (AbstractSplitPanel) source;
    component.setMinSplitPosition(component.getMinSplitPosition(), (Unit) value);
}