当前位置: 首页>>代码示例>>Java>>正文


Java Sizeable.Unit方法代码示例

本文整理汇总了Java中com.vaadin.server.Sizeable.Unit方法的典型用法代码示例。如果您正苦于以下问题:Java Sizeable.Unit方法的具体用法?Java Sizeable.Unit怎么用?Java Sizeable.Unit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.vaadin.server.Sizeable的用法示例。


在下文中一共展示了Sizeable.Unit方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getWidth

import com.vaadin.server.Sizeable; //导入方法依赖的package包/类
@Override
public String getWidth() {
    if (composition != null && isWrapped()) {
        float width = composition.getWidth();
        Sizeable.Unit widthUnit = composition.getWidthUnits();
        return width + widthUnit.getSymbol();
    }
    if (component != null) {
        return ComponentsHelper.getComponentWidth(component);
    }
    return targetWidth;
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:13,代码来源:WebFieldGroup.java

示例2: toVaadinUnit

import com.vaadin.server.Sizeable; //导入方法依赖的package包/类
public static Sizeable.Unit toVaadinUnit(SizeUnit sizeUnit) {
    checkNotNullArgument(sizeUnit);

    switch (sizeUnit) {
        case PIXELS:
            return Sizeable.Unit.PIXELS;
        case PERCENTAGE:
            return Sizeable.Unit.PERCENTAGE;
        default:
            throw new UnsupportedOperationException("Unsupported Size Unit");
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:13,代码来源:WebWrapperUtils.java

示例3: toSizeUnit

import com.vaadin.server.Sizeable; //导入方法依赖的package包/类
public static SizeUnit toSizeUnit(Sizeable.Unit units) {
    checkNotNullArgument(units);

    switch (units) {
        case PIXELS:
            return SizeUnit.PIXELS;
        case PERCENTAGE:
            return SizeUnit.PERCENTAGE;
        default:
            throw new UnsupportedOperationException("Unsupported Size Unit");
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:13,代码来源:WebWrapperUtils.java

示例4: MSize

import com.vaadin.server.Sizeable; //导入方法依赖的package包/类
private MSize(float width, Sizeable.Unit widthUnit, float height, Sizeable.Unit heightUnit) {
    this.width = width;
    this.widthUnit = widthUnit;
    this.height = height;
    this.heightUnit = heightUnit;
}
 
开发者ID:viritin,项目名称:viritin,代码行数:7,代码来源:MSize.java

示例5: getWidthUnit

import com.vaadin.server.Sizeable; //导入方法依赖的package包/类
public Sizeable.Unit getWidthUnit() {
    return widthUnit;
}
 
开发者ID:viritin,项目名称:viritin,代码行数:4,代码来源:MSize.java

示例6: getHeightUnit

import com.vaadin.server.Sizeable; //导入方法依赖的package包/类
public Sizeable.Unit getHeightUnit() {
    return heightUnit;
}
 
开发者ID:viritin,项目名称:viritin,代码行数:4,代码来源:MSize.java

示例7: size

import com.vaadin.server.Sizeable; //导入方法依赖的package包/类
public static MSize size(float width, Sizeable.Unit widthUnit, float height, Sizeable.Unit heightUnit) {
    return new MSize(width, widthUnit, height, heightUnit);
}
 
开发者ID:viritin,项目名称:viritin,代码行数:4,代码来源:MSize.java

示例8: testSizeDefined

import com.vaadin.server.Sizeable; //导入方法依赖的package包/类
@Test
public void testSizeDefined() {

    IntegerField integerField = new IntegerField() {
        private static final long serialVersionUID = -2915829267538851760L;

        @Override
        public void setWidth(float width, Sizeable.Unit unit) {
            super.setWidth(width, unit);
            underlayingField = tf;
        }
        
    };
    
    Assert.assertEquals(-1, integerField.getWidth(),0.001);
    
    integerField.setWidth("99%");
    
    Assert.assertEquals(99, integerField.getWidth(),0.001);
    Assert.assertEquals(100, underlayingField.getWidth(),0.001);

    integerField.setSizeUndefined();;

    Assert.assertEquals(-1, integerField.getWidth(),0.001);
    Assert.assertEquals(-1, underlayingField.getWidth(),0.001);
    
}
 
开发者ID:viritin,项目名称:viritin,代码行数:28,代码来源:NumberFieldWidthTest.java


注:本文中的com.vaadin.server.Sizeable.Unit方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。