summaryrefslogtreecommitdiffstats
path: root/server/src/com/vaadin/ui/Flash.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/Flash.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/Flash.java')
-rw-r--r--server/src/com/vaadin/ui/Flash.java88
1 files changed, 88 insertions, 0 deletions
diff --git a/server/src/com/vaadin/ui/Flash.java b/server/src/com/vaadin/ui/Flash.java
index bbbd4e3285..cd7c00087e 100644
--- a/server/src/com/vaadin/ui/Flash.java
+++ b/server/src/com/vaadin/ui/Flash.java
@@ -15,10 +15,15 @@
*/
package com.vaadin.ui;
+import java.util.Collections;
import java.util.HashMap;
+import java.util.Map;
+
+import org.jsoup.nodes.Element;
import com.vaadin.server.Resource;
import com.vaadin.shared.ui.flash.FlashState;
+import com.vaadin.ui.declarative.DesignContext;
/**
* A component for displaying Adobe® Flash® content.
@@ -89,6 +94,17 @@ public class Flash extends AbstractEmbedded {
}
/**
+ * Returns the codebase.
+ *
+ * @see #setCodebase(String)
+ * @since 7.4
+ * @return Current codebase.
+ */
+ public String getCodebase() {
+ return getState(false).codebase;
+ }
+
+ /**
* This attribute specifies the content type of data expected when
* downloading the object specified by classid. This attribute is optional
* but recommended when classid is specified since it allows the user agent
@@ -107,6 +123,17 @@ public class Flash extends AbstractEmbedded {
}
/**
+ * Returns the current codetype.
+ *
+ * @see #setCodetype(String)
+ * @since 7.4
+ * @return Current codetype.
+ */
+ public String getCodetype() {
+ return getState(false).codetype;
+ }
+
+ /**
* This attribute may be used to specify a space-separated list of URIs for
* archives containing resources relevant to the object, which may include
* the resources specified by the classid and data attributes. Preloading
@@ -126,6 +153,23 @@ public class Flash extends AbstractEmbedded {
}
}
+ /**
+ * Returns current archive.
+ *
+ * @see #setArchive(String)
+ * @since 7.4
+ * @return Current archive.
+ */
+ public String getArchive() {
+ return getState(false).archive;
+ }
+
+ /**
+ * Sets standby.
+ *
+ * @param standby
+ * Standby string.
+ */
public void setStandby(String standby) {
if (standby != getState().standby
|| (standby != null && !standby.equals(getState().standby))) {
@@ -135,6 +179,16 @@ public class Flash extends AbstractEmbedded {
}
/**
+ * Returns standby.
+ *
+ * @since
+ * @return Standby string.
+ */
+ public String getStandby() {
+ return getState(false).standby;
+ }
+
+ /**
* Sets an object parameter. Parameters are optional information, and they
* are passed to the instantiated object. Parameters are are stored as name
* value pairs. This overrides the previous value assigned to this
@@ -179,4 +233,38 @@ public class Flash extends AbstractEmbedded {
requestRepaint();
}
+ @Override
+ public void writeDesign(Element design, DesignContext designContext) {
+ super.writeDesign(design, designContext);
+ for (String param : getParameterNames()) {
+ design.appendElement("parameter").attr("name", param)
+ .attr("value", getParameter(param));
+ }
+ }
+
+ /**
+ * Returns an iterable with declared parameter names.
+ *
+ * @see #setParameter(String, String)
+ * @see #getParameter(String)
+ * @since 7.4
+ * @return An iterable with declared parameter names.
+ */
+ public Iterable<String> getParameterNames() {
+ Map<String, String> map = getState(false).embedParams;
+ if (map == null) {
+ return Collections.emptySet();
+ } else {
+ return Collections.unmodifiableSet(map.keySet());
+ }
+ }
+
+ @Override
+ public void readDesign(Element design, DesignContext designContext) {
+ super.readDesign(design, designContext);
+ for (Element paramElement : design.getElementsByTag("parameter")) {
+ setParameter(paramElement.attr("name"), paramElement.attr("value"));
+ }
+ }
+
}