-package com.vaadin.tests.components.label;\r
-\r
-import com.vaadin.data.util.ObjectProperty;\r
-import com.vaadin.server.VaadinRequest;\r
-import com.vaadin.tests.components.AbstractTestUI;\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.Label;\r
-\r
-public class LabelPropertySourceValue extends AbstractTestUI {\r
- private Label label;\r
-\r
- @Override\r
- public void setup(VaadinRequest request) {\r
- label = new Label("Hello Vaadin user");\r
- addComponent(label);\r
- Button button = new Button("Give label a new property data source...");\r
- button.addClickListener(new ClickListener() {\r
- @Override\r
- public void buttonClick(ClickEvent event) {\r
- ObjectProperty<String> p = new ObjectProperty<String>(\r
- "This text should appear on the label after clicking the button.");\r
-\r
- label.setPropertyDataSource(p);\r
- }\r
- });\r
- addComponent(button);\r
- button = new Button("Remove data source", new ClickListener() {\r
-\r
- @Override\r
- public void buttonClick(ClickEvent event) {\r
- label.setPropertyDataSource(null);\r
- }\r
- });\r
- addComponent(button);\r
-\r
- button = new Button("Set label value to 'foo'", new ClickListener() {\r
-\r
- @Override\r
- public void buttonClick(ClickEvent event) {\r
- label.setValue("foo");\r
- }\r
- });\r
- addComponent(button);\r
- }\r
-\r
- @Override\r
- protected String getTestDescription() {\r
- return "The value should change by clicking the button";\r
- }\r
-\r
- @Override\r
- protected Integer getTicketNumber() {\r
- return 9618;\r
- }\r
-\r
+package com.vaadin.tests.components.label;
+
+import com.vaadin.data.util.ObjectProperty;
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.tests.components.AbstractTestUI;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Button.ClickListener;
+import com.vaadin.ui.Label;
+
+public class LabelPropertySourceValue extends AbstractTestUI {
+ private Label label;
+
+ @Override
+ public void setup(VaadinRequest request) {
+ label = new Label("Hello Vaadin user");
+ addComponent(label);
+ Button button = new Button("Give label a new property data source...");
+ button.addClickListener(new ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ ObjectProperty<String> p = new ObjectProperty<String>(
+ "This text should appear on the label after clicking the button.");
+
+ label.setPropertyDataSource(p);
+ }
+ });
+ addComponent(button);
+ button = new Button("Remove data source", new ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ label.setPropertyDataSource(null);
+ }
+ });
+ addComponent(button);
+
+ button = new Button("Set label value to 'foo'", new ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ label.setValue("foo");
+ }
+ });
+ addComponent(button);
+ }
+
+ @Override
+ protected String getTestDescription() {
+ return "The value should change by clicking the button";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return 9618;
+ }
+
}
\ No newline at end of file