本文整理汇总了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;
}
示例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;
}
示例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);
}