diff options
author | Artur Signell <artur@vaadin.com> | 2012-05-03 21:51:30 +0300 |
---|---|---|
committer | Artur Signell <artur@vaadin.com> | 2012-05-11 22:18:23 +0300 |
commit | 2e6c788c14013ebca8cdea7da9d0ff7e7547df09 (patch) | |
tree | 628c09d7de10b995f267b0df0484f873107e039f /src/com/vaadin/ui/TextArea.java | |
parent | 3387e8e2370a37f3e2d32d87dbe700def12dee65 (diff) | |
download | vaadin-framework-2e6c788c14013ebca8cdea7da9d0ff7e7547df09.tar.gz vaadin-framework-2e6c788c14013ebca8cdea7da9d0ff7e7547df09.zip |
Moved most of TextField/TextArea/PasswordField paintContent to state
Removed deprecated value formatter from AbstractTextField (#8672)
Diffstat (limited to 'src/com/vaadin/ui/TextArea.java')
-rw-r--r-- | src/com/vaadin/ui/TextArea.java | 48 |
1 files changed, 12 insertions, 36 deletions
diff --git a/src/com/vaadin/ui/TextArea.java b/src/com/vaadin/ui/TextArea.java index adb980818e..4c0b563b00 100644 --- a/src/com/vaadin/ui/TextArea.java +++ b/src/com/vaadin/ui/TextArea.java @@ -5,26 +5,13 @@ package com.vaadin.ui; import com.vaadin.data.Property; -import com.vaadin.terminal.PaintException; -import com.vaadin.terminal.PaintTarget; +import com.vaadin.terminal.gwt.client.ui.textarea.TextAreaState; /** * A text field that supports multi line editing. */ public class TextArea extends AbstractTextField { - private static final int DEFAULT_ROWS = 5; - - /** - * Number of visible rows in the text area. - */ - private int rows = DEFAULT_ROWS; - - /** - * Tells if word-wrapping should be used in the text area. - */ - private boolean wordwrap = true; - /** * Constructs an empty TextArea. */ @@ -81,6 +68,11 @@ public class TextArea extends AbstractTextField { } + @Override + public TextAreaState getState() { + return (TextAreaState) super.getState(); + } + /** * Sets the number of rows in the text area. * @@ -91,10 +83,8 @@ public class TextArea extends AbstractTextField { if (rows < 0) { rows = 0; } - if (this.rows != rows) { - this.rows = rows; - requestRepaint(); - } + getState().setRows(rows); + requestRepaint(); } /** @@ -103,7 +93,7 @@ public class TextArea extends AbstractTextField { * @return number of explicitly set rows. */ public int getRows() { - return rows; + return getState().getRows(); } /** @@ -114,10 +104,8 @@ public class TextArea extends AbstractTextField { * word-wrap mode. */ public void setWordwrap(boolean wordwrap) { - if (this.wordwrap != wordwrap) { - this.wordwrap = wordwrap; - requestRepaint(); - } + getState().setWordwrap(wordwrap); + requestRepaint(); } /** @@ -127,19 +115,7 @@ public class TextArea extends AbstractTextField { * <code>false</code> if not. */ public boolean isWordwrap() { - return wordwrap; + return getState().isWordwrap(); } - @Override - public void paintContent(PaintTarget target) throws PaintException { - super.paintContent(target); - - target.addAttribute("rows", getRows()); - - if (!isWordwrap()) { - // Wordwrap is only painted if turned off to minimize communications - target.addAttribute("wordwrap", false); - } - - } } |