diff options
author | Matti Hosio <mhosio@vaadin.com> | 2014-12-12 13:04:31 +0200 |
---|---|---|
committer | Matti Hosio <mhosio@vaadin.com> | 2014-12-12 16:18:20 +0200 |
commit | a025d511bfe4e81993d33fc424a9bed754586a52 (patch) | |
tree | 46598f43edf5182fc0f867edc2fbcd01e50ecaea /server/src/com/vaadin/ui/Component.java | |
parent | c4aab1fe917b3cae5a41c8acc1e7cbea07700106 (diff) | |
download | vaadin-framework-a025d511bfe4e81993d33fc424a9bed754586a52.tar.gz vaadin-framework-a025d511bfe4e81993d33fc424a9bed754586a52.zip |
Embed DesignSynchronizable methods to Component interface (#7749)
Change-Id: I06de4d2065dee107da40c2a4941e7d9e22f0832b
Diffstat (limited to 'server/src/com/vaadin/ui/Component.java')
-rw-r--r-- | server/src/com/vaadin/ui/Component.java | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/server/src/com/vaadin/ui/Component.java b/server/src/com/vaadin/ui/Component.java index e10b5e1cd9..024c3eb433 100644 --- a/server/src/com/vaadin/ui/Component.java +++ b/server/src/com/vaadin/ui/Component.java @@ -19,6 +19,8 @@ package com.vaadin.ui; import java.io.Serializable; import java.util.Locale; +import org.jsoup.nodes.Element; + import com.vaadin.event.ConnectorEvent; import com.vaadin.event.ConnectorEventListener; import com.vaadin.event.FieldEvents; @@ -27,6 +29,7 @@ import com.vaadin.server.ErrorMessage; import com.vaadin.server.Resource; import com.vaadin.server.Sizeable; import com.vaadin.server.VariableOwner; +import com.vaadin.ui.declarative.DesignContext; /** * {@code Component} is the top-level interface that is and must be implemented @@ -726,6 +729,40 @@ public interface Component extends ClientConnector, Sizeable, Serializable { */ public String getDescription(); + /* Declarative support */ + + /** + * Update the component state based on the given design. The component is + * responsible not only for updating itself but also ensuring that its + * children update their state based on the design. + * <p> + * This method must not modify the design. + * + * @since 7.4 + * @param design + * The design as HTML to obtain the state from + * @param designContext + * The DesignContext instance used for parsing the design + */ + public void synchronizeFromDesign(Element design, + DesignContext designContext); + + /** + * Update the given design based on the component state. The component is + * responsible not only for updating itself but also for ensuring its + * children update themselves in the correct position in the design. The + * caller of this method should not assume that contents of the + * <code>design</code> parameter are presented. + * <p> + * This method must not modify the component state. + * + * @since 7.4 + * @param design + * The design as HTML to update with the current state + * @param designContext + */ + public void synchronizeToDesign(Element design, DesignContext designContext); + /* Component event framework */ /** |