diff options
author | Matti Hosio <mhosio@vaadin.com> | 2014-12-11 09:05:19 +0200 |
---|---|---|
committer | Matti Hosio <mhosio@vaadin.com> | 2014-12-12 09:49:00 +0200 |
commit | 64a029571955ee52b0c416b597fb718bc0a66c46 (patch) | |
tree | 60b143e1cbd3915bc0c9cc382e58907ba84f128f /server/src/com/vaadin/ui/PasswordField.java | |
parent | 775276d4a987844fbbb88730f0eb11e285ae6e09 (diff) | |
download | vaadin-framework-64a029571955ee52b0c416b597fb718bc0a66c46.tar.gz vaadin-framework-64a029571955ee52b0c416b597fb718bc0a66c46.zip |
Declarative support for TextField, PasswordField and TextArea (#7749)
Change-Id: I41d04c55c65820f0270742468e94f47099783950
Diffstat (limited to 'server/src/com/vaadin/ui/PasswordField.java')
-rw-r--r-- | server/src/com/vaadin/ui/PasswordField.java | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/server/src/com/vaadin/ui/PasswordField.java b/server/src/com/vaadin/ui/PasswordField.java index 107e40c149..b842fc5569 100644 --- a/server/src/com/vaadin/ui/PasswordField.java +++ b/server/src/com/vaadin/ui/PasswordField.java @@ -15,7 +15,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; /** * A field that is used to enter secret text information like passwords. The @@ -76,4 +81,40 @@ public class PasswordField extends AbstractTextField { this(); setCaption(caption); } + + /* + * (non-Javadoc) + * + * @see + * com.vaadin.ui.AbstractField#synchronizeFromDesign(org.jsoup.nodes.Element + * , com.vaadin.ui.declarative.DesignContext) + */ + @Override + public void synchronizeFromDesign(Element design, + DesignContext designContext) { + super.synchronizeFromDesign(design, designContext); + AbstractTextField def = designContext.getDefaultInstance(this + .getClass()); + Attributes attr = design.attributes(); + String value = DesignAttributeHandler.readAttribute("value", attr, + def.getValue(), String.class); + setValue(value); + } + + /* + * (non-Javadoc) + * + * @see + * com.vaadin.ui.AbstractTextField#synchronizeToDesign(org.jsoup.nodes.Element + * , com.vaadin.ui.declarative.DesignContext) + */ + @Override + public void synchronizeToDesign(Element design, DesignContext designContext) { + super.synchronizeToDesign(design, designContext); + AbstractTextField def = designContext.getDefaultInstance(this + .getClass()); + Attributes attr = design.attributes(); + DesignAttributeHandler.writeAttribute("value", attr, getValue(), + def.getValue(), String.class); + } } |