\r
private Layout orderedLayout;\r
private Layout gridLayout;\r
- private Layout expandLayout;\r
private Layout formLayout;\r
private GridLayout mainLayout;\r
private Button switchToGridButton;\r
private Button switchToOrderedButton;\r
- private Button switchToExpandButton;\r
private Button switchToFormsButton;\r
\r
public void init() {\r
w.setLayout(mainLayout);\r
orderedLayout = createOL();\r
gridLayout = createGL();\r
- expandLayout = createEL();\r
formLayout = createForms();\r
\r
switchToGridButton = new Button("Switch to GridLayout",\r
\r
});\r
switchToOrderedButton.setEnabled(false);\r
- switchToExpandButton = new Button("Switch to ExpandLayout",\r
- new ClickListener() {\r
-\r
- public void buttonClick(ClickEvent event) {\r
- changeLayout(switchToExpandButton, expandLayout);\r
- }\r
-\r
- });\r
\r
switchToFormsButton = new Button("Switch to Form", new ClickListener() {\r
\r
OrderedLayout.ORIENTATION_HORIZONTAL);\r
buttonLayout.addComponent(switchToOrderedButton);\r
buttonLayout.addComponent(switchToGridButton);\r
- buttonLayout.addComponent(switchToExpandButton);\r
buttonLayout.addComponent(switchToFormsButton);\r
\r
mainLayout.addComponent(buttonLayout);\r
return layout;\r
}\r
\r
- private static Layout createEL() {\r
- GridLayout layout = new GridLayout(1, 5);\r
-\r
- GridLayout l1 = new GridLayout(1, 3);\r
- createLayout(l1, new ExpandLayout(ExpandLayout.ORIENTATION_HORIZONTAL),\r
- "1000px", "150px", "100px", null, true);\r
- createLayout(l1, new ExpandLayout(ExpandLayout.ORIENTATION_HORIZONTAL),\r
- "1000px", "150px", "50px", null, false);\r
-\r
- GridLayout l2 = new GridLayout(6, 1);\r
- createLayout(l2, new ExpandLayout(ExpandLayout.ORIENTATION_VERTICAL),\r
- "200px", "500px", true);\r
- createLayout(l2, new ExpandLayout(ExpandLayout.ORIENTATION_VERTICAL),\r
- "200px", "500px", "100%", null, true);\r
- createLayout(l2, new ExpandLayout(ExpandLayout.ORIENTATION_VERTICAL),\r
- "150px", "500px", true);\r
- createLayout(l2, new ExpandLayout(ExpandLayout.ORIENTATION_VERTICAL),\r
- "150px", "500px", "100%", null, true);\r
- createLayout(l2, new ExpandLayout(ExpandLayout.ORIENTATION_VERTICAL),\r
- "100px", "500px", true);\r
- createLayout(l2, new ExpandLayout(ExpandLayout.ORIENTATION_VERTICAL),\r
- "100px", "500px", "100%", null, true);\r
- layout.addComponent(l1);\r
- layout.addComponent(l2);\r
-\r
- return layout;\r
- }\r
-\r
public class FormObject {\r
private String stringValue = "abc";\r
private int intValue = 1;\r
protected void changeLayout(Button b, Layout newLayout) {\r
switchToOrderedButton.setEnabled(true);\r
switchToGridButton.setEnabled(true);\r
- switchToExpandButton.setEnabled(true);\r
switchToFormsButton.setEnabled(true);\r
\r
b.setEnabled(false);\r