diff options
Diffstat (limited to 'uitest/src/com/vaadin/tests/tickets/Ticket2232.java')
-rw-r--r-- | uitest/src/com/vaadin/tests/tickets/Ticket2232.java | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2232.java b/uitest/src/com/vaadin/tests/tickets/Ticket2232.java new file mode 100644 index 0000000000..d71134696f --- /dev/null +++ b/uitest/src/com/vaadin/tests/tickets/Ticket2232.java @@ -0,0 +1,74 @@ +package com.vaadin.tests.tickets; + +import com.vaadin.Application; +import com.vaadin.ui.Button; +import com.vaadin.ui.GridLayout; +import com.vaadin.ui.Label; +import com.vaadin.ui.Layout; +import com.vaadin.ui.Layout.SpacingHandler; +import com.vaadin.ui.UI.LegacyWindow; +import com.vaadin.ui.VerticalLayout; + +public class Ticket2232 extends Application.LegacyApplication { + + @Override + public void init() { + setMainWindow(new LegacyWindow()); + setTheme("tests-tickets"); + + getMainWindow() + .addComponent( + new Label( + "Defining spacing must be possible also with pure CSS")); + + Layout gl; + gl = new VerticalLayout(); + gl.setWidth("100%"); + gl.setHeight("200px"); + gl.setStyleName("t2232"); + fillAndAdd(gl); + + gl = new GridLayout(); + gl.setWidth("100%"); + gl.setHeight("200px"); + gl.setStyleName("t2232"); + fillAndAdd(gl); + + gl = new VerticalLayout(); + gl.setWidth("100%"); + gl.setHeight("200px"); + ((SpacingHandler) gl).setSpacing(true); + fillAndAdd(gl); + + gl = new GridLayout(); + gl.setWidth("100%"); + gl.setHeight("200px"); + ((SpacingHandler) gl).setSpacing(true); + fillAndAdd(gl); + + gl = new VerticalLayout(); + gl.setWidth("100%"); + gl.setHeight("200px"); + fillAndAdd(gl); + + gl = new GridLayout(); + gl.setWidth("100%"); + gl.setHeight("200px"); + fillAndAdd(gl); + + } + + private void fillAndAdd(Layout gl) { + for (int i = 0; i < 4; i++) { + Button b = new Button("B"); + b.setSizeFull(); + gl.addComponent(b); + } + String caption = gl.getClass().getSimpleName(); + caption += " style: " + gl.getStyleName() + ", spacingFromServer:" + + ((SpacingHandler) gl).isSpacing(); + gl.setCaption(caption); + getMainWindow().addComponent(gl); + } + +} |