diff options
Diffstat (limited to 'server/src/com/vaadin')
18 files changed, 117 insertions, 160 deletions
diff --git a/server/src/com/vaadin/server/ClientConnector.java b/server/src/com/vaadin/server/ClientConnector.java index 50ce2754cb..b784aa5d35 100644 --- a/server/src/com/vaadin/server/ClientConnector.java +++ b/server/src/com/vaadin/server/ClientConnector.java @@ -26,6 +26,7 @@ import com.vaadin.shared.Connector; import com.vaadin.shared.communication.SharedState; import com.vaadin.ui.UI; import com.vaadin.util.ReflectTools; + import elemental.json.JsonObject; /** @@ -277,9 +278,8 @@ public interface ClientConnector extends Connector { * . * * @return a JSON object with the encoded connector state - * if the state can not be encoded */ - public JsonObject encodeState() ; + public JsonObject encodeState(); /** * Handle a request directed to this connector. This can be used by diff --git a/server/src/com/vaadin/ui/AbsoluteLayout.java b/server/src/com/vaadin/ui/AbsoluteLayout.java index 7af22ba5c6..3e1e7bfbdb 100644 --- a/server/src/com/vaadin/ui/AbsoluteLayout.java +++ b/server/src/com/vaadin/ui/AbsoluteLayout.java @@ -677,15 +677,13 @@ public class AbsoluteLayout extends AbstractLayout implements /* * (non-Javadoc) * - * @see - * com.vaadin.ui.AbstractComponent#synchronizeFromDesign(org.jsoup.nodes - * .Node, com.vaadin.ui.declarative.DesignContext) + * @see com.vaadin.ui.AbstractComponent#readDesign(org.jsoup.nodes .Node, + * com.vaadin.ui.declarative.DesignContext) */ @Override - public void synchronizeFromDesign(Element design, - DesignContext designContext) { + public void readDesign(Element design, DesignContext designContext) { // process default attributes - super.synchronizeFromDesign(design, designContext); + super.readDesign(design, designContext); // remove current children removeAllComponents(); // handle children @@ -716,19 +714,18 @@ public class AbsoluteLayout extends AbstractLayout implements /* * (non-Javadoc) * - * @see - * com.vaadin.ui.AbstractComponent#synchronizeToDesign(org.jsoup.nodes.Node, + * @see com.vaadin.ui.AbstractComponent#writeDesign(org.jsoup.nodes.Node, * com.vaadin.ui.declarative.DesignContext) */ @Override - public void synchronizeToDesign(Element design, DesignContext designContext) { - super.synchronizeToDesign(design, designContext); + public void writeDesign(Element design, DesignContext designContext) { + super.writeDesign(design, designContext); // handle children Element designElement = design; for (Component child : this) { Element childNode = designContext.createNode(child); designElement.appendChild(childNode); - child.synchronizeToDesign(childNode, designContext); + child.writeDesign(childNode, designContext); // handle position ComponentPosition position = getPosition(child); writePositionAttribute(childNode, ATTR_TOP, position.getTopUnits() diff --git a/server/src/com/vaadin/ui/AbstractComponent.java b/server/src/com/vaadin/ui/AbstractComponent.java index 808b70386f..3c68fde9b2 100644 --- a/server/src/com/vaadin/ui/AbstractComponent.java +++ b/server/src/com/vaadin/ui/AbstractComponent.java @@ -914,13 +914,11 @@ public abstract class AbstractComponent extends AbstractClientConnector /* * (non-Javadoc) * - * @see - * com.vaadin.ui.Component#synchronizeFromDesign(org.jsoup.nodes.Element, + * @see com.vaadin.ui.Component#readDesign(org.jsoup.nodes.Element, * com.vaadin.ui.declarative.DesignContext) */ @Override - public void synchronizeFromDesign(Element design, - DesignContext designContext) { + public void readDesign(Element design, DesignContext designContext) { Attributes attr = design.attributes(); AbstractComponent def = designContext.getDefaultInstance(this .getClass()); @@ -1190,8 +1188,8 @@ public abstract class AbstractComponent extends AbstractClientConnector /** * Returns a collection of attributes that should not be handled by the * basic implementation of the {@link synhronizeFromDesign} and - * {@link synchronizeToDesign} methods. Typically these are handled in a - * custom way in the overridden versions of the above methods + * {@link writeDesign} methods. Typically these are handled in a custom way + * in the overridden versions of the above methods * * @return the collection of attributes that are not handled by the basic * implementation @@ -1208,11 +1206,11 @@ public abstract class AbstractComponent extends AbstractClientConnector /* * (non-Javadoc) * - * @see com.vaadin.ui.Component#synchronizeToDesign(org.jsoup.nodes.Element, + * @see com.vaadin.ui.Component#writeDesign(org.jsoup.nodes.Element, * com.vaadin.ui.declarative.DesignContext) */ @Override - public void synchronizeToDesign(Element design, DesignContext designContext) { + public void writeDesign(Element design, DesignContext designContext) { // clear element contents DesignAttributeHandler.clearElement(design); AbstractComponent def = designContext.getDefaultInstance(this diff --git a/server/src/com/vaadin/ui/AbstractField.java b/server/src/com/vaadin/ui/AbstractField.java index fc3129d1ba..ba518000d6 100644 --- a/server/src/com/vaadin/ui/AbstractField.java +++ b/server/src/com/vaadin/ui/AbstractField.java @@ -1761,14 +1761,12 @@ public abstract class AbstractField<T> extends AbstractComponent implements /* * (non-Javadoc) * - * @see - * com.vaadin.ui.AbstractComponent#synchronizeFromDesign(org.jsoup.nodes - * .Element, com.vaadin.ui.declarative.DesignContext) + * @see com.vaadin.ui.AbstractComponent#readDesign(org.jsoup.nodes .Element, + * com.vaadin.ui.declarative.DesignContext) */ @Override - public void synchronizeFromDesign(Element design, - DesignContext designContext) { - super.synchronizeFromDesign(design, designContext); + public void readDesign(Element design, DesignContext designContext) { + super.readDesign(design, designContext); AbstractField def = designContext.getDefaultInstance(this.getClass()); Attributes attr = design.attributes(); boolean readOnly = DesignAttributeHandler.readAttribute("readonly", @@ -1798,13 +1796,12 @@ public abstract class AbstractField<T> extends AbstractComponent implements /* * (non-Javadoc) * - * @see - * com.vaadin.ui.AbstractComponent#synchronizeToDesign(org.jsoup.nodes.Element + * @see com.vaadin.ui.AbstractComponent#writeDesign(org.jsoup.nodes.Element * , com.vaadin.ui.declarative.DesignContext) */ @Override - public void synchronizeToDesign(Element design, DesignContext designContext) { - super.synchronizeToDesign(design, designContext); + public void writeDesign(Element design, DesignContext designContext) { + super.writeDesign(design, designContext); AbstractField def = designContext.getDefaultInstance(this.getClass()); Attributes attr = design.attributes(); // handle readonly diff --git a/server/src/com/vaadin/ui/AbstractOrderedLayout.java b/server/src/com/vaadin/ui/AbstractOrderedLayout.java index d2a302cff5..e99641a9ab 100644 --- a/server/src/com/vaadin/ui/AbstractOrderedLayout.java +++ b/server/src/com/vaadin/ui/AbstractOrderedLayout.java @@ -470,15 +470,13 @@ public abstract class AbstractOrderedLayout extends AbstractLayout implements /* * (non-Javadoc) * - * @see - * com.vaadin.ui.AbstractComponent#synchronizeFromDesign(org.jsoup.nodes - * .Element, com.vaadin.ui.declarative.DesignContext) + * @see com.vaadin.ui.AbstractComponent#readDesign(org.jsoup.nodes .Element, + * com.vaadin.ui.declarative.DesignContext) */ @Override - public void synchronizeFromDesign(Element design, - DesignContext designContext) { + public void readDesign(Element design, DesignContext designContext) { // process default attributes - super.synchronizeFromDesign(design, designContext); + super.readDesign(design, designContext); // remove current children removeAllComponents(); // handle margin @@ -535,14 +533,13 @@ public abstract class AbstractOrderedLayout extends AbstractLayout implements /* * (non-Javadoc) * - * @see - * com.vaadin.ui.AbstractComponent#synchronizeToDesign(org.jsoup.nodes.Element + * @see com.vaadin.ui.AbstractComponent#writeDesign(org.jsoup.nodes.Element * , com.vaadin.ui.declarative.DesignContext) */ @Override - public void synchronizeToDesign(Element design, DesignContext designContext) { + public void writeDesign(Element design, DesignContext designContext) { // synchronize default attributes - super.synchronizeToDesign(design, designContext); + super.writeDesign(design, designContext); // handle margin AbstractOrderedLayout def = designContext.getDefaultInstance(this .getClass()); diff --git a/server/src/com/vaadin/ui/AbstractSingleComponentContainer.java b/server/src/com/vaadin/ui/AbstractSingleComponentContainer.java index 6c8d4fcde2..330fcfeae1 100644 --- a/server/src/com/vaadin/ui/AbstractSingleComponentContainer.java +++ b/server/src/com/vaadin/ui/AbstractSingleComponentContainer.java @@ -281,15 +281,13 @@ public abstract class AbstractSingleComponentContainer extends /* * (non-Javadoc) * - * @see - * com.vaadin.ui.AbstractComponent#synchronizeFromDesign(org.jsoup.nodes - * .Element, com.vaadin.ui.declarative.DesignContext) + * @see com.vaadin.ui.AbstractComponent#readDesign(org.jsoup.nodes .Element, + * com.vaadin.ui.declarative.DesignContext) */ @Override - public void synchronizeFromDesign(Element design, - DesignContext designContext) { + public void readDesign(Element design, DesignContext designContext) { // process default attributes - super.synchronizeFromDesign(design, designContext); + super.readDesign(design, designContext); // handle child element, checking that the design specifies at most one // child int childCount = design.children().size(); @@ -309,14 +307,13 @@ public abstract class AbstractSingleComponentContainer extends /* * (non-Javadoc) * - * @see - * com.vaadin.ui.AbstractComponent#synchronizeToDesign(org.jsoup.nodes.Element + * @see com.vaadin.ui.AbstractComponent#writeDesign(org.jsoup.nodes.Element * , com.vaadin.ui.declarative.DesignContext) */ @Override - public void synchronizeToDesign(Element design, DesignContext designContext) { + public void writeDesign(Element design, DesignContext designContext) { // synchronize default attributes (also clears children and attributes) - super.synchronizeToDesign(design, designContext); + super.writeDesign(design, designContext); // handle child component Component child = getContent(); if (child != null) { diff --git a/server/src/com/vaadin/ui/AbstractSplitPanel.java b/server/src/com/vaadin/ui/AbstractSplitPanel.java index 1400bcf092..66d01084d1 100644 --- a/server/src/com/vaadin/ui/AbstractSplitPanel.java +++ b/server/src/com/vaadin/ui/AbstractSplitPanel.java @@ -557,15 +557,13 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { /* * (non-Javadoc) * - * @see - * com.vaadin.ui.AbstractComponent#synchronizeFromDesign(org.jsoup.nodes - * .Element, com.vaadin.ui.declarative.DesignContext) + * @see com.vaadin.ui.AbstractComponent#readDesign(org.jsoup.nodes .Element, + * com.vaadin.ui.declarative.DesignContext) */ @Override - public void synchronizeFromDesign(Element design, - DesignContext designContext) { + public void readDesign(Element design, DesignContext designContext) { // handle default attributes - super.synchronizeFromDesign(design, designContext); + super.readDesign(design, designContext); // handle custom attributes, use default values if no explicit value // set AbstractSplitPanel def = designContext.getDefaultInstance(this @@ -634,9 +632,9 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { } @Override - public void synchronizeToDesign(Element design, DesignContext designContext) { + public void writeDesign(Element design, DesignContext designContext) { // handle default attributes (also clears children and attributes) - super.synchronizeToDesign(design, designContext); + super.writeDesign(design, designContext); // handle custom attributes (write only if a value is not the // default value) AbstractSplitPanel def = designContext.getDefaultInstance(this diff --git a/server/src/com/vaadin/ui/AbstractTextField.java b/server/src/com/vaadin/ui/AbstractTextField.java index 2de8555b26..79492ecf5e 100644 --- a/server/src/com/vaadin/ui/AbstractTextField.java +++ b/server/src/com/vaadin/ui/AbstractTextField.java @@ -766,14 +766,12 @@ public abstract class AbstractTextField extends AbstractField<String> implements /* * (non-Javadoc) * - * @see - * com.vaadin.ui.AbstractField#synchronizeFromDesign(org.jsoup.nodes.Element - * , com.vaadin.ui.declarative.DesignContext) + * @see com.vaadin.ui.AbstractField#readDesign(org.jsoup.nodes.Element , + * com.vaadin.ui.declarative.DesignContext) */ @Override - public void synchronizeFromDesign(Element design, - DesignContext designContext) { - super.synchronizeFromDesign(design, designContext); + public void readDesign(Element design, DesignContext designContext) { + super.readDesign(design, designContext); AbstractTextField def = designContext.getDefaultInstance(this .getClass()); Attributes attr = design.attributes(); @@ -800,13 +798,12 @@ public abstract class AbstractTextField extends AbstractField<String> implements /* * (non-Javadoc) * - * @see - * com.vaadin.ui.AbstractField#synchronizeToDesign(org.jsoup.nodes.Element, + * @see com.vaadin.ui.AbstractField#writeDesign(org.jsoup.nodes.Element, * com.vaadin.ui.declarative.DesignContext) */ @Override - public void synchronizeToDesign(Element design, DesignContext designContext) { - super.synchronizeToDesign(design, designContext); + public void writeDesign(Element design, DesignContext designContext) { + super.writeDesign(design, designContext); AbstractTextField def = designContext.getDefaultInstance(this .getClass()); Attributes attr = design.attributes(); diff --git a/server/src/com/vaadin/ui/Button.java b/server/src/com/vaadin/ui/Button.java index 9a754c24d9..2d0a0cf8da 100644 --- a/server/src/com/vaadin/ui/Button.java +++ b/server/src/com/vaadin/ui/Button.java @@ -669,14 +669,12 @@ public class Button extends AbstractComponent implements /* * (non-Javadoc) * - * @see - * com.vaadin.ui.AbstractComponent#synchronizeFromDesign(org.jsoup.nodes - * .Element, com.vaadin.ui.declarative.DesignContext) + * @see com.vaadin.ui.AbstractComponent#readDesign(org.jsoup.nodes .Element, + * com.vaadin.ui.declarative.DesignContext) */ @Override - public void synchronizeFromDesign(Element design, - DesignContext designContext) { - super.synchronizeFromDesign(design, designContext); + public void readDesign(Element design, DesignContext designContext) { + super.readDesign(design, designContext); Button def = designContext.getDefaultInstance(this.getClass()); Attributes attr = design.attributes(); String content = design.html(); @@ -718,13 +716,12 @@ public class Button extends AbstractComponent implements /* * (non-Javadoc) * - * @see - * com.vaadin.ui.AbstractComponent#synchronizeToDesign(org.jsoup.nodes.Element + * @see com.vaadin.ui.AbstractComponent#writeDesign(org.jsoup.nodes.Element * , com.vaadin.ui.declarative.DesignContext) */ @Override - public void synchronizeToDesign(Element design, DesignContext designContext) { - super.synchronizeToDesign(design, designContext); + public void writeDesign(Element design, DesignContext designContext) { + super.writeDesign(design, designContext); Attributes attr = design.attributes(); Button def = designContext.getDefaultInstance(this.getClass()); String content = getCaption(); diff --git a/server/src/com/vaadin/ui/Component.java b/server/src/com/vaadin/ui/Component.java index 024c3eb433..78fb643ba9 100644 --- a/server/src/com/vaadin/ui/Component.java +++ b/server/src/com/vaadin/ui/Component.java @@ -744,8 +744,7 @@ public interface Component extends ClientConnector, Sizeable, Serializable { * @param designContext * The DesignContext instance used for parsing the design */ - public void synchronizeFromDesign(Element design, - DesignContext designContext); + public void readDesign(Element design, DesignContext designContext); /** * Update the given design based on the component state. The component is @@ -761,7 +760,7 @@ public interface Component extends ClientConnector, Sizeable, Serializable { * The design as HTML to update with the current state * @param designContext */ - public void synchronizeToDesign(Element design, DesignContext designContext); + public void writeDesign(Element design, DesignContext designContext); /* Component event framework */ diff --git a/server/src/com/vaadin/ui/CssLayout.java b/server/src/com/vaadin/ui/CssLayout.java index 0b4e9cda7b..5c7471522d 100644 --- a/server/src/com/vaadin/ui/CssLayout.java +++ b/server/src/com/vaadin/ui/CssLayout.java @@ -364,15 +364,13 @@ public class CssLayout extends AbstractLayout implements LayoutClickNotifier { /* * (non-Javadoc) * - * @see - * com.vaadin.ui.AbstractComponent#synchronizeFromDesign(org.jsoup.nodes - * .Element, com.vaadin.ui.declarative.DesignContext) + * @see com.vaadin.ui.AbstractComponent#readDesign(org.jsoup.nodes .Element, + * com.vaadin.ui.declarative.DesignContext) */ @Override - public void synchronizeFromDesign(Element design, - DesignContext designContext) { + public void readDesign(Element design, DesignContext designContext) { // process default attributes - super.synchronizeFromDesign(design, designContext); + super.readDesign(design, designContext); // remove current children removeAllComponents(); // handle children @@ -385,14 +383,13 @@ public class CssLayout extends AbstractLayout implements LayoutClickNotifier { /* * (non-Javadoc) * - * @see - * com.vaadin.ui.AbstractComponent#synchronizeToDesign(org.jsoup.nodes.Element + * @see com.vaadin.ui.AbstractComponent#writeDesign(org.jsoup.nodes.Element * , com.vaadin.ui.declarative.DesignContext) */ @Override - public void synchronizeToDesign(Element design, DesignContext designContext) { + public void writeDesign(Element design, DesignContext designContext) { // synchronize default attributes - super.synchronizeToDesign(design, designContext); + super.writeDesign(design, designContext); // handle children Element designElement = design; for (Component child : this) { diff --git a/server/src/com/vaadin/ui/Label.java b/server/src/com/vaadin/ui/Label.java index f882940fe6..fc18c374b4 100644 --- a/server/src/com/vaadin/ui/Label.java +++ b/server/src/com/vaadin/ui/Label.java @@ -578,14 +578,12 @@ public class Label extends AbstractComponent implements Property<String>, /* * (non-Javadoc) * - * @see - * com.vaadin.ui.AbstractComponent#synchronizeFromDesign(org.jsoup.nodes - * .Element, com.vaadin.ui.declarative.DesignContext) + * @see com.vaadin.ui.AbstractComponent#readDesign(org.jsoup.nodes .Element, + * com.vaadin.ui.declarative.DesignContext) */ @Override - public void synchronizeFromDesign(Element design, - DesignContext designContext) { - super.synchronizeFromDesign(design, designContext); + public void readDesign(Element design, DesignContext designContext) { + super.readDesign(design, designContext); String innerHtml = design.html(); if (innerHtml != null && !"".equals(innerHtml)) { setValue(innerHtml); @@ -613,13 +611,12 @@ public class Label extends AbstractComponent implements Property<String>, /* * (non-Javadoc) * - * @see - * com.vaadin.ui.AbstractComponent#synchronizeToDesign(org.jsoup.nodes.Element + * @see com.vaadin.ui.AbstractComponent#writeDesign(org.jsoup.nodes.Element * , com.vaadin.ui.declarative.DesignContext) */ @Override - public void synchronizeToDesign(Element design, DesignContext designContext) { - super.synchronizeToDesign(design, designContext); + public void writeDesign(Element design, DesignContext designContext) { + super.writeDesign(design, designContext); String content = getValue(); if (content != null) { design.html(getValue()); diff --git a/server/src/com/vaadin/ui/Panel.java b/server/src/com/vaadin/ui/Panel.java index 46ad801a6d..5112a732ac 100644 --- a/server/src/com/vaadin/ui/Panel.java +++ b/server/src/com/vaadin/ui/Panel.java @@ -345,9 +345,8 @@ public class Panel extends AbstractSingleComponentContainer implements } @Override - public void synchronizeFromDesign(Element design, - DesignContext designContext) { - super.synchronizeFromDesign(design, designContext); + public void readDesign(Element design, DesignContext designContext) { + super.readDesign(design, designContext); // handle tabindex Panel def = designContext.getDefaultInstance(this.getClass()); int tabIndex = DesignAttributeHandler.readAttribute("tabindex", @@ -364,8 +363,8 @@ public class Panel extends AbstractSingleComponentContainer implements } @Override - public void synchronizeToDesign(Element design, DesignContext designContext) { - super.synchronizeToDesign(design, designContext); + public void writeDesign(Element design, DesignContext designContext) { + super.writeDesign(design, designContext); // handle tabindex Panel def = designContext.getDefaultInstance(this.getClass()); DesignAttributeHandler.writeAttribute("tabindex", design.attributes(), diff --git a/server/src/com/vaadin/ui/PasswordField.java b/server/src/com/vaadin/ui/PasswordField.java index b842fc5569..5f27eb59c9 100644 --- a/server/src/com/vaadin/ui/PasswordField.java +++ b/server/src/com/vaadin/ui/PasswordField.java @@ -85,14 +85,12 @@ public class PasswordField extends AbstractTextField { /* * (non-Javadoc) * - * @see - * com.vaadin.ui.AbstractField#synchronizeFromDesign(org.jsoup.nodes.Element - * , com.vaadin.ui.declarative.DesignContext) + * @see com.vaadin.ui.AbstractField#readDesign(org.jsoup.nodes.Element , + * com.vaadin.ui.declarative.DesignContext) */ @Override - public void synchronizeFromDesign(Element design, - DesignContext designContext) { - super.synchronizeFromDesign(design, designContext); + public void readDesign(Element design, DesignContext designContext) { + super.readDesign(design, designContext); AbstractTextField def = designContext.getDefaultInstance(this .getClass()); Attributes attr = design.attributes(); @@ -104,13 +102,12 @@ public class PasswordField extends AbstractTextField { /* * (non-Javadoc) * - * @see - * com.vaadin.ui.AbstractTextField#synchronizeToDesign(org.jsoup.nodes.Element + * @see com.vaadin.ui.AbstractTextField#writeDesign(org.jsoup.nodes.Element * , com.vaadin.ui.declarative.DesignContext) */ @Override - public void synchronizeToDesign(Element design, DesignContext designContext) { - super.synchronizeToDesign(design, designContext); + public void writeDesign(Element design, DesignContext designContext) { + super.writeDesign(design, designContext); AbstractTextField def = designContext.getDefaultInstance(this .getClass()); Attributes attr = design.attributes(); diff --git a/server/src/com/vaadin/ui/TabSheet.java b/server/src/com/vaadin/ui/TabSheet.java index 121ba89e06..94bcb80279 100644 --- a/server/src/com/vaadin/ui/TabSheet.java +++ b/server/src/com/vaadin/ui/TabSheet.java @@ -1458,14 +1458,12 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, /* * (non-Javadoc) * - * @see - * com.vaadin.ui.AbstractComponent#synchronizeFromDesign(org.jsoup.nodes - * .Element, com.vaadin.ui.declarative.DesignContext) + * @see com.vaadin.ui.AbstractComponent#readDesign(org.jsoup.nodes .Element, + * com.vaadin.ui.declarative.DesignContext) */ @Override - public void synchronizeFromDesign(Element design, - DesignContext designContext) { - super.synchronizeFromDesign(design, designContext); + public void readDesign(Element design, DesignContext designContext) { + super.readDesign(design, designContext); Attributes attr = design.attributes(); TabSheet def = designContext.getDefaultInstance(this.getClass()); // handle tab index @@ -1594,13 +1592,12 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, /* * (non-Javadoc) * - * @see - * com.vaadin.ui.AbstractComponent#synchronizeToDesign(org.jsoup.nodes.Element + * @see com.vaadin.ui.AbstractComponent#writeDesign(org.jsoup.nodes.Element * , com.vaadin.ui.declarative.DesignContext) */ @Override - public void synchronizeToDesign(Element design, DesignContext designContext) { - super.synchronizeToDesign(design, designContext); + public void writeDesign(Element design, DesignContext designContext) { + super.writeDesign(design, designContext); TabSheet def = designContext.getDefaultInstance(this.getClass()); Attributes attr = design.attributes(); // handle tab index diff --git a/server/src/com/vaadin/ui/TextArea.java b/server/src/com/vaadin/ui/TextArea.java index 70b9268228..c8103f9c5b 100644 --- a/server/src/com/vaadin/ui/TextArea.java +++ b/server/src/com/vaadin/ui/TextArea.java @@ -139,27 +139,24 @@ public class TextArea extends AbstractTextField { /* * (non-Javadoc) * - * @see - * com.vaadin.ui.AbstractField#synchronizeFromDesign(org.jsoup.nodes.Element - * , com.vaadin.ui.declarative.DesignContext) + * @see com.vaadin.ui.AbstractField#readDesign(org.jsoup.nodes.Element , + * com.vaadin.ui.declarative.DesignContext) */ @Override - public void synchronizeFromDesign(Element design, - DesignContext designContext) { - super.synchronizeFromDesign(design, designContext); + public void readDesign(Element design, DesignContext designContext) { + super.readDesign(design, designContext); setValue(design.html()); } /* * (non-Javadoc) * - * @see - * com.vaadin.ui.AbstractTextField#synchronizeToDesign(org.jsoup.nodes.Element + * @see com.vaadin.ui.AbstractTextField#writeDesign(org.jsoup.nodes.Element * , com.vaadin.ui.declarative.DesignContext) */ @Override - public void synchronizeToDesign(Element design, DesignContext designContext) { - super.synchronizeToDesign(design, designContext); + public void writeDesign(Element design, DesignContext designContext) { + super.writeDesign(design, designContext); design.html(getValue()); } } diff --git a/server/src/com/vaadin/ui/TextField.java b/server/src/com/vaadin/ui/TextField.java index bb855c7b90..03bbfd2d8f 100644 --- a/server/src/com/vaadin/ui/TextField.java +++ b/server/src/com/vaadin/ui/TextField.java @@ -107,14 +107,12 @@ public class TextField extends AbstractTextField { /* * (non-Javadoc) * - * @see - * com.vaadin.ui.AbstractField#synchronizeFromDesign(org.jsoup.nodes.Element - * , com.vaadin.ui.declarative.DesignContext) + * @see com.vaadin.ui.AbstractField#readDesign(org.jsoup.nodes.Element , + * com.vaadin.ui.declarative.DesignContext) */ @Override - public void synchronizeFromDesign(Element design, - DesignContext designContext) { - super.synchronizeFromDesign(design, designContext); + public void readDesign(Element design, DesignContext designContext) { + super.readDesign(design, designContext); AbstractTextField def = designContext.getDefaultInstance(this .getClass()); Attributes attr = design.attributes(); @@ -126,13 +124,12 @@ public class TextField extends AbstractTextField { /* * (non-Javadoc) * - * @see - * com.vaadin.ui.AbstractTextField#synchronizeToDesign(org.jsoup.nodes.Element + * @see com.vaadin.ui.AbstractTextField#writeDesign(org.jsoup.nodes.Element * , com.vaadin.ui.declarative.DesignContext) */ @Override - public void synchronizeToDesign(Element design, DesignContext designContext) { - super.synchronizeToDesign(design, designContext); + public void writeDesign(Element design, DesignContext designContext) { + super.writeDesign(design, designContext); AbstractTextField def = designContext.getDefaultInstance(this .getClass()); Attributes attr = design.attributes(); diff --git a/server/src/com/vaadin/ui/declarative/DesignContext.java b/server/src/com/vaadin/ui/declarative/DesignContext.java index e84faa31ca..b196c84b02 100644 --- a/server/src/com/vaadin/ui/declarative/DesignContext.java +++ b/server/src/com/vaadin/ui/declarative/DesignContext.java @@ -331,9 +331,9 @@ public class DesignContext implements Serializable { /** * Creates an html tree node corresponding to the given element. Also - * initializes its attributes by calling synchronizeToDesign. As a result of - * the synchronizeToDesign() call, this method creates the entire subtree - * rooted at the returned Node. + * initializes its attributes by calling writeDesign. As a result of the + * writeDesign() call, this method creates the entire subtree rooted at the + * returned Node. * * @param childComponent * The component with state that is synchronized in to the node @@ -353,9 +353,9 @@ public class DesignContext implements Serializable { String className = classNameToElementName(componentClass .getSimpleName()); Element newElement = doc.createElement(prefix + className); - childComponent.synchronizeToDesign(newElement, this); + childComponent.writeDesign(newElement, this); // Handle the local id. Global id and caption should have been taken - // care of by synchronizeToDesign. + // care of by writeDesign. String localId = componentToLocalId.get(childComponent); if (localId != null) { newElement.attr(LOCAL_ID_ATTRIBUTE, localId); @@ -391,8 +391,8 @@ public class DesignContext implements Serializable { /** * Creates a Component corresponding to the given html node. Also calls - * synchronizeFromDesign() for the created node, in effect creating the - * entire component hierarchy rooted at the returned component. + * readDesign() for the created node, in effect creating the entire + * component hierarchy rooted at the returned component. * * @param componentDesign * The html tree node containing the description of the component @@ -408,11 +408,10 @@ public class DesignContext implements Serializable { } /** - * Calls synchronizeFromDesign() for the given component and passes the - * given component design as a parameter. This creates the entire component - * hierarchy rooted at the given component. Also registers the componentid, - * localId and caption of the given component and all its children to the - * context + * Calls readDesign() for the given component and passes the given component + * design as a parameter. This creates the entire component hierarchy rooted + * at the given component. Also registers the componentid, localId and + * caption of the given component and all its children to the context * * * @param component @@ -422,7 +421,7 @@ public class DesignContext implements Serializable { */ public void synchronizeAndRegister(Component component, Element componentDesign) { - component.synchronizeFromDesign(componentDesign, this); + component.readDesign(componentDesign, this); // Get the ids and the caption of the component and store them in the // maps of this design context. org.jsoup.nodes.Attributes attributes = componentDesign.attributes(); |