aboutsummaryrefslogtreecommitdiffstats
path: root/src/com/vaadin/demo/sampler/features/text/TextAreaExample.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/vaadin/demo/sampler/features/text/TextAreaExample.java')
-rw-r--r--src/com/vaadin/demo/sampler/features/text/TextAreaExample.java52
1 files changed, 0 insertions, 52 deletions
diff --git a/src/com/vaadin/demo/sampler/features/text/TextAreaExample.java b/src/com/vaadin/demo/sampler/features/text/TextAreaExample.java
deleted file mode 100644
index 27ea8e91da..0000000000
--- a/src/com/vaadin/demo/sampler/features/text/TextAreaExample.java
+++ /dev/null
@@ -1,52 +0,0 @@
-package com.vaadin.demo.sampler.features.text;
-
-import com.vaadin.data.Property;
-import com.vaadin.data.Property.ValueChangeEvent;
-import com.vaadin.ui.Button;
-import com.vaadin.ui.HorizontalLayout;
-import com.vaadin.ui.Label;
-import com.vaadin.ui.TextField;
-
-@SuppressWarnings("serial")
-public class TextAreaExample extends HorizontalLayout implements
- Property.ValueChangeListener {
-
- private static final String initialText = "The quick brown fox jumps over the lazy dog.";
-
- private Label plainText;
- private final TextField editor;
-
- public TextAreaExample() {
- setSpacing(true);
- setWidth("100%");
-
- editor = new TextField("", initialText);
- editor.setRows(20); // this will make it an 'area', i.e multiline
- editor.setColumns(20);
- editor.addListener(this);
- editor.setImmediate(true);
- addComponent(editor);
-
- // the TextArea is immediate, and it's valueCahnge updates the Label,
- // so this button actually does nothing
- addComponent(new Button(">"));
-
- plainText = new Label(initialText);
- plainText.setContentMode(Label.CONTENT_XHTML);
- addComponent(plainText);
- setExpandRatio(plainText, 1);
- }
-
- /*
- * Catch the valuechange event of the textfield and update the value of the
- * label component
- */
- public void valueChange(ValueChangeEvent event) {
- String text = (String) editor.getValue();
- if (text != null) {
- // replace newline with BR, because we're using Label.CONTENT_XHTML
- text = text.replaceAll("\n", "<br/>");
- }
- plainText.setValue(text);
- }
-}