summaryrefslogtreecommitdiffstats
path: root/server/src/com/vaadin/ui/AbstractEmbedded.java
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2015-02-09 20:56:05 +0200
committerVaadin Code Review <review@vaadin.com>2015-02-10 10:28:06 +0000
commit3938383b767093cee55b2538783665ef3847d8ef (patch)
tree582c967dfbfc537d6a86700d07ab48a9e04608bd /server/src/com/vaadin/ui/AbstractEmbedded.java
parenteaad0231eefba8a65130f97fc6651fddcc1d4274 (diff)
downloadvaadin-framework-3938383b767093cee55b2538783665ef3847d8ef.tar.gz
vaadin-framework-3938383b767093cee55b2538783665ef3847d8ef.zip
Declarative support for Image, Flash, BrowserFrame (#15551,#16327,#15552,#16325)
Change-Id: Icef0b3c4e652421265714c4fd29dee150bcc8cd0
Diffstat (limited to 'server/src/com/vaadin/ui/AbstractEmbedded.java')
-rw-r--r--server/src/com/vaadin/ui/AbstractEmbedded.java29
1 files changed, 29 insertions, 0 deletions
diff --git a/server/src/com/vaadin/ui/AbstractEmbedded.java b/server/src/com/vaadin/ui/AbstractEmbedded.java
index 66752aa5d7..d004ca7635 100644
--- a/server/src/com/vaadin/ui/AbstractEmbedded.java
+++ b/server/src/com/vaadin/ui/AbstractEmbedded.java
@@ -15,8 +15,14 @@
*/
package com.vaadin.ui;
+import java.util.Collection;
+
+import org.jsoup.nodes.Element;
+
import com.vaadin.server.Resource;
import com.vaadin.shared.ui.AbstractEmbeddedState;
+import com.vaadin.ui.declarative.DesignAttributeHandler;
+import com.vaadin.ui.declarative.DesignContext;
/**
* Abstract base for embedding components.
@@ -81,4 +87,27 @@ public abstract class AbstractEmbedded extends AbstractComponent {
return getState(false).alternateText;
}
+ @Override
+ public void readDesign(Element design, DesignContext designContext) {
+ super.readDesign(design, designContext);
+ if (design.hasAttr("alt")) {
+ setAlternateText(DesignAttributeHandler.readAttribute("alt",
+ design.attributes(), String.class));
+ }
+ }
+
+ @Override
+ public void writeDesign(Element design, DesignContext designContext) {
+ super.writeDesign(design, designContext);
+ AbstractEmbedded def = designContext.getDefaultInstance(this);
+ DesignAttributeHandler.writeAttribute("alt", design.attributes(),
+ getAlternateText(), def.getAlternateText(), String.class);
+ }
+
+ @Override
+ protected Collection<String> getCustomAttributes() {
+ Collection<String> c = super.getCustomAttributes();
+ c.add("alternate-text");
+ return c;
+ }
}