|
|
@@ -52,8 +52,8 @@ public class GridLayoutDeclarativeTest |
|
|
|
b3.setCaptionAsHtml(true); |
|
|
|
b4.setCaptionAsHtml(true); |
|
|
|
String design = "<vaadin-grid-layout><row>" // |
|
|
|
+ "<column expand=1>" + writeChild(b1) + "</column>" // |
|
|
|
+ "<column expand=3>" + writeChild(b2) + "</column>" // |
|
|
|
+ "<column expand=1.0>" + writeChild(b1) + "</column>" // |
|
|
|
+ "<column expand=3.3>" + writeChild(b2) + "</column>" // |
|
|
|
+ "</row><row>" // |
|
|
|
+ "<column>" + writeChild(b3) + "</column>" // |
|
|
|
+ "<column>" + writeChild(b4) + "</column>" // |
|
|
@@ -63,12 +63,29 @@ public class GridLayoutDeclarativeTest |
|
|
|
gl.addComponent(b2); |
|
|
|
gl.addComponent(b3); |
|
|
|
gl.addComponent(b4); |
|
|
|
gl.setColumnExpandRatio(0, 1.0f); |
|
|
|
gl.setColumnExpandRatio(1, 3.0f); |
|
|
|
gl.setColumnExpandRatio(0, 1f); |
|
|
|
gl.setColumnExpandRatio(1, 3.3f); |
|
|
|
testWrite(design, gl); |
|
|
|
testRead(design, gl); |
|
|
|
} |
|
|
|
|
|
|
|
@Test |
|
|
|
public void testReadIntegerExpandRatioGridLayout() { |
|
|
|
//To make sure that it can read from old declarative which use |
|
|
|
// integer expand ratio |
|
|
|
Button b1 = new Button("Button 0,0"); |
|
|
|
b1.setCaptionAsHtml(true); |
|
|
|
String design = "<vaadin-grid-layout><row expand=3>" // |
|
|
|
+ "<column expand=1>" + writeChild(b1) + "</column>" // |
|
|
|
+ "</row>"// |
|
|
|
+ "</vaadin-grid-layout>"; |
|
|
|
GridLayout gl = new GridLayout(1, 1); |
|
|
|
gl.addComponent(b1); |
|
|
|
gl.setColumnExpandRatio(0, 1.0f); |
|
|
|
gl.setRowExpandRatio(0, 3.0f); |
|
|
|
testRead(design, gl); |
|
|
|
} |
|
|
|
|
|
|
|
@Test |
|
|
|
public void testOneBigComponentGridLayout() { |
|
|
|
Button b1 = new Button("Button 0,0 -> 1,1"); |
|
|
@@ -153,7 +170,7 @@ public class GridLayoutDeclarativeTest |
|
|
|
gl.setColumnExpandRatio(2, 2.0f); |
|
|
|
|
|
|
|
String design = "<vaadin-grid-layout><row>" // |
|
|
|
+ "<column colspan=4 rowspan=5 expand='0,0,2,0' />" // |
|
|
|
+ "<column colspan=4 rowspan=5 expand='0.0,0.0,2.0,0.0' />" // |
|
|
|
+ "<column rowspan=5>" + writeChild(b1) + "</column>" // |
|
|
|
+ "</row><row>" // |
|
|
|
+ "</row><row>" // |
|
|
@@ -174,7 +191,7 @@ public class GridLayoutDeclarativeTest |
|
|
|
|
|
|
|
String design = "<vaadin-grid-layout><row>" // |
|
|
|
+ "<column rowspan=5>" + writeChild(b1) + "</column>" // |
|
|
|
+ "<column colspan=4 rowspan=5 expand='0,0,0,2' />" // |
|
|
|
+ "<column colspan=4 rowspan=5 expand='0.0,0.0,0.0,2.0' />" // |
|
|
|
+ "</row><row>" // |
|
|
|
+ "</row><row>" // |
|
|
|
+ "</row><row>" // |