summaryrefslogtreecommitdiffstats
path: root/uitest/src/com/vaadin/tests/tickets/Ticket2244.java
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2012-08-30 17:24:36 +0300
committerArtur Signell <artur@vaadin.com>2012-08-30 17:24:36 +0300
commit7b25b3886ea95bc6495506fbe9472e45fcbde684 (patch)
tree0b93cb65dab437feb46720659a63b8f1ef48f7f4 /uitest/src/com/vaadin/tests/tickets/Ticket2244.java
parent8941056349e302e687e40e94c13709e75f256d73 (diff)
downloadvaadin-framework-7b25b3886ea95bc6495506fbe9472e45fcbde684.tar.gz
vaadin-framework-7b25b3886ea95bc6495506fbe9472e45fcbde684.zip
Renamed tests -> uitest and tests/testbench -> uitest/src (#9299)
Diffstat (limited to 'uitest/src/com/vaadin/tests/tickets/Ticket2244.java')
-rw-r--r--uitest/src/com/vaadin/tests/tickets/Ticket2244.java130
1 files changed, 130 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2244.java b/uitest/src/com/vaadin/tests/tickets/Ticket2244.java
new file mode 100644
index 0000000000..495e3de26a
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/tickets/Ticket2244.java
@@ -0,0 +1,130 @@
+package com.vaadin.tests.tickets;
+
+import com.vaadin.Application;
+import com.vaadin.data.util.BeanItem;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Form;
+import com.vaadin.ui.FormLayout;
+import com.vaadin.ui.GridLayout;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.UI.LegacyWindow;
+
+public class Ticket2244 extends Application.LegacyApplication {
+
+ Form form;
+
+ @Override
+ public void init() {
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
+ setMainWindow(w);
+
+ GridLayout gl = new GridLayout(3, 3);
+ gl.setSpacing(true);
+ gl.addComponent(new Label("Before form"));
+ gl.newLine();
+
+ form = new Form(gl);
+ form.setItemDataSource(new BeanItem<MyBean>(new MyBean()));
+
+ gl.addComponent(new Label("After form"));
+
+ w.addComponent(form);
+
+ w.addComponent(new Button("new item", new Button.ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ form.setItemDataSource(new BeanItem<MyBean>(new MyBean()));
+
+ }
+
+ }));
+ w.addComponent(new Button("new bigger item",
+ new Button.ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ form.setItemDataSource(new BeanItem<MyBean>(
+ new MyBiggerBean()));
+
+ }
+
+ }));
+ w.addComponent(new Button("new grid layout",
+ new Button.ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ form.setLayout(new GridLayout());
+
+ }
+
+ }));
+ w.addComponent(new Button("new form layout",
+ new Button.ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ form.setLayout(new FormLayout());
+
+ }
+
+ }));
+
+ }
+
+ public class MyBean {
+ String firstname;
+ String lastname;
+ String password;
+
+ public String getFirstname() {
+ return firstname;
+ }
+
+ public void setFirstname(String firstname) {
+ this.firstname = firstname;
+ }
+
+ public String getLastname() {
+ return lastname;
+ }
+
+ public void setLastname(String lastname) {
+ this.lastname = lastname;
+ }
+
+ public String getPassword() {
+ return password;
+ }
+
+ public void setPassword(String password) {
+ this.password = password;
+ }
+
+ }
+
+ public class MyBiggerBean extends MyBean {
+ String address;
+ String phone;
+
+ public String getAddress() {
+ return address;
+ }
+
+ public void setAddress(String address) {
+ this.address = address;
+ }
+
+ public String getPhone() {
+ return phone;
+ }
+
+ public void setPhone(String phone) {
+ this.phone = phone;
+ }
+
+ }
+
+}