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


Java HorizontalLayout.setExpandRatio方法代码示例

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


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

示例1: getDetails

import com.vaadin.v7.ui.HorizontalLayout; //导入方法依赖的package包/类
@Override
public Component getDetails(Grid.RowReference rowReference) {
    rowReference.getGrid().scrollTo(rowReference.getItemId());
    Customer customer = (Customer)rowReference.getItemId();

    HorizontalLayout layout = new HorizontalLayout();
    layout.setHeight(300, Sizeable.Unit.PIXELS);
    layout.setMargin(true);
    layout.setSpacing(true);
    Image image = new Image("", customer.getPhoto());
    image.setHeight(200, Sizeable.Unit.PIXELS);
    image.setWidth(200, Sizeable.Unit.PIXELS);
    layout.addComponent(image);
    Label nameLabel = new Label("<h1>" + customer.getFirstName() + " " + customer.getLastName() + "</h1>", ContentMode.HTML);
    layout.addComponent(nameLabel);
    layout.setExpandRatio(nameLabel, 1.0f);
    return layout;
}
 
开发者ID:datenhahn,项目名称:componentrenderer,代码行数:19,代码来源:CustomerDetailsGenerator.java

示例2: getDetails

import com.vaadin.v7.ui.HorizontalLayout; //导入方法依赖的package包/类
@Override
public Component getDetails(Grid.RowReference rowReference) {
    rowReference.getGrid().scrollTo(rowReference.getItemId());
    StaticCustomer customer = (StaticCustomer)rowReference.getItemId();

    HorizontalLayout layout = new HorizontalLayout();
    layout.setHeight(300, Sizeable.Unit.PIXELS);
    layout.setMargin(true);
    layout.setSpacing(true);
    Image image = new Image("", customer.getPhoto());
    image.setHeight(200, Sizeable.Unit.PIXELS);
    image.setWidth(200, Sizeable.Unit.PIXELS);
    layout.addComponent(image);
    Label nameLabel = new Label("<h1>" + customer.getFirstName() + " " + customer.getLastName() + "</h1>", ContentMode.HTML);
    layout.addComponent(nameLabel);
    layout.setExpandRatio(nameLabel, 1.0f);
    return layout;
}
 
开发者ID:datenhahn,项目名称:componentrenderer,代码行数:19,代码来源:StaticCustomerDetailsGenerator.java

示例3: addSliderWithIcons

import com.vaadin.v7.ui.HorizontalLayout; //导入方法依赖的package包/类
private void addSliderWithIcons(ComponentContainer optionLayout) {
    final Component emb = new Embedded(null, getNextIcon());
    emb.setWidth("32px");
    final Embedded emb2 = new Embedded(null, getNextIcon());
    emb2.setWidth("32px");
    final Slider slider = new Slider(0, 100);
    slider.setWidth(100, UNITS_PERCENTAGE);

    HorizontalLayout hl = new HorizontalLayout();
    hl.addComponent(emb);
    hl.addComponent(slider);
    hl.addComponent(emb2);
    hl.setWidth(100, UNITS_PERCENTAGE);
    hl.setExpandRatio(slider, 1);
    hl.setComponentAlignment(slider, Alignment.MIDDLE_CENTER);
    optionLayout.addComponent(hl);
}
 
开发者ID:vaadin,项目名称:touchkit,代码行数:18,代码来源:NavPanelTestWithViews.java


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