From ae94bb83cc8ad08224ebfde70261bb488ecbedc6 Mon Sep 17 00:00:00 2001 From: Anna Koskinen Date: Fri, 23 Jul 2021 17:09:10 +0300 Subject: [PATCH] Deprecating Flash component. Also added missing JavaDocs. --- .../java/com/vaadin/client/ui/VFlash.java | 98 +++++++++++++++++++ .../client/ui/flash/FlashConnector.java | 8 ++ server/src/main/java/com/vaadin/ui/Flash.java | 5 +- 3 files changed, 110 insertions(+), 1 deletion(-) diff --git a/client/src/main/java/com/vaadin/client/ui/VFlash.java b/client/src/main/java/com/vaadin/client/ui/VFlash.java index 8ba932ca0ef..72dcec68827 100644 --- a/client/src/main/java/com/vaadin/client/ui/VFlash.java +++ b/client/src/main/java/com/vaadin/client/ui/VFlash.java @@ -21,29 +21,58 @@ import com.google.gwt.user.client.ui.HTML; import com.vaadin.client.WidgetUtil; +/** + * Widget class for the Flash component. + * + * @author Vaadin Ltd + * + * @deprecated No modern browsers support Flash content anymore. + */ +@Deprecated public class VFlash extends HTML { + /** Default classname for this widget. */ public static final String CLASSNAME = "v-flash"; + /** @see #setSource(String) */ protected String source; + /** @see #setAlternateText(String) */ protected String altText; + /** @see #setClassId(String) */ protected String classId; + /** @see #setCodebase(String) */ protected String codebase; + /** @see #setCodetype(String) */ protected String codetype; + /** @see #setStandby(String) */ protected String standby; + /** @see #setArchive(String) */ protected String archive; + /** @see #setEmbedParams(Map) */ protected Map embedParams = new HashMap<>(); + /** Determines whether {@link #rebuildIfNeeded()} does anything. */ protected boolean needsRebuild = false; + /** @see #setWidth(String) */ protected String width; + /** @see #setHeight(String) */ protected String height; private int slotOffsetHeight = -1; private int slotOffsetWidth = -1; + /** + * Default constructor. + */ public VFlash() { setStyleName(CLASSNAME); } + /** + * Set the resource representing the Flash content that should be displayed. + * + * @param source + * the resource URL + */ public void setSource(String source) { if (this.source != source) { this.source = source; @@ -51,6 +80,14 @@ public void setSource(String source) { } } + /** + * Sets this component's alternate text that can be presented instead of the + * component's normal content for accessibility purposes. + * + * @param altText + * a short, human-readable description of this component's + * content + */ public void setAlternateText(String altText) { if (this.altText != altText) { this.altText = altText; @@ -58,6 +95,14 @@ public void setAlternateText(String altText) { } } + /** + * Set the class id that is required for ActiveX to recognize the flash. + * This is a predefined value which ActiveX recognizes and must be the given + * value. + * + * @param classId + * the classId + */ public void setClassId(String classId) { if (this.classId != classId) { this.classId = classId; @@ -65,6 +110,17 @@ public void setClassId(String classId) { } } + /** + * This attribute specifies the base path used to resolve relative URIs + * specified by the classid, data, and archive attributes. The default value + * is the base URI of the current document. + * + * @param codebase + * The base path + * + * @see #setClassId(String) + * @see #setArchive(String) + */ public void setCodebase(String codebase) { if (this.codebase != codebase) { this.codebase = codebase; @@ -72,6 +128,16 @@ public void setCodebase(String 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 + * to avoid loading information for unsupported content types. The default + * value is the value of the type attribute. + * + * @param codetype + * the codetype to set. + */ public void setCodetype(String codetype) { if (this.codetype != codetype) { this.codetype = codetype; @@ -79,6 +145,12 @@ public void setCodetype(String codetype) { } } + /** + * Sets standby. + * + * @param standby + * the standby text + */ public void setStandby(String standby) { if (this.standby != standby) { this.standby = standby; @@ -86,6 +158,18 @@ public void setStandby(String standby) { } } + /** + * 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 + * archives will generally result in reduced load times for objects. + * Archives specified as relative URIs should be interpreted relative to the + * codebase attribute. + * + * @param archive + * Space-separated list of URIs with resources relevant to the + * object + */ public void setArchive(String archive) { if (this.archive != archive) { this.archive = archive; @@ -122,6 +206,15 @@ public void setHeight(String height) { } } + /** + * Sets the map of object parameters. Parameters are optional information, + * and they are passed to the instantiated object. Parameters are are stored + * as name value pairs. Calling this method for a second time overrides the + * previously given map. + * + * @param params + * the parameter map + */ public void setEmbedParams(Map params) { if (params == null) { if (!embedParams.isEmpty()) { @@ -159,6 +252,11 @@ public void setSlotHeightAndWidth(int slotOffsetHeight, } + /** + * Creates the embed String. + * + * @return the embed String + */ protected String createFlashEmbed() { /* * To ensure cross-browser compatibility we are using the twice-cooked diff --git a/client/src/main/java/com/vaadin/client/ui/flash/FlashConnector.java b/client/src/main/java/com/vaadin/client/ui/flash/FlashConnector.java index 5b9b8141581..fbdaf47eed9 100644 --- a/client/src/main/java/com/vaadin/client/ui/flash/FlashConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/flash/FlashConnector.java @@ -24,6 +24,14 @@ import com.vaadin.shared.ui.Connect; import com.vaadin.shared.ui.flash.FlashState; +/** + * A connector class for the Flash component. + * + * @author Vaadin Ltd + * + * @deprecated No modern browsers support Flash content anymore. + */ +@Deprecated @Connect(com.vaadin.ui.Flash.class) public class FlashConnector extends AbstractComponentConnector { diff --git a/server/src/main/java/com/vaadin/ui/Flash.java b/server/src/main/java/com/vaadin/ui/Flash.java index 9f102a6d49b..1b7df012381 100644 --- a/server/src/main/java/com/vaadin/ui/Flash.java +++ b/server/src/main/java/com/vaadin/ui/Flash.java @@ -32,8 +32,9 @@ * * @author Vaadin Ltd. * @since 7.0 + * @deprecated No modern browsers support Flash content anymore. */ -@SuppressWarnings("serial") +@Deprecated public class Flash extends AbstractEmbedded { /** @@ -212,6 +213,8 @@ public void setParameter(String name, String value) { * information, and they are passed to the instantiated object. Parameters * are are stored as name value pairs. * + * @param name + * name of the parameter * @return the Value of parameter or null if not found. */ public String getParameter(String name) {