diff options
Diffstat (limited to 'uitest/src/com/vaadin/tests/tickets/Ticket2023.java')
-rw-r--r-- | uitest/src/com/vaadin/tests/tickets/Ticket2023.java | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2023.java b/uitest/src/com/vaadin/tests/tickets/Ticket2023.java new file mode 100644 index 0000000000..c6b2c0f28a --- /dev/null +++ b/uitest/src/com/vaadin/tests/tickets/Ticket2023.java @@ -0,0 +1,53 @@ +package com.vaadin.tests.tickets; + +import com.vaadin.ui.AbstractComponent; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.GridLayout; +import com.vaadin.ui.UI.LegacyWindow; + +public class Ticket2023 extends com.vaadin.Application.LegacyApplication + implements Button.ClickListener { + + AbstractComponent c = new Button(); + + @Override + public void init() { + LegacyWindow main = new LegacyWindow(); + setMainWindow(main); + + String[] sizes = { "20", "100", "1", "0", "-1", "", "z" }; + String[] units = { "%", "px", "em", "ex", "in", "cm", "mm", "pt", "pc", + "", "p", "zyx" }; + + GridLayout gl = new GridLayout(units.length, sizes.length); + main.addComponent(gl); + for (int i = 0; i < sizes.length; i++) { + for (int j = 0; j < units.length; j++) { + String s = sizes[i] + units[j]; + gl.addComponent(new Button(s, this)); + } + } + + gl.addComponent(new Button("null", new Button.ClickListener() { + + @Override + public void buttonClick(ClickEvent event) { + c.setWidth(null); + c.setHeight(null); + + } + + })); + + main.addComponent(c); + + } + + @Override + public void buttonClick(ClickEvent event) { + c.setWidth(event.getButton().getCaption()); + c.setHeight(event.getButton().getCaption()); + + } +} |