// OrderedLayout
final VerticalLayout orderedLayout = new VerticalLayout();
LayoutTestingPanel oltp = new LayoutTestingPanel("OrderedLayout",
orderedLayout);
CheckBox cb = new CheckBox("OrderedLayout",
new MethodProperty<Boolean>(oltp, "visible"));
cb.setImmediate(true);
hidingControls.addComponent(cb);
lo.addComponent(oltp);
orderedLayout.setSpacing(false);
addFields(orderedLayout);
// GridLayout
GridLayout grid = new GridLayout(1, 1);
Panel g1tp = new LayoutTestingPanel("Gridlayout with 1 column", grid);
cb = new CheckBox("GridLayout (1col)", new MethodProperty<Boolean>(
g1tp, "visible"));
cb.setImmediate(true);
hidingControls.addComponent(cb);
g1tp.setVisible(false);
lo.addComponent(g1tp);
grid.setSpacing(true);
addFields(grid);
GridLayout grid2 = new GridLayout(2, 1);
Panel g2tp = new LayoutTestingPanel("Gridlayout with 2 columns", grid2);
cb = new CheckBox("GridLayout (2cols)", new MethodProperty<Boolean>(
g2tp, "visible"));
cb.setImmediate(true);
hidingControls.addComponent(cb);
g2tp.setVisible(false);
lo.addComponent(g2tp);
grid2.setSpacing(true);
addFields(grid2);
// ExpandLayout
VerticalLayout el = new VerticalLayout();
Panel elp = new LayoutTestingPanel(
"ExpandLayout width first component expanded", el);
cb = new CheckBox("ExpandLayout (vertical)",
new MethodProperty<Boolean>(elp, "visible"));
cb.setImmediate(true);
hidingControls.addComponent(cb);
elp.setVisible(false);
el.setHeight("700px");
addFields(el);
Component firstComponent = el.getComponentIterator().next();
firstComponent.setSizeFull();
el.setExpandRatio(firstComponent, 1);
lo.addComponent(elp);
HorizontalLayout elh = new HorizontalLayout();
Panel elhp = new LayoutTestingPanel(
"ExpandLayout width first component expanded; horizontal", elh);
cb = new CheckBox("ExpandLayout (horizontal)",
new MethodProperty<Boolean>(elhp, "visible"));
cb.setImmediate(true);
hidingControls.addComponent(cb);
elhp.setVisible(false);
elh.setWidth("2000px");
elh.setHeight("100px");
addFields(elh);
Component firstComponentElh = elh.getComponentIterator().next();
firstComponentElh.setSizeFull();
elh.setExpandRatio(firstComponentElh, 1);
lo.addComponent(elhp);
// CustomLayout
VerticalLayout cl = new VerticalLayout();
Panel clp = new LayoutTestingPanel("CustomLayout", cl);
cb = new CheckBox("CustomLayout", new MethodProperty<Boolean>(clp,
"visible"));
cb.setImmediate(true);
hidingControls.addComponent(cb);
clp.setVisible(false);
lo.addComponent(clp);
cl.addComponent(new Label("<<< Add customlayout testcase here >>>"));
// Form
VerticalLayout formPanelLayout = new VerticalLayout();
formPanelLayout.setMargin(true);
Panel formPanel = new Panel("Form", formPanelLayout);
cb = new CheckBox("Form", new MethodProperty<Boolean>(formPanel,
"visible"));
cb.setImmediate(true);
hidingControls.addComponent(cb);
formPanel.setVisible(false);
formPanelLayout.addComponent(getFormPanelExample());
lo.addComponent(formPanel);