+++ /dev/null
-package com.vaadin.tests.fieldgroup;\r
-\r
-import com.vaadin.data.fieldgroup.BeanFieldGroup;\r
-import com.vaadin.data.fieldgroup.FieldGroup.CommitException;\r
-import com.vaadin.tests.components.TestBase;\r
-import com.vaadin.tests.util.Log;\r
-import com.vaadin.ui.Button;\r
-import com.vaadin.ui.Button.ClickEvent;\r
-import com.vaadin.ui.Button.ClickListener;\r
-import com.vaadin.ui.Root;\r
-\r
-public abstract class AbstractBeanFieldBinderTest extends TestBase {\r
-\r
- private Button commitButton;\r
- protected Log log = new Log(5);\r
-\r
- private Button discardButton;\r
- private Button showBeanButton;\r
- private BeanFieldGroup fieldBinder;\r
-\r
- @Override\r
- protected void setup() {\r
- addComponent(log);\r
- }\r
-\r
- protected Button getDiscardButton() {\r
- if (discardButton == null) {\r
- discardButton = new Button("Discard", new Button.ClickListener() {\r
-\r
- public void buttonClick(ClickEvent event) {\r
- getFieldBinder().discard();\r
- log.log("Discarded changes");\r
-\r
- }\r
- });\r
- }\r
- return discardButton;\r
- }\r
-\r
- protected Button getShowBeanButton() {\r
- if (showBeanButton == null) {\r
- showBeanButton = new Button("Show bean values",\r
- new Button.ClickListener() {\r
-\r
- public void buttonClick(ClickEvent event) {\r
- log.log(getFieldBinder().getItemDataSource()\r
- .getBean().toString());\r
-\r
- }\r
- });\r
- }\r
- return showBeanButton;\r
- }\r
-\r
- protected Button getCommitButton() {\r
- if (commitButton == null) {\r
- commitButton = new Button("Commit");\r
- commitButton.addListener(new ClickListener() {\r
-\r
- public void buttonClick(ClickEvent event) {\r
- String msg = "Commit succesful";\r
- try {\r
- getFieldBinder().commit();\r
- } catch (CommitException e) {\r
- msg = "Commit failed: " + e.getMessage();\r
- }\r
- Root.getCurrentRoot().showNotification(msg);\r
- log.log(msg);\r
-\r
- }\r
- });\r
- }\r
- return commitButton;\r
- }\r
-\r
- protected BeanFieldGroup getFieldBinder() {\r
- return fieldBinder;\r
- }\r
-\r
- protected void setFieldBinder(BeanFieldGroup beanFieldBinder) {\r
- fieldBinder = beanFieldBinder;\r
- }\r
-\r
- @Override\r
- protected String getDescription() {\r
- // TODO Auto-generated method stub\r
- return null;\r
- }\r
-\r
- @Override\r
- protected Integer getTicketNumber() {\r
- // TODO Auto-generated method stub\r
- return null;\r
- }\r
-\r
-}\r
--- /dev/null
+package com.vaadin.tests.fieldgroup;\r
+\r
+import com.vaadin.data.fieldgroup.BeanFieldGroup;\r
+import com.vaadin.data.fieldgroup.FieldGroup.CommitException;\r
+import com.vaadin.tests.components.TestBase;\r
+import com.vaadin.tests.util.Log;\r
+import com.vaadin.ui.Button;\r
+import com.vaadin.ui.Button.ClickEvent;\r
+import com.vaadin.ui.Button.ClickListener;\r
+import com.vaadin.ui.Root;\r
+\r
+public abstract class AbstractBeanFieldGroupTest extends TestBase {\r
+\r
+ private Button commitButton;\r
+ protected Log log = new Log(5);\r
+\r
+ private Button discardButton;\r
+ private Button showBeanButton;\r
+ private BeanFieldGroup fieldBinder;\r
+\r
+ @Override\r
+ protected void setup() {\r
+ addComponent(log);\r
+ }\r
+\r
+ protected Button getDiscardButton() {\r
+ if (discardButton == null) {\r
+ discardButton = new Button("Discard", new Button.ClickListener() {\r
+\r
+ public void buttonClick(ClickEvent event) {\r
+ getFieldBinder().discard();\r
+ log.log("Discarded changes");\r
+\r
+ }\r
+ });\r
+ }\r
+ return discardButton;\r
+ }\r
+\r
+ protected Button getShowBeanButton() {\r
+ if (showBeanButton == null) {\r
+ showBeanButton = new Button("Show bean values",\r
+ new Button.ClickListener() {\r
+\r
+ public void buttonClick(ClickEvent event) {\r
+ log.log(getFieldBinder().getItemDataSource()\r
+ .getBean().toString());\r
+\r
+ }\r
+ });\r
+ }\r
+ return showBeanButton;\r
+ }\r
+\r
+ protected Button getCommitButton() {\r
+ if (commitButton == null) {\r
+ commitButton = new Button("Commit");\r
+ commitButton.addListener(new ClickListener() {\r
+\r
+ public void buttonClick(ClickEvent event) {\r
+ String msg = "Commit succesful";\r
+ try {\r
+ getFieldBinder().commit();\r
+ } catch (CommitException e) {\r
+ msg = "Commit failed: " + e.getMessage();\r
+ }\r
+ Root.getCurrentRoot().showNotification(msg);\r
+ log.log(msg);\r
+\r
+ }\r
+ });\r
+ }\r
+ return commitButton;\r
+ }\r
+\r
+ protected BeanFieldGroup getFieldBinder() {\r
+ return fieldBinder;\r
+ }\r
+\r
+ protected void setFieldBinder(BeanFieldGroup beanFieldBinder) {\r
+ fieldBinder = beanFieldBinder;\r
+ }\r
+\r
+ @Override\r
+ protected String getDescription() {\r
+ // TODO Auto-generated method stub\r
+ return null;\r
+ }\r
+\r
+ @Override\r
+ protected Integer getTicketNumber() {\r
+ // TODO Auto-generated method stub\r
+ return null;\r
+ }\r
+\r
+}\r
import com.vaadin.ui.NativeSelect;\r
import com.vaadin.ui.TextField;\r
\r
-public class FormWithNestedProperties extends AbstractBeanFieldBinderTest {\r
+public class FormWithNestedProperties extends AbstractBeanFieldGroupTest {\r
\r
private Log log = new Log(5);\r
\r