return ol;
}
@SuppressWarnings({ "unused", "deprecation" })
private Layout layout3New() {
HorizontalLayout ol = new HorizontalLayout();
ol.setHeight("300px");
// ol.setWidth("500px");
ol.setWidth("");
ol.setCaption("Dynamic width and fixed height(300px)");
TextField tf;
tf = new TextField("100px high TextField, valign: bottom");
tf.setHeight("100px");
tf.setWidth("100%");
ol.addComponent(tf);
ol.setComponentAlignment(tf, Alignment.BOTTOM_LEFT);
tf = new TextField("100px high TextField, valign: top");
tf.setHeight("100px");
tf.setWidth("100%");
ol.addComponent(tf);
ol.setComponentAlignment(tf, Alignment.TOP_LEFT);
tf = new TextField("100% high, 50px wide TextField, valign: bottom");
tf.setHeight("100%");
tf.setWidth("50px");
ol.addComponent(tf);
ol.setComponentAlignment(tf, Alignment.BOTTOM_LEFT);
Label l = new Label(
"100% high, 50px wide Label, valign: bottom, does not fill full height, only needed space");
tf.setHeight("100%");
tf.setWidth("50px");
ol.addComponent(l);
ol.setComponentAlignment(l, Alignment.BOTTOM_LEFT);
ListSelect s = new ListSelect(
"100% high select, should fit into layout");
s.setMultiSelect(true);
s.setHeight("100%");
s.setWidth("100%");
for (int i = 0; i < 10; i++) {
s.addItem(new Object());
}
ol.addComponent(s);
s = new ListSelect(
"200 px high select, should make the layout 200px high");
s.setMultiSelect(true);
s.setHeight("200px");
s.setWidth("100%");
ol.addComponent(s);
return ol;
}