diff options
Diffstat (limited to 'server/src/com/vaadin/ui/TextField.java')
-rw-r--r-- | server/src/com/vaadin/ui/TextField.java | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/server/src/com/vaadin/ui/TextField.java b/server/src/com/vaadin/ui/TextField.java index 1fc10c6ced..2a61e93211 100644 --- a/server/src/com/vaadin/ui/TextField.java +++ b/server/src/com/vaadin/ui/TextField.java @@ -16,7 +16,12 @@ package com.vaadin.ui; +import org.jsoup.nodes.Attributes; +import org.jsoup.nodes.Element; + import com.vaadin.data.Property; +import com.vaadin.ui.declarative.DesignAttributeHandler; +import com.vaadin.ui.declarative.DesignContext; /** * <p> @@ -102,6 +107,38 @@ public class TextField extends AbstractTextField { /* * (non-Javadoc) * + * @see com.vaadin.ui.AbstractTextField#readDesign(org.jsoup.nodes.Element, + * com.vaadin.ui.declarative.DesignContext) + */ + @Override + public void readDesign(Element design, DesignContext designContext) { + super.readDesign(design, designContext); + Attributes attr = design.attributes(); + if (attr.hasKey("value")) { + setValue(DesignAttributeHandler.readAttribute("value", attr, + String.class)); + } + } + + /* + * (non-Javadoc) + * + * @see com.vaadin.ui.AbstractTextField#writeDesign(org.jsoup.nodes.Element + * , com.vaadin.ui.declarative.DesignContext) + */ + @Override + public void writeDesign(Element design, DesignContext designContext) { + super.writeDesign(design, designContext); + AbstractTextField def = (AbstractTextField) designContext + .getDefaultInstance(this); + Attributes attr = design.attributes(); + DesignAttributeHandler.writeAttribute("value", attr, getValue(), + def.getValue(), String.class); + } + + /* + * (non-Javadoc) + * * @see com.vaadin.ui.AbstractField#clear() */ @Override |