aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--server/src/com/vaadin/server/ClientConnector.java4
-rw-r--r--server/src/com/vaadin/ui/AbsoluteLayout.java19
-rw-r--r--server/src/com/vaadin/ui/AbstractComponent.java14
-rw-r--r--server/src/com/vaadin/ui/AbstractField.java17
-rw-r--r--server/src/com/vaadin/ui/AbstractOrderedLayout.java17
-rw-r--r--server/src/com/vaadin/ui/AbstractSingleComponentContainer.java17
-rw-r--r--server/src/com/vaadin/ui/AbstractSplitPanel.java14
-rw-r--r--server/src/com/vaadin/ui/AbstractTextField.java17
-rw-r--r--server/src/com/vaadin/ui/Button.java17
-rw-r--r--server/src/com/vaadin/ui/Component.java5
-rw-r--r--server/src/com/vaadin/ui/CssLayout.java17
-rw-r--r--server/src/com/vaadin/ui/Label.java17
-rw-r--r--server/src/com/vaadin/ui/Panel.java9
-rw-r--r--server/src/com/vaadin/ui/PasswordField.java17
-rw-r--r--server/src/com/vaadin/ui/TabSheet.java17
-rw-r--r--server/src/com/vaadin/ui/TextArea.java17
-rw-r--r--server/src/com/vaadin/ui/TextField.java17
-rw-r--r--server/src/com/vaadin/ui/declarative/DesignContext.java25
-rw-r--r--server/tests/src/com/vaadin/tests/server/component/absolutelayout/TestReadDesign.java (renamed from server/tests/src/com/vaadin/tests/server/component/absolutelayout/TestSynchronizeFromDesign.java)2
-rw-r--r--server/tests/src/com/vaadin/tests/server/component/absolutelayout/TestWriteDesign.java (renamed from server/tests/src/com/vaadin/tests/server/component/absolutelayout/TestSynchronizeToDesign.java)8
-rw-r--r--server/tests/src/com/vaadin/tests/server/component/abstractcomponent/TestReadDesign.java (renamed from server/tests/src/com/vaadin/tests/server/component/abstractcomponent/TestSynchronizeFromDesign.java)50
-rw-r--r--server/tests/src/com/vaadin/tests/server/component/abstractcomponent/TestWriteDesign.java (renamed from server/tests/src/com/vaadin/tests/server/component/abstractcomponent/TestSynchronizeToDesign.java)42
-rw-r--r--server/tests/src/com/vaadin/tests/server/component/abstractfield/TestReadDesign.java (renamed from server/tests/src/com/vaadin/tests/server/component/abstractfield/TestSynchronizeFromDesign.java)8
-rw-r--r--server/tests/src/com/vaadin/tests/server/component/abstractfield/TestWriteDesign.java (renamed from server/tests/src/com/vaadin/tests/server/component/abstractfield/TestSynchronizeToDesign.java)6
-rw-r--r--server/tests/src/com/vaadin/tests/server/component/abstractorderedlayout/TestReadDesign.java (renamed from server/tests/src/com/vaadin/tests/server/component/abstractorderedlayout/TestSynchronizeFromDesign.java)2
-rw-r--r--server/tests/src/com/vaadin/tests/server/component/abstractorderedlayout/TestWriteDesign.java (renamed from server/tests/src/com/vaadin/tests/server/component/abstractorderedlayout/TestSynchronizeToDesign.java)20
-rw-r--r--server/tests/src/com/vaadin/tests/server/component/abstractsplitpanel/TestReadDesign.java (renamed from server/tests/src/com/vaadin/tests/server/component/abstractsplitpanel/TestSynchronizeFromDesign.java)14
-rw-r--r--server/tests/src/com/vaadin/tests/server/component/abstractsplitpanel/TestWriteDesign.java (renamed from server/tests/src/com/vaadin/tests/server/component/abstractsplitpanel/TestSynchronizeToDesign.java)4
-rw-r--r--server/tests/src/com/vaadin/tests/server/component/abstracttextfield/TestReadDesign.java (renamed from server/tests/src/com/vaadin/tests/server/component/abstracttextfield/TestSynchronizeFromDesign.java)4
-rw-r--r--server/tests/src/com/vaadin/tests/server/component/abstracttextfield/TestWriteDesign.java (renamed from server/tests/src/com/vaadin/tests/server/component/abstracttextfield/TestSynchronizeToDesign.java)4
-rw-r--r--server/tests/src/com/vaadin/tests/server/component/button/TestReadDesign.java (renamed from server/tests/src/com/vaadin/tests/server/component/button/TestSynchronizeFromDesign.java)2
-rw-r--r--server/tests/src/com/vaadin/tests/server/component/button/TestWriteDesign.java (renamed from server/tests/src/com/vaadin/tests/server/component/button/TestSynchronizeToDesign.java)8
-rw-r--r--server/tests/src/com/vaadin/tests/server/component/csslayout/TestReadDesign.java (renamed from server/tests/src/com/vaadin/tests/server/component/csslayout/TestSynchronizeFromDesign.java)2
-rw-r--r--server/tests/src/com/vaadin/tests/server/component/csslayout/TestWriteDesign.java (renamed from server/tests/src/com/vaadin/tests/server/component/csslayout/TestSynchronizeToDesign.java)6
-rw-r--r--server/tests/src/com/vaadin/tests/server/component/label/TestReadDesign.java (renamed from server/tests/src/com/vaadin/tests/server/component/label/TestSynchronizeFromDesign.java)2
-rw-r--r--server/tests/src/com/vaadin/tests/server/component/label/TestWriteDesign.java (renamed from server/tests/src/com/vaadin/tests/server/component/label/TestSynchronizeToDesign.java)10
-rw-r--r--server/tests/src/com/vaadin/tests/server/component/panel/TestReadDesign.java (renamed from server/tests/src/com/vaadin/tests/server/component/panel/TestSynchronizeFromDesign.java)8
-rw-r--r--server/tests/src/com/vaadin/tests/server/component/panel/TestWriteDesign.java (renamed from server/tests/src/com/vaadin/tests/server/component/panel/TestSynchronizeToDesign.java)4
-rw-r--r--server/tests/src/com/vaadin/tests/server/component/tabsheet/TestReadDesign.java (renamed from server/tests/src/com/vaadin/tests/server/component/tabsheet/TestSynchronizeFromDesign.java)7
-rw-r--r--server/tests/src/com/vaadin/tests/server/component/tabsheet/TestWriteDesign.java (renamed from server/tests/src/com/vaadin/tests/server/component/tabsheet/TestSynchronizeToDesign.java)4
-rw-r--r--server/tests/src/com/vaadin/tests/server/component/textarea/TestReadDesign.java (renamed from server/tests/src/com/vaadin/tests/server/component/textarea/TestSynchronizeFromDesign.java)4
-rw-r--r--server/tests/src/com/vaadin/tests/server/component/textarea/TestWriteDesign.java (renamed from server/tests/src/com/vaadin/tests/server/component/textarea/TestSynchronizeToDesign.java)4
-rw-r--r--server/tests/src/com/vaadin/tests/server/component/textfield/TestReadDesign.java (renamed from server/tests/src/com/vaadin/tests/server/component/textfield/TestSynchronizeFromDesign.java)4
-rw-r--r--server/tests/src/com/vaadin/tests/server/component/textfield/TestWriteDesign.java (renamed from server/tests/src/com/vaadin/tests/server/component/textfield/TestSynchronizeToDesign.java)4
44 files changed, 233 insertions, 277 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();
diff --git a/server/tests/src/com/vaadin/tests/server/component/absolutelayout/TestSynchronizeFromDesign.java b/server/tests/src/com/vaadin/tests/server/component/absolutelayout/TestReadDesign.java
index ce054007a6..5f9674e554 100644
--- a/server/tests/src/com/vaadin/tests/server/component/absolutelayout/TestSynchronizeFromDesign.java
+++ b/server/tests/src/com/vaadin/tests/server/component/absolutelayout/TestReadDesign.java
@@ -35,7 +35,7 @@ import com.vaadin.ui.declarative.DesignContext;
* @since
* @author Vaadin Ltd
*/
-public class TestSynchronizeFromDesign extends TestCase {
+public class TestReadDesign extends TestCase {
private AbsoluteLayout root;
diff --git a/server/tests/src/com/vaadin/tests/server/component/absolutelayout/TestSynchronizeToDesign.java b/server/tests/src/com/vaadin/tests/server/component/absolutelayout/TestWriteDesign.java
index eb61d13684..5f42b1fa81 100644
--- a/server/tests/src/com/vaadin/tests/server/component/absolutelayout/TestSynchronizeToDesign.java
+++ b/server/tests/src/com/vaadin/tests/server/component/absolutelayout/TestWriteDesign.java
@@ -31,13 +31,13 @@ import com.vaadin.ui.declarative.DesignContext;
* @since
* @author Vaadin Ltd
*/
-public class TestSynchronizeToDesign extends TestCase {
+public class TestWriteDesign extends TestCase {
public void testSynchronizeEmptyLayout() {
AbsoluteLayout layout = createTestLayout();
layout.removeAllComponents();
Element design = createDesign();
- layout.synchronizeToDesign(design, createDesignContext());
+ layout.writeDesign(design, createDesignContext());
assertEquals(0, design.childNodes().size());
assertEquals("changed-caption", design.attr("caption"));
}
@@ -45,7 +45,7 @@ public class TestSynchronizeToDesign extends TestCase {
public void testSynchronizeLayoutWithChildren() {
AbsoluteLayout layout = createTestLayout();
Element design = createDesign();
- layout.synchronizeToDesign(design, createDesignContext());
+ layout.writeDesign(design, createDesignContext());
assertEquals(2, design.childNodes().size());
assertEquals("v-label", ((Element) design.childNode(0)).tagName());
assertEquals("v-label", ((Element) design.childNode(1)).tagName());
@@ -54,7 +54,7 @@ public class TestSynchronizeToDesign extends TestCase {
public void testSynchronizePosition() {
AbsoluteLayout layout = createTestLayout();
Element design = createDesign();
- layout.synchronizeToDesign(design, createDesignContext());
+ layout.writeDesign(design, createDesignContext());
Attributes attributes = design.childNode(0).attributes();
assertEquals("50px", attributes.get(":top"));
assertEquals("50%", attributes.get(":left"));
diff --git a/server/tests/src/com/vaadin/tests/server/component/abstractcomponent/TestSynchronizeFromDesign.java b/server/tests/src/com/vaadin/tests/server/component/abstractcomponent/TestReadDesign.java
index df6fb47bf2..760f1ca422 100644
--- a/server/tests/src/com/vaadin/tests/server/component/abstractcomponent/TestSynchronizeFromDesign.java
+++ b/server/tests/src/com/vaadin/tests/server/component/abstractcomponent/TestReadDesign.java
@@ -36,7 +36,7 @@ import com.vaadin.ui.declarative.DesignContext;
*
* @author Vaadin Ltd
*/
-public class TestSynchronizeFromDesign extends TestCase {
+public class TestReadDesign extends TestCase {
private DesignContext ctx;
@@ -49,28 +49,28 @@ public class TestSynchronizeFromDesign extends TestCase {
public void testSynchronizeId() {
Element design = createDesign("id", "testId");
AbstractComponent component = getComponent();
- component.synchronizeFromDesign(design, ctx);
+ component.readDesign(design, ctx);
assertEquals("testId", component.getId());
}
public void testSynchronizePrimaryStyleName() {
Element design = createDesign("primary-style-name", "test-style");
AbstractComponent component = getComponent();
- component.synchronizeFromDesign(design, ctx);
+ component.readDesign(design, ctx);
assertEquals("test-style", component.getPrimaryStyleName());
}
public void testSynchronizeCaption() {
Element design = createDesign("caption", "test-caption");
AbstractComponent component = getComponent();
- component.synchronizeFromDesign(design, ctx);
+ component.readDesign(design, ctx);
assertEquals("test-caption", component.getCaption());
}
public void testSynchronizeLocale() {
Element design = createDesign("locale", "fi_FI");
AbstractComponent component = getComponent();
- component.synchronizeFromDesign(design, ctx);
+ component.readDesign(design, ctx);
assertEquals("fi", component.getLocale().getLanguage());
assertEquals("FI", component.getLocale().getCountry());
}
@@ -78,7 +78,7 @@ public class TestSynchronizeFromDesign extends TestCase {
public void testSynchronizeExternalIcon() {
Element design = createDesign("icon", "http://example.com/example.gif");
AbstractComponent component = getComponent();
- component.synchronizeFromDesign(design, ctx);
+ component.readDesign(design, ctx);
assertTrue("Incorrect resource type returned", component.getIcon()
.getClass().isAssignableFrom(ExternalResource.class));
assertEquals("http://example.com/example.gif",
@@ -88,7 +88,7 @@ public class TestSynchronizeFromDesign extends TestCase {
public void testSynchronizeThemeIcon() {
Element design = createDesign("icon", "theme://example.gif");
AbstractComponent component = getComponent();
- component.synchronizeFromDesign(design, ctx);
+ component.readDesign(design, ctx);
assertTrue("Incorrect resource type returned", component.getIcon()
.getClass().isAssignableFrom(ThemeResource.class));
}
@@ -96,7 +96,7 @@ public class TestSynchronizeFromDesign extends TestCase {
public void testSynchronizeFileResource() {
Element design = createDesign("icon", "img/example.gif");
AbstractComponent component = getComponent();
- component.synchronizeFromDesign(design, ctx);
+ component.readDesign(design, ctx);
assertTrue("Incorrect resource type returned", component.getIcon()
.getClass().isAssignableFrom(FileResource.class));
}
@@ -104,24 +104,24 @@ public class TestSynchronizeFromDesign extends TestCase {
public void testSynchronizeImmediate() {
Element design = createDesign("immediate", "true");
AbstractComponent component = getComponent();
- component.synchronizeFromDesign(design, ctx);
+ component.readDesign(design, ctx);
assertEquals(true, component.isImmediate());
assertEquals(Boolean.TRUE, getExplicitImmediate(component));
// Synchronize with a design having no immediate attribute -
// explicitImmediate should then be null.
design = createDesign("description", "test-description");
- component.synchronizeFromDesign(design, ctx);
+ component.readDesign(design, ctx);
assertEquals(null, getExplicitImmediate(component));
// Synchronize with a design having immediate = false
design = createDesign("immediate", "false");
- component.synchronizeFromDesign(design, ctx);
+ component.readDesign(design, ctx);
assertEquals(false, component.isImmediate());
assertEquals(Boolean.FALSE, getExplicitImmediate(component));
// Synchronize with a design having immediate = "" - should correspond
// to
// true.
design = createDesign("immediate", "");
- component.synchronizeFromDesign(design, ctx);
+ component.readDesign(design, ctx);
assertEquals(true, component.isImmediate());
assertEquals(Boolean.TRUE, getExplicitImmediate(component));
}
@@ -129,14 +129,14 @@ public class TestSynchronizeFromDesign extends TestCase {
public void testSynchronizeDescription() {
Element design = createDesign("description", "test-description");
AbstractComponent component = getComponent();
- component.synchronizeFromDesign(design, ctx);
+ component.readDesign(design, ctx);
assertEquals("test-description", component.getDescription());
}
public void testSynchronizeComponentError() {
Element design = createDesign("error", "<div>test-error</div>");
AbstractComponent component = getComponent();
- component.synchronizeFromDesign(design, ctx);
+ component.readDesign(design, ctx);
assertEquals("<div>test-error</div>", component.getComponentError()
.getFormattedHtmlMessage());
}
@@ -144,7 +144,7 @@ public class TestSynchronizeFromDesign extends TestCase {
public void testSynchronizeSizeFull() {
Element design = createDesign("size-full", "");
AbstractComponent component = getComponent();
- component.synchronizeFromDesign(design, ctx);
+ component.readDesign(design, ctx);
assertEquals(100, component.getWidth(), 0.1f);
assertEquals(100, component.getHeight(), 0.1f);
}
@@ -152,7 +152,7 @@ public class TestSynchronizeFromDesign extends TestCase {
public void testSynchronizeSizeAuto() {
Element design = createDesign("size-auto", "");
AbstractComponent component = getComponent();
- component.synchronizeFromDesign(design, ctx);
+ component.readDesign(design, ctx);
assertEquals(-1, component.getWidth(), 0.1f);
assertEquals(-1, component.getHeight(), 0.1f);
}
@@ -160,35 +160,35 @@ public class TestSynchronizeFromDesign extends TestCase {
public void testSynchronizeHeightFull() {
Element design = createDesign("height-full", "");
AbstractComponent component = getComponent();
- component.synchronizeFromDesign(design, ctx);
+ component.readDesign(design, ctx);
assertEquals(100, component.getHeight(), 0.1f);
}
public void testSynchronizeHeightAuto() {
Element design = createDesign("height-auto", "");
AbstractComponent component = getComponent();
- component.synchronizeFromDesign(design, ctx);
+ component.readDesign(design, ctx);
assertEquals(-1, component.getHeight(), 0.1f);
}
public void testSynchronizeWidthFull() {
Element design = createDesign("width-full", "");
AbstractComponent component = getComponent();
- component.synchronizeFromDesign(design, ctx);
+ component.readDesign(design, ctx);
assertEquals(100, component.getWidth(), 0.1f);
}
public void testSynchronizeWidthAuto() {
Element design = createDesign("width-auto", "");
AbstractComponent component = getComponent();
- component.synchronizeFromDesign(design, ctx);
+ component.readDesign(design, ctx);
assertEquals(-1, component.getWidth(), 0.1f);
}
public void testSynchronizeWidth() {
Element design = createDesign("width", "12px");
AbstractComponent component = getComponent();
- component.synchronizeFromDesign(design, ctx);
+ component.readDesign(design, ctx);
assertEquals(12, component.getWidth(), 0.1f);
assertEquals(com.vaadin.server.Sizeable.Unit.PIXELS,
component.getWidthUnits());
@@ -197,7 +197,7 @@ public class TestSynchronizeFromDesign extends TestCase {
public void testSynchronizeHeight() {
Element design = createDesign("height", "12px");
AbstractComponent component = getComponent();
- component.synchronizeFromDesign(design, ctx);
+ component.readDesign(design, ctx);
assertEquals(12, component.getHeight(), 0.1f);
assertEquals(com.vaadin.server.Sizeable.Unit.PIXELS,
component.getHeightUnits());
@@ -207,7 +207,7 @@ public class TestSynchronizeFromDesign extends TestCase {
AbstractComponent component = getComponent();
Responsive.makeResponsive(component);
Element design = createDesign("responsive", "false");
- component.synchronizeFromDesign(design, ctx);
+ component.readDesign(design, ctx);
assertEquals("Component should not have extensions", 0, component
.getExtensions().size());
}
@@ -215,7 +215,7 @@ public class TestSynchronizeFromDesign extends TestCase {
public void testSynchronizeResponsive() {
AbstractComponent component = getComponent();
Element design = createDesign("responsive", "");
- component.synchronizeFromDesign(design, ctx);
+ component.readDesign(design, ctx);
assertEquals("Component should have one extension", 1, component
.getExtensions().size());
assertTrue("Extension should be responsive", component.getExtensions()
@@ -226,7 +226,7 @@ public class TestSynchronizeFromDesign extends TestCase {
AbstractComponent component = getComponent();
Responsive.makeResponsive(component);
Element design = createDesign("responsive", "");
- component.synchronizeFromDesign(design, ctx);
+ component.readDesign(design, ctx);
assertEquals("Component should have only one extension", 1, component
.getExtensions().size());
}
diff --git a/server/tests/src/com/vaadin/tests/server/component/abstractcomponent/TestSynchronizeToDesign.java b/server/tests/src/com/vaadin/tests/server/component/abstractcomponent/TestWriteDesign.java
index 349598ec8f..44c0e0b063 100644
--- a/server/tests/src/com/vaadin/tests/server/component/abstractcomponent/TestSynchronizeToDesign.java
+++ b/server/tests/src/com/vaadin/tests/server/component/abstractcomponent/TestWriteDesign.java
@@ -41,7 +41,7 @@ import com.vaadin.ui.declarative.DesignContext;
*
* @author Vaadin Ltd
*/
-public class TestSynchronizeToDesign extends TestCase {
+public class TestWriteDesign extends TestCase {
private DesignContext ctx;
@@ -55,7 +55,7 @@ public class TestSynchronizeToDesign extends TestCase {
Element design = createDesign();
AbstractComponent component = getComponent();
component.setId("testId");
- component.synchronizeToDesign(design, ctx);
+ component.writeDesign(design, ctx);
// we only changed one of the attributes, others are at default values
assertEquals(1, design.attributes().size());
assertEquals("testId", design.attr("id"));
@@ -65,7 +65,7 @@ public class TestSynchronizeToDesign extends TestCase {
Element design = createDesign();
AbstractComponent component = getComponent();
component.setPrimaryStyleName("test-style");
- component.synchronizeToDesign(design, ctx);
+ component.writeDesign(design, ctx);
// we only changed one of the attributes, others are at default values
assertEquals(1, design.attributes().size());
assertEquals("test-style", design.attr("primary-style-name"));
@@ -75,7 +75,7 @@ public class TestSynchronizeToDesign extends TestCase {
Element design = createDesign();
AbstractComponent component = getComponent();
component.setCaption("test-caption");
- component.synchronizeToDesign(design, ctx);
+ component.writeDesign(design, ctx);
// We only changed the caption, which is not
// an attribute.
assertEquals(0, design.attributes().size());
@@ -86,7 +86,7 @@ public class TestSynchronizeToDesign extends TestCase {
Element design = createDesign();
AbstractComponent component = getComponent();
component.setLocale(new Locale("fi", "FI"));
- component.synchronizeToDesign(design, ctx);
+ component.writeDesign(design, ctx);
// we only changed one of the attributes, others are at default values
assertEquals(1, design.attributes().size());
assertEquals("fi_FI", design.attr("locale"));
@@ -97,7 +97,7 @@ public class TestSynchronizeToDesign extends TestCase {
AbstractComponent component = getComponent();
component
.setIcon(new ExternalResource("http://example.com/example.gif"));
- component.synchronizeToDesign(design, ctx);
+ component.writeDesign(design, ctx);
// we only changed one of the attributes, others are at default values
assertEquals(1, design.attributes().size());
assertEquals("http://example.com/example.gif", design.attr("icon"));
@@ -107,7 +107,7 @@ public class TestSynchronizeToDesign extends TestCase {
Element design = createDesign();
AbstractComponent component = getComponent();
component.setIcon(new ThemeResource("example.gif"));
- component.synchronizeToDesign(design, ctx);
+ component.writeDesign(design, ctx);
// we only changed one of the attributes, others are at default values
assertEquals(1, design.attributes().size());
assertEquals("theme://example.gif", design.attr("icon"));
@@ -117,7 +117,7 @@ public class TestSynchronizeToDesign extends TestCase {
Element design = createDesign();
AbstractComponent component = getComponent();
component.setIcon(new FileResource(new File("img/example.gif")));
- component.synchronizeToDesign(design, ctx);
+ component.writeDesign(design, ctx);
// we only changed one of the attributes, others are at default values
assertEquals(1, design.attributes().size());
assertEquals("img/example.gif", design.attr("icon"));
@@ -128,10 +128,10 @@ public class TestSynchronizeToDesign extends TestCase {
AbstractComponent component = getComponent();
// no immediate attribute should be written before setting immediate to
// some value
- component.synchronizeToDesign(design, ctx);
+ component.writeDesign(design, ctx);
assertFalse(design.hasAttr("immediate"));
component.setImmediate(true);
- component.synchronizeToDesign(design, ctx);
+ component.writeDesign(design, ctx);
// we only changed one of the attributes, others are at default values
assertEquals(1, design.attributes().size());
assertEquals("true", design.attr("immediate"));
@@ -141,7 +141,7 @@ public class TestSynchronizeToDesign extends TestCase {
Element design = createDesign();
AbstractComponent component = getComponent();
component.setDescription("test-description");
- component.synchronizeToDesign(design, ctx);
+ component.writeDesign(design, ctx);
// we only changed one of the attributes, others are at default values
assertEquals(1, design.attributes().size());
assertEquals("test-description", design.attr("description"));
@@ -152,7 +152,7 @@ public class TestSynchronizeToDesign extends TestCase {
AbstractComponent component = getComponent();
component.setComponentError(new UserError("<div>test-error</div>",
ContentMode.HTML, ErrorLevel.ERROR));
- component.synchronizeToDesign(design, ctx);
+ component.writeDesign(design, ctx);
// we only changed one of the attributes, others are at default values
assertEquals(1, design.attributes().size());
assertEquals("<div>test-error</div>", design.attr("error"));
@@ -162,7 +162,7 @@ public class TestSynchronizeToDesign extends TestCase {
Element design = createDesign();
AbstractComponent component = getComponent();
component.setSizeFull();
- component.synchronizeToDesign(design, ctx);
+ component.writeDesign(design, ctx);
// there should be only size full
assertEquals(1, design.attributes().size());
assertEquals("true", design.attr("size-full"));
@@ -172,7 +172,7 @@ public class TestSynchronizeToDesign extends TestCase {
Element design = createDesign();
AbstractComponent component = getPanel();
component.setSizeUndefined();
- component.synchronizeToDesign(design, ctx);
+ component.writeDesign(design, ctx);
// there should be only size auto
assertEquals(1, design.attributes().size());
assertEquals("true", design.attr("size-auto"));
@@ -183,7 +183,7 @@ public class TestSynchronizeToDesign extends TestCase {
AbstractComponent component = getComponent();
component.setHeight("100%");
component.setWidth("20px");
- component.synchronizeToDesign(design, ctx);
+ component.writeDesign(design, ctx);
assertEquals("true", design.attr("height-full"));
}
@@ -193,7 +193,7 @@ public class TestSynchronizeToDesign extends TestCase {
AbstractComponent component = getPanel();
component.setHeight(null);
component.setWidth("20px");
- component.synchronizeToDesign(design, ctx);
+ component.writeDesign(design, ctx);
assertEquals("true", design.attr("height-auto"));
}
@@ -202,7 +202,7 @@ public class TestSynchronizeToDesign extends TestCase {
AbstractComponent component = getComponent();
component.setHeight("20px");
component.setWidth("100%");
- component.synchronizeToDesign(design, ctx);
+ component.writeDesign(design, ctx);
assertEquals("true", design.attr("width-full"));
}
@@ -212,7 +212,7 @@ public class TestSynchronizeToDesign extends TestCase {
AbstractComponent component = getPanel();
component.setHeight("20px");
component.setWidth(null);
- component.synchronizeToDesign(design, ctx);
+ component.writeDesign(design, ctx);
assertEquals("true", design.attr("width-auto"));
}
@@ -221,7 +221,7 @@ public class TestSynchronizeToDesign extends TestCase {
AbstractComponent component = getComponent();
component.setHeight("20px");
component.setWidth("70%");
- component.synchronizeToDesign(design, ctx);
+ component.writeDesign(design, ctx);
assertEquals("70%", design.attr("width"));
}
@@ -230,7 +230,7 @@ public class TestSynchronizeToDesign extends TestCase {
AbstractComponent component = getComponent();
component.setHeight("20px");
component.setWidth("70%");
- component.synchronizeToDesign(design, ctx);
+ component.writeDesign(design, ctx);
assertEquals("20px", design.attr("height"));
}
@@ -238,7 +238,7 @@ public class TestSynchronizeToDesign extends TestCase {
Element design = createDesign();
AbstractComponent component = getComponent();
Responsive.makeResponsive(component);
- component.synchronizeToDesign(design, ctx);
+ component.writeDesign(design, ctx);
assertTrue("Design attributes should have key 'responsive'", design
.attributes().hasKey("responsive"));
assertFalse("Responsive attribute should not be 'false'",
diff --git a/server/tests/src/com/vaadin/tests/server/component/abstractfield/TestSynchronizeFromDesign.java b/server/tests/src/com/vaadin/tests/server/component/abstractfield/TestReadDesign.java
index 6a2c194978..dd0e629199 100644
--- a/server/tests/src/com/vaadin/tests/server/component/abstractfield/TestSynchronizeFromDesign.java
+++ b/server/tests/src/com/vaadin/tests/server/component/abstractfield/TestReadDesign.java
@@ -31,7 +31,7 @@ import com.vaadin.ui.declarative.DesignContext;
*
* @author Vaadin Ltd
*/
-public class TestSynchronizeFromDesign extends TestCase {
+public class TestReadDesign extends TestCase {
private DesignContext ctx;
@@ -44,17 +44,17 @@ public class TestSynchronizeFromDesign extends TestCase {
public void testSynchronizeReadOnly() {
Element design = createDesign("readonly", "");
AbstractField component = getComponent();
- component.synchronizeFromDesign(design, ctx);
+ component.readDesign(design, ctx);
assertEquals(true, component.isReadOnly());
design = createDesign("readonly", "false");
- component.synchronizeFromDesign(design, ctx);
+ component.readDesign(design, ctx);
assertEquals(false, component.isReadOnly());
}
public void testSynchronizeTabIndex() {
Element design = createDesign("tabindex", "2");
AbstractField component = getComponent();
- component.synchronizeFromDesign(design, ctx);
+ component.readDesign(design, ctx);
assertEquals("Tab index must be 2", 2, component.getTabIndex());
}
diff --git a/server/tests/src/com/vaadin/tests/server/component/abstractfield/TestSynchronizeToDesign.java b/server/tests/src/com/vaadin/tests/server/component/abstractfield/TestWriteDesign.java
index 26f64f9199..969713abe6 100644
--- a/server/tests/src/com/vaadin/tests/server/component/abstractfield/TestSynchronizeToDesign.java
+++ b/server/tests/src/com/vaadin/tests/server/component/abstractfield/TestWriteDesign.java
@@ -31,7 +31,7 @@ import com.vaadin.ui.declarative.DesignContext;
*
* @author Vaadin Ltd
*/
-public class TestSynchronizeToDesign extends TestCase {
+public class TestWriteDesign extends TestCase {
private DesignContext ctx;
@@ -45,7 +45,7 @@ public class TestSynchronizeToDesign extends TestCase {
Element design = createDesign();
AbstractField component = getComponent();
component.setReadOnly(true);
- component.synchronizeToDesign(design, ctx);
+ component.writeDesign(design, ctx);
// we only changed one of the attributes, others are at default values
assertEquals(1, design.attributes().size());
assertTrue("Design must contain readonly", design.hasAttr("readonly"));
@@ -59,7 +59,7 @@ public class TestSynchronizeToDesign extends TestCase {
ObjectProperty property = new ObjectProperty<String>("test");
property.setReadOnly(true);
component.setPropertyDataSource(property);
- component.synchronizeToDesign(design, ctx);
+ component.writeDesign(design, ctx);
// make sure that property readonly is not written to design
assertFalse("Design must not contain readonly",
design.hasAttr("readonly"));
diff --git a/server/tests/src/com/vaadin/tests/server/component/abstractorderedlayout/TestSynchronizeFromDesign.java b/server/tests/src/com/vaadin/tests/server/component/abstractorderedlayout/TestReadDesign.java
index 2b3d4cbdac..f52a04496a 100644
--- a/server/tests/src/com/vaadin/tests/server/component/abstractorderedlayout/TestSynchronizeFromDesign.java
+++ b/server/tests/src/com/vaadin/tests/server/component/abstractorderedlayout/TestReadDesign.java
@@ -32,7 +32,7 @@ import com.vaadin.ui.declarative.DesignContext;
* @since
* @author Vaadin Ltd
*/
-public class TestSynchronizeFromDesign extends TestCase {
+public class TestReadDesign extends TestCase {
public void testChildCount() {
VerticalLayout root = createLayout(0f, false);
diff --git a/server/tests/src/com/vaadin/tests/server/component/abstractorderedlayout/TestSynchronizeToDesign.java b/server/tests/src/com/vaadin/tests/server/component/abstractorderedlayout/TestWriteDesign.java
index 23cf15cd13..302cf985bd 100644
--- a/server/tests/src/com/vaadin/tests/server/component/abstractorderedlayout/TestSynchronizeToDesign.java
+++ b/server/tests/src/com/vaadin/tests/server/component/abstractorderedlayout/TestWriteDesign.java
@@ -32,13 +32,13 @@ import com.vaadin.ui.declarative.DesignContext;
* @since
* @author Vaadin Ltd
*/
-public class TestSynchronizeToDesign extends TestCase {
+public class TestWriteDesign extends TestCase {
public void testSynchronizeMargin() {
VerticalLayout layout = new VerticalLayout();
layout.setMargin(true);
Element design = createDesign();
- layout.synchronizeToDesign(design, createDesignContext());
+ layout.writeDesign(design, createDesignContext());
assertTrue("The margin must be written", design.hasAttr("margin"));
assertTrue("The margin must be empty or true", design.attr("margin")
.equals("") || design.attr("margin").equalsIgnoreCase("true"));
@@ -48,7 +48,7 @@ public class TestSynchronizeToDesign extends TestCase {
VerticalLayout layout = new VerticalLayout();
layout.setCaption("changed-caption");
Element design = createDesign();
- layout.synchronizeToDesign(design, createDesignContext());
+ layout.writeDesign(design, createDesignContext());
assertEquals(0, design.childNodes().size());
assertEquals("changed-caption", design.attr("caption"));
}
@@ -59,7 +59,7 @@ public class TestSynchronizeToDesign extends TestCase {
layout.getComponent(0).setCaption("test-caption");
layout.addComponent(new Label("test-label-2"));
Element design = createDesign();
- layout.synchronizeToDesign(design, createDesignContext());
+ layout.writeDesign(design, createDesignContext());
assertEquals(2, design.childNodes().size());
assertEquals("v-label", ((Element) design.childNode(0)).tagName());
assertEquals("test-caption", design.childNode(0).attr("caption"));
@@ -70,7 +70,7 @@ public class TestSynchronizeToDesign extends TestCase {
layout.addComponent(new Label("test-label"));
layout.setExpandRatio(layout.getComponent(0), 1.0f);
Element design = createDesign();
- layout.synchronizeToDesign(design, createDesignContext());
+ layout.writeDesign(design, createDesignContext());
assertTrue(design.childNode(0).hasAttr(":expand"));
assertEquals("", design.childNode(0).attr(":expand"));
}
@@ -80,7 +80,7 @@ public class TestSynchronizeToDesign extends TestCase {
layout.addComponent(new Label("test-label"));
layout.setExpandRatio(layout.getComponent(0), 2.40f);
Element design = createDesign();
- layout.synchronizeToDesign(design, createDesignContext());
+ layout.writeDesign(design, createDesignContext());
assertTrue(design.childNode(0).hasAttr(":expand"));
assertEquals("2.4", design.childNode(0).attr(":expand"));
}
@@ -88,7 +88,7 @@ public class TestSynchronizeToDesign extends TestCase {
public void testSynchronizeDefaultAlignment() {
Element design = createDesign();
VerticalLayout layout = createLayoutWithAlignment(design, null);
- layout.synchronizeToDesign(design, createDesignContext());
+ layout.writeDesign(design, createDesignContext());
assertFalse(design.childNode(0).hasAttr(":top"));
assertFalse(design.childNode(0).hasAttr(":left"));
}
@@ -97,7 +97,7 @@ public class TestSynchronizeToDesign extends TestCase {
Element design = createDesign();
VerticalLayout layout = createLayoutWithAlignment(design,
Alignment.MIDDLE_CENTER);
- layout.synchronizeToDesign(design, createDesignContext());
+ layout.writeDesign(design, createDesignContext());
assertTrue(design.childNode(0).hasAttr(":middle"));
assertTrue(design.childNode(0).hasAttr(":center"));
}
@@ -106,7 +106,7 @@ public class TestSynchronizeToDesign extends TestCase {
Element design = createDesign();
VerticalLayout layout = createLayoutWithAlignment(design,
Alignment.BOTTOM_RIGHT);
- layout.synchronizeToDesign(design, createDesignContext());
+ layout.writeDesign(design, createDesignContext());
assertTrue(design.childNode(0).hasAttr(":bottom"));
assertTrue(design.childNode(0).hasAttr(":right"));
}
@@ -118,7 +118,7 @@ public class TestSynchronizeToDesign extends TestCase {
if (alignment != null) {
layout.setComponentAlignment(layout.getComponent(0), alignment);
}
- layout.synchronizeToDesign(design, createDesignContext());
+ layout.writeDesign(design, createDesignContext());
return layout;
}
diff --git a/server/tests/src/com/vaadin/tests/server/component/abstractsplitpanel/TestSynchronizeFromDesign.java b/server/tests/src/com/vaadin/tests/server/component/abstractsplitpanel/TestReadDesign.java
index b34e8fc3f0..c57f18cbf9 100644
--- a/server/tests/src/com/vaadin/tests/server/component/abstractsplitpanel/TestSynchronizeFromDesign.java
+++ b/server/tests/src/com/vaadin/tests/server/component/abstractsplitpanel/TestReadDesign.java
@@ -38,7 +38,7 @@ import com.vaadin.ui.declarative.DesignContext;
*
* @author Vaadin Ltd
*/
-public class TestSynchronizeFromDesign extends TestCase {
+public class TestReadDesign extends TestCase {
DesignContext ctx;
@Override
@@ -50,7 +50,7 @@ public class TestSynchronizeFromDesign extends TestCase {
// Create a design with non-default attributes values.
Element design = createDesign(true, false, true, true);
HorizontalSplitPanel sp = new HorizontalSplitPanel();
- sp.synchronizeFromDesign(design, ctx);
+ sp.readDesign(design, ctx);
// Check that the attributes are correctly parsed.
assertEquals(20.5f, sp.getSplitPosition());
assertEquals(Unit.PERCENTAGE, sp.getSplitPositionUnit());
@@ -63,7 +63,7 @@ public class TestSynchronizeFromDesign extends TestCase {
// check that the properties get the default values if the design
// does not have attributes corresponding to those properties
design = createDesign(true, true, true, true);
- sp.synchronizeFromDesign(design, ctx);
+ sp.readDesign(design, ctx);
HorizontalSplitPanel def = new HorizontalSplitPanel();
assertEquals(def.getSplitPosition(), sp.getSplitPosition());
assertEquals(def.getSplitPositionUnit(), sp.getSplitPositionUnit());
@@ -80,7 +80,7 @@ public class TestSynchronizeFromDesign extends TestCase {
public void testWithNoChildren() {
Element design = createDesign(true, false, false, false);
HorizontalSplitPanel sp = new HorizontalSplitPanel();
- sp.synchronizeFromDesign(design, ctx);
+ sp.readDesign(design, ctx);
assertEquals("Unexpected child count for the split panel.", 0,
sp.getComponentCount());
}
@@ -88,7 +88,7 @@ public class TestSynchronizeFromDesign extends TestCase {
public void testWithFirstChild() {
Element design = createDesign(false, false, true, false);
VerticalSplitPanel sp = new VerticalSplitPanel();
- sp.synchronizeFromDesign(design, ctx);
+ sp.readDesign(design, ctx);
assertEquals("Unexpected child count for the split panel.", 1,
sp.getComponentCount());
Object obj = sp.getFirstComponent();
@@ -99,7 +99,7 @@ public class TestSynchronizeFromDesign extends TestCase {
public void testWithSecondChild() {
Element design = createDesign(true, false, false, true);
HorizontalSplitPanel sp = new HorizontalSplitPanel();
- sp.synchronizeFromDesign(design, ctx);
+ sp.readDesign(design, ctx);
assertEquals("Unexpected child count for the split panel.", 1,
sp.getComponentCount());
Object obj = sp.getSecondComponent();
@@ -110,7 +110,7 @@ public class TestSynchronizeFromDesign extends TestCase {
public void testWithBothChildren() {
Element design = createDesign(false, false, true, true);
VerticalSplitPanel sp = new VerticalSplitPanel();
- sp.synchronizeFromDesign(design, ctx);
+ sp.readDesign(design, ctx);
assertEquals("Unexpected child count for the split panel.", 2,
sp.getComponentCount());
Object first = sp.getFirstComponent();
diff --git a/server/tests/src/com/vaadin/tests/server/component/abstractsplitpanel/TestSynchronizeToDesign.java b/server/tests/src/com/vaadin/tests/server/component/abstractsplitpanel/TestWriteDesign.java
index 3e342a0c89..1027414c2d 100644
--- a/server/tests/src/com/vaadin/tests/server/component/abstractsplitpanel/TestSynchronizeToDesign.java
+++ b/server/tests/src/com/vaadin/tests/server/component/abstractsplitpanel/TestWriteDesign.java
@@ -32,7 +32,7 @@ import com.vaadin.ui.declarative.DesignContext;
*
* @author Vaadin Ltd
*/
-public class TestSynchronizeToDesign extends TestCase {
+public class TestWriteDesign extends TestCase {
private DesignContext ctx;
@Override
@@ -142,7 +142,7 @@ public class TestSynchronizeToDesign extends TestCase {
sp.setSecondComponent(new Label("Second slot"));
Element e = ctx.createNode(sp);
sp = new VerticalSplitPanel();
- sp.synchronizeToDesign(e, ctx);
+ sp.writeDesign(e, ctx);
assertTrue("There should be no attributes in the node.", e.attributes()
.size() == 0);
assertTrue("There should be no child elements.",
diff --git a/server/tests/src/com/vaadin/tests/server/component/abstracttextfield/TestSynchronizeFromDesign.java b/server/tests/src/com/vaadin/tests/server/component/abstracttextfield/TestReadDesign.java
index f7ba67f506..3b4b6f1f03 100644
--- a/server/tests/src/com/vaadin/tests/server/component/abstracttextfield/TestSynchronizeFromDesign.java
+++ b/server/tests/src/com/vaadin/tests/server/component/abstracttextfield/TestReadDesign.java
@@ -29,7 +29,7 @@ import com.vaadin.ui.declarative.DesignContext;
/**
* Test case for reading the attributes of the AbstractTextField from design
*/
-public class TestSynchronizeFromDesign extends TestCase {
+public class TestReadDesign extends TestCase {
private DesignContext ctx;
@@ -42,7 +42,7 @@ public class TestSynchronizeFromDesign extends TestCase {
public void testAttributes() {
Element design = createDesign();
AbstractTextField component = getComponent();
- component.synchronizeFromDesign(design, ctx);
+ component.readDesign(design, ctx);
assertEquals("this-is-null", component.getNullRepresentation());
assertEquals(true, component.isNullSettingAllowed());
assertEquals(5, component.getMaxLength());
diff --git a/server/tests/src/com/vaadin/tests/server/component/abstracttextfield/TestSynchronizeToDesign.java b/server/tests/src/com/vaadin/tests/server/component/abstracttextfield/TestWriteDesign.java
index b8f29b0ac9..be5c384d3b 100644
--- a/server/tests/src/com/vaadin/tests/server/component/abstracttextfield/TestSynchronizeToDesign.java
+++ b/server/tests/src/com/vaadin/tests/server/component/abstracttextfield/TestWriteDesign.java
@@ -31,7 +31,7 @@ import com.vaadin.ui.declarative.DesignContext;
*
* @author Vaadin Ltd
*/
-public class TestSynchronizeToDesign extends TestCase {
+public class TestWriteDesign extends TestCase {
private DesignContext ctx;
@@ -51,7 +51,7 @@ public class TestSynchronizeToDesign extends TestCase {
component.setInputPrompt("input");
component.setTextChangeEventMode(TextChangeEventMode.EAGER);
component.setTextChangeTimeout(100);
- component.synchronizeToDesign(design, ctx);
+ component.writeDesign(design, ctx);
assertEquals("this-is-null", design.attr("null-representation"));
assertEquals("true", design.attr("null-setting-allowed"));
assertEquals("5", design.attr("maxlength"));
diff --git a/server/tests/src/com/vaadin/tests/server/component/button/TestSynchronizeFromDesign.java b/server/tests/src/com/vaadin/tests/server/component/button/TestReadDesign.java
index 704192fb04..48b228a35a 100644
--- a/server/tests/src/com/vaadin/tests/server/component/button/TestSynchronizeFromDesign.java
+++ b/server/tests/src/com/vaadin/tests/server/component/button/TestReadDesign.java
@@ -37,7 +37,7 @@ import com.vaadin.ui.declarative.DesignContext;
* design.
*
*/
-public class TestSynchronizeFromDesign extends TestCase {
+public class TestReadDesign extends TestCase {
private DesignContext ctx;
diff --git a/server/tests/src/com/vaadin/tests/server/component/button/TestSynchronizeToDesign.java b/server/tests/src/com/vaadin/tests/server/component/button/TestWriteDesign.java
index c96fd36d5d..a8cf83522c 100644
--- a/server/tests/src/com/vaadin/tests/server/component/button/TestSynchronizeToDesign.java
+++ b/server/tests/src/com/vaadin/tests/server/component/button/TestWriteDesign.java
@@ -32,7 +32,7 @@ import com.vaadin.ui.declarative.DesignContext;
* Tests generating html tree nodes corresponding to the contents of a Button
* and a NativeButton.
*/
-public class TestSynchronizeToDesign extends TestCase {
+public class TestWriteDesign extends TestCase {
private DesignContext ctx;
@@ -59,7 +59,7 @@ public class TestSynchronizeToDesign extends TestCase {
button.setIconAlternateText("OK");
button.setClickShortcut(KeyCode.O, ModifierKey.CTRL, ModifierKey.SHIFT);
Element e = new Element(Tag.valueOf("v-button"), "", new Attributes());
- button.synchronizeToDesign(e, ctx);
+ button.writeDesign(e, ctx);
assertEquals("3", e.attr("tabindex"));
assertTrue("Button is plain text by default", e.hasAttr("plain-text"));
assertEquals("OK", e.attr("icon-alt"));
@@ -70,11 +70,11 @@ public class TestSynchronizeToDesign extends TestCase {
public void testUpdateContentMode() {
Button button = new Button("OK");
Element e = new Element(Tag.valueOf("v-button"), "", new Attributes());
- button.synchronizeToDesign(e, ctx);
+ button.writeDesign(e, ctx);
assertTrue("Button is plain text by default", e.hasAttr("plain-text"));
button.setHtmlContentAllowed(true);
- button.synchronizeToDesign(e, ctx);
+ button.writeDesign(e, ctx);
assertTrue("Button is updated to HTML", !e.hasAttr("plain-text"));
}
diff --git a/server/tests/src/com/vaadin/tests/server/component/csslayout/TestSynchronizeFromDesign.java b/server/tests/src/com/vaadin/tests/server/component/csslayout/TestReadDesign.java
index e9694f0170..51f763bf14 100644
--- a/server/tests/src/com/vaadin/tests/server/component/csslayout/TestSynchronizeFromDesign.java
+++ b/server/tests/src/com/vaadin/tests/server/component/csslayout/TestReadDesign.java
@@ -30,7 +30,7 @@ import com.vaadin.ui.declarative.DesignContext;
*
* @author Vaadin Ltd
*/
-public class TestSynchronizeFromDesign extends TestCase {
+public class TestReadDesign extends TestCase {
public void testChildCount() {
CssLayout root = createLayout();
diff --git a/server/tests/src/com/vaadin/tests/server/component/csslayout/TestSynchronizeToDesign.java b/server/tests/src/com/vaadin/tests/server/component/csslayout/TestWriteDesign.java
index 2dfd560c8c..d660eb77ec 100644
--- a/server/tests/src/com/vaadin/tests/server/component/csslayout/TestSynchronizeToDesign.java
+++ b/server/tests/src/com/vaadin/tests/server/component/csslayout/TestWriteDesign.java
@@ -30,13 +30,13 @@ import com.vaadin.ui.declarative.DesignContext;
*
* @author Vaadin Ltd
*/
-public class TestSynchronizeToDesign extends TestCase {
+public class TestWriteDesign extends TestCase {
public void testSynchronizeEmptyLayout() {
CssLayout layout = new CssLayout();
layout.setCaption("changed-caption");
Element design = createDesign();
- layout.synchronizeToDesign(design, createDesignContext());
+ layout.writeDesign(design, createDesignContext());
assertEquals(0, design.childNodes().size());
assertEquals("changed-caption", design.attr("caption"));
}
@@ -47,7 +47,7 @@ public class TestSynchronizeToDesign extends TestCase {
layout.getComponent(0).setCaption("test-caption");
layout.addComponent(new Label("test-label-2"));
Element design = createDesign();
- layout.synchronizeToDesign(design, createDesignContext());
+ layout.writeDesign(design, createDesignContext());
assertEquals(2, design.childNodes().size());
assertEquals("v-label", ((Element) design.childNode(0)).tagName());
assertEquals("test-caption", design.childNode(0).attr("caption"));
diff --git a/server/tests/src/com/vaadin/tests/server/component/label/TestSynchronizeFromDesign.java b/server/tests/src/com/vaadin/tests/server/component/label/TestReadDesign.java
index 168c44cb90..1a02ed98cc 100644
--- a/server/tests/src/com/vaadin/tests/server/component/label/TestSynchronizeFromDesign.java
+++ b/server/tests/src/com/vaadin/tests/server/component/label/TestReadDesign.java
@@ -30,7 +30,7 @@ import com.vaadin.ui.declarative.DesignContext;
* Test case for reading the contents of a Label from a design.
*
*/
-public class TestSynchronizeFromDesign extends TestCase {
+public class TestReadDesign extends TestCase {
private DesignContext ctx;
diff --git a/server/tests/src/com/vaadin/tests/server/component/label/TestSynchronizeToDesign.java b/server/tests/src/com/vaadin/tests/server/component/label/TestWriteDesign.java
index 869546ac3d..fab7c1d8eb 100644
--- a/server/tests/src/com/vaadin/tests/server/component/label/TestSynchronizeToDesign.java
+++ b/server/tests/src/com/vaadin/tests/server/component/label/TestWriteDesign.java
@@ -29,7 +29,7 @@ import com.vaadin.ui.declarative.DesignContext;
/**
* Tests generating an html tree node corresponding to a Label.
*/
-public class TestSynchronizeToDesign extends TestCase {
+public class TestWriteDesign extends TestCase {
private DesignContext ctx;
@@ -63,7 +63,7 @@ public class TestSynchronizeToDesign extends TestCase {
public void testContentModeText() {
Label l = new Label("plain text label");
Element e = new Element(Tag.valueOf("v-label"), "", new Attributes());
- l.synchronizeToDesign(e, ctx);
+ l.writeDesign(e, ctx);
assertTrue("Label should be marked as plain text",
e.hasAttr("plain-text"));
}
@@ -74,7 +74,7 @@ public class TestSynchronizeToDesign extends TestCase {
l.setContentMode(ContentMode.HTML);
Element e = new Element(Tag.valueOf("v-label"), "", new Attributes());
- l.synchronizeToDesign(e, ctx);
+ l.writeDesign(e, ctx);
assertFalse("Label should not be marked as plain text",
e.hasAttr("plain-text"));
}
@@ -85,12 +85,12 @@ public class TestSynchronizeToDesign extends TestCase {
l.setContentMode(ContentMode.HTML);
Element e = new Element(Tag.valueOf("v-label"), "", new Attributes());
- l.synchronizeToDesign(e, ctx);
+ l.writeDesign(e, ctx);
assertFalse("Label should not be marked as plain text",
e.hasAttr("plain-text"));
l.setContentMode(ContentMode.TEXT);
- l.synchronizeToDesign(e, ctx);
+ l.writeDesign(e, ctx);
assertTrue("Label should be marked as plain text",
e.hasAttr("plain-text"));
diff --git a/server/tests/src/com/vaadin/tests/server/component/panel/TestSynchronizeFromDesign.java b/server/tests/src/com/vaadin/tests/server/component/panel/TestReadDesign.java
index bc4a597a4e..3eb52309a8 100644
--- a/server/tests/src/com/vaadin/tests/server/component/panel/TestSynchronizeFromDesign.java
+++ b/server/tests/src/com/vaadin/tests/server/component/panel/TestReadDesign.java
@@ -30,7 +30,7 @@ import com.vaadin.ui.declarative.DesignException;
*
* @author Vaadin Ltd
*/
-public class TestSynchronizeFromDesign extends TestCase {
+public class TestReadDesign extends TestCase {
DesignContext ctx;
@Override
@@ -41,7 +41,7 @@ public class TestSynchronizeFromDesign extends TestCase {
public void testAttributes() {
Element design = createDesign();
Panel panel = new Panel();
- panel.synchronizeFromDesign(design, ctx);
+ panel.readDesign(design, ctx);
assertEquals("A panel", panel.getCaption());
assertEquals(2, panel.getTabIndex());
assertEquals(10, panel.getScrollLeft());
@@ -53,7 +53,7 @@ public class TestSynchronizeFromDesign extends TestCase {
public void testChild() {
Element design = createDesign();
Panel panel = new Panel();
- panel.synchronizeFromDesign(design, ctx);
+ panel.readDesign(design, ctx);
VerticalLayout vLayout = (VerticalLayout) panel.getContent();
assertEquals(300f, vLayout.getWidth());
assertEquals(400f, vLayout.getHeight());
@@ -67,7 +67,7 @@ public class TestSynchronizeFromDesign extends TestCase {
design.appendChild(newChild);
Panel panel = new Panel();
try {
- panel.synchronizeFromDesign(design, ctx);
+ panel.readDesign(design, ctx);
fail("Parsing a design containing a Panel with more than one child component should have failed.");
} catch (DesignException e) {
// Nothing needs to be done, this is the expected case.
diff --git a/server/tests/src/com/vaadin/tests/server/component/panel/TestSynchronizeToDesign.java b/server/tests/src/com/vaadin/tests/server/component/panel/TestWriteDesign.java
index 56ff155612..f81193d511 100644
--- a/server/tests/src/com/vaadin/tests/server/component/panel/TestSynchronizeToDesign.java
+++ b/server/tests/src/com/vaadin/tests/server/component/panel/TestWriteDesign.java
@@ -30,7 +30,7 @@ import com.vaadin.ui.declarative.DesignContext;
*
* @author Vaadin Ltd
*/
-public class TestSynchronizeToDesign extends TestCase {
+public class TestWriteDesign extends TestCase {
Element panelElement;
@Override
@@ -47,7 +47,7 @@ public class TestSynchronizeToDesign extends TestCase {
// synchronize to design
DesignContext ctx = new DesignContext();
panelElement = new Element(Tag.valueOf("div"), "");
- panel.synchronizeToDesign(panelElement, ctx);
+ panel.writeDesign(panelElement, ctx);
}
public void testAttributes() {
diff --git a/server/tests/src/com/vaadin/tests/server/component/tabsheet/TestSynchronizeFromDesign.java b/server/tests/src/com/vaadin/tests/server/component/tabsheet/TestReadDesign.java
index 4c0a2863f0..6a34d6584a 100644
--- a/server/tests/src/com/vaadin/tests/server/component/tabsheet/TestSynchronizeFromDesign.java
+++ b/server/tests/src/com/vaadin/tests/server/component/tabsheet/TestReadDesign.java
@@ -34,7 +34,7 @@ import com.vaadin.ui.declarative.DesignContext;
* @since
* @author Vaadin Ltd
*/
-public class TestSynchronizeFromDesign extends TestCase {
+public class TestReadDesign extends TestCase {
private TabSheet sheet;
@@ -68,8 +68,7 @@ public class TestSynchronizeFromDesign extends TestCase {
public void testSelectedComponent() {
TabSheet tabSheet = new TabSheet();
- tabSheet.synchronizeFromDesign(createFirstTabSelectedDesign(),
- new DesignContext());
+ tabSheet.readDesign(createFirstTabSelectedDesign(), new DesignContext());
assertEquals(tabSheet.getTab(0).getComponent(),
tabSheet.getSelectedTab());
}
@@ -86,7 +85,7 @@ public class TestSynchronizeFromDesign extends TestCase {
tabSheet.addComponent(new Label("tab2"));
DesignContext ctx = new DesignContext();
Element design = createDesign();
- tabSheet.synchronizeFromDesign(design, ctx);
+ tabSheet.readDesign(design, ctx);
return tabSheet;
}
diff --git a/server/tests/src/com/vaadin/tests/server/component/tabsheet/TestSynchronizeToDesign.java b/server/tests/src/com/vaadin/tests/server/component/tabsheet/TestWriteDesign.java
index c33a1da4d7..a46b33e2d6 100644
--- a/server/tests/src/com/vaadin/tests/server/component/tabsheet/TestSynchronizeToDesign.java
+++ b/server/tests/src/com/vaadin/tests/server/component/tabsheet/TestWriteDesign.java
@@ -33,7 +33,7 @@ import com.vaadin.ui.declarative.DesignContext;
* @since
* @author Vaadin Ltd
*/
-public class TestSynchronizeToDesign extends TestCase {
+public class TestWriteDesign extends TestCase {
private TabSheet sheet;
private Element design;
@@ -43,7 +43,7 @@ public class TestSynchronizeToDesign extends TestCase {
super.setUp();
sheet = createTabSheet();
design = createDesign();
- sheet.synchronizeToDesign(design, createDesignContext());
+ sheet.writeDesign(design, createDesignContext());
}
public void testOnlyOneTab() {
diff --git a/server/tests/src/com/vaadin/tests/server/component/textarea/TestSynchronizeFromDesign.java b/server/tests/src/com/vaadin/tests/server/component/textarea/TestReadDesign.java
index 787eac0a03..a31367008a 100644
--- a/server/tests/src/com/vaadin/tests/server/component/textarea/TestSynchronizeFromDesign.java
+++ b/server/tests/src/com/vaadin/tests/server/component/textarea/TestReadDesign.java
@@ -30,7 +30,7 @@ import com.vaadin.ui.declarative.DesignContext;
*
* @author Vaadin Ltd
*/
-public class TestSynchronizeFromDesign extends TestCase {
+public class TestReadDesign extends TestCase {
private DesignContext ctx;
@Override
@@ -42,7 +42,7 @@ public class TestSynchronizeFromDesign extends TestCase {
public void testValue() {
Element design = createDesign();
AbstractTextField component = getComponent();
- component.synchronizeFromDesign(design, ctx);
+ component.readDesign(design, ctx);
assertEquals("test value", component.getValue());
}
diff --git a/server/tests/src/com/vaadin/tests/server/component/textarea/TestSynchronizeToDesign.java b/server/tests/src/com/vaadin/tests/server/component/textarea/TestWriteDesign.java
index a316b02ddc..01b0095fe9 100644
--- a/server/tests/src/com/vaadin/tests/server/component/textarea/TestSynchronizeToDesign.java
+++ b/server/tests/src/com/vaadin/tests/server/component/textarea/TestWriteDesign.java
@@ -30,7 +30,7 @@ import com.vaadin.ui.declarative.DesignContext;
*
* @author Vaadin Ltd
*/
-public class TestSynchronizeToDesign extends TestCase {
+public class TestWriteDesign extends TestCase {
private DesignContext ctx;
@Override
@@ -43,7 +43,7 @@ public class TestSynchronizeToDesign extends TestCase {
Element design = createDesign();
AbstractTextField component = getComponent();
component.setValue("test value");
- component.synchronizeToDesign(design, ctx);
+ component.writeDesign(design, ctx);
assertEquals("test value", design.html());
assertFalse(design.hasAttr("value"));
}
diff --git a/server/tests/src/com/vaadin/tests/server/component/textfield/TestSynchronizeFromDesign.java b/server/tests/src/com/vaadin/tests/server/component/textfield/TestReadDesign.java
index 2df0ab4855..62cb1a53bc 100644
--- a/server/tests/src/com/vaadin/tests/server/component/textfield/TestSynchronizeFromDesign.java
+++ b/server/tests/src/com/vaadin/tests/server/component/textfield/TestReadDesign.java
@@ -30,7 +30,7 @@ import com.vaadin.ui.declarative.DesignContext;
*
* @author Vaadin Ltd
*/
-public class TestSynchronizeFromDesign extends TestCase {
+public class TestReadDesign extends TestCase {
private DesignContext ctx;
@Override
@@ -42,7 +42,7 @@ public class TestSynchronizeFromDesign extends TestCase {
public void testValue() {
Element design = createDesign();
AbstractTextField component = getComponent();
- component.synchronizeFromDesign(design, ctx);
+ component.readDesign(design, ctx);
assertEquals("test value", component.getValue());
}
diff --git a/server/tests/src/com/vaadin/tests/server/component/textfield/TestSynchronizeToDesign.java b/server/tests/src/com/vaadin/tests/server/component/textfield/TestWriteDesign.java
index 58d361e683..479c94f6a8 100644
--- a/server/tests/src/com/vaadin/tests/server/component/textfield/TestSynchronizeToDesign.java
+++ b/server/tests/src/com/vaadin/tests/server/component/textfield/TestWriteDesign.java
@@ -30,7 +30,7 @@ import com.vaadin.ui.declarative.DesignContext;
*
* @author Vaadin Ltd
*/
-public class TestSynchronizeToDesign extends TestCase {
+public class TestWriteDesign extends TestCase {
private DesignContext ctx;
@Override
@@ -43,7 +43,7 @@ public class TestSynchronizeToDesign extends TestCase {
Element design = createDesign();
AbstractTextField component = getComponent();
component.setValue("test value");
- component.synchronizeToDesign(design, ctx);
+ component.writeDesign(design, ctx);
assertEquals("test value", design.attr("value"));
}