diff options
author | Johannes Dahlström <johannesd@vaadin.com> | 2012-09-11 10:52:56 +0300 |
---|---|---|
committer | Johannes Dahlström <johannesd@vaadin.com> | 2012-09-11 10:52:56 +0300 |
commit | c0b98ed77842f505f3a2f424c5d049a3c0c970cb (patch) | |
tree | 437ea7120571b63da92745a72efeb8e3562a5750 /server/src/com | |
parent | 52331e0db4d3898c09369c2a797c38c8de544c11 (diff) | |
download | vaadin-framework-c0b98ed77842f505f3a2f424c5d049a3c0c970cb.tar.gz vaadin-framework-c0b98ed77842f505f3a2f424c5d049a3c0c970cb.zip |
Improvements to #9087:
* Rename EmbeddedBrowser to BrowserFrame
* Add constructors to Flash and BrowserFrame
* Change getState() methods to protected
* JavaDoc improvements
* Make ImageClicks test deterministic
Diffstat (limited to 'server/src/com')
-rw-r--r-- | server/src/com/vaadin/ui/AbstractEmbedded.java | 2 | ||||
-rw-r--r-- | server/src/com/vaadin/ui/BrowserFrame.java | 51 | ||||
-rw-r--r-- | server/src/com/vaadin/ui/Embedded.java | 13 | ||||
-rw-r--r-- | server/src/com/vaadin/ui/EmbeddedBrowser.java | 19 | ||||
-rw-r--r-- | server/src/com/vaadin/ui/Flash.java | 36 | ||||
-rw-r--r-- | server/src/com/vaadin/ui/Image.java | 2 |
6 files changed, 96 insertions, 27 deletions
diff --git a/server/src/com/vaadin/ui/AbstractEmbedded.java b/server/src/com/vaadin/ui/AbstractEmbedded.java index 5c72141ef9..7dcf7ca091 100644 --- a/server/src/com/vaadin/ui/AbstractEmbedded.java +++ b/server/src/com/vaadin/ui/AbstractEmbedded.java @@ -19,7 +19,7 @@ import com.vaadin.shared.ui.AbstractEmbeddedState; public abstract class AbstractEmbedded extends AbstractComponent { @Override - public AbstractEmbeddedState getState() { + protected AbstractEmbeddedState getState() { return (AbstractEmbeddedState) super.getState(); } diff --git a/server/src/com/vaadin/ui/BrowserFrame.java b/server/src/com/vaadin/ui/BrowserFrame.java new file mode 100644 index 0000000000..e79e03c2dd --- /dev/null +++ b/server/src/com/vaadin/ui/BrowserFrame.java @@ -0,0 +1,51 @@ +package com.vaadin.ui; + +import com.vaadin.server.Resource; +import com.vaadin.shared.ui.browserframe.BrowserFrameState; + +/** + * A component displaying an embedded web page. Implemented as a HTML + * <code>iframe</code> element. + * + * @author Vaadin Ltd. + * @version + * @VERSION@ + * @since 7.0 + */ +public class BrowserFrame extends AbstractEmbedded { + + /** + * Creates a new empty browser frame. + */ + public BrowserFrame() { + + } + + /** + * Creates a new empty browser frame with the given caption. + * + * @param caption + * The caption for the component + */ + public BrowserFrame(String caption) { + setCaption(caption); + } + + /** + * Creates a new browser frame with the given caption and content. + * + * @param caption + * The caption for the component. + * @param source + * A Resource representing the Web page that should be displayed. + */ + public BrowserFrame(String caption, Resource source) { + this(caption); + setSource(source); + } + + @Override + protected BrowserFrameState getState() { + return (BrowserFrameState) super.getState(); + } +} diff --git a/server/src/com/vaadin/ui/Embedded.java b/server/src/com/vaadin/ui/Embedded.java index 3bcd7a26a0..d61fd44292 100644 --- a/server/src/com/vaadin/ui/Embedded.java +++ b/server/src/com/vaadin/ui/Embedded.java @@ -34,9 +34,14 @@ import com.vaadin.shared.ui.embedded.EmbeddedServerRpc; /** * Component for embedding external objects. * <p> - * As of Vaadin 7.0, the {@link Image}, {@link Flash}, and - * {@link EmbeddedBrowser} components should be used instead of - * <code>Embedded</code> whenever appropriate. + * As of Vaadin 7.0, the {@link Image}, {@link Flash}, and {@link BrowserFrame} + * components should be used instead of <code>Embedded</code> for displaying + * images, Adobe Flash objects, and embedded web pages, respectively. + * <code>Embedded</code> is still useful for displaying other multimedia content + * such as applets and PDF documents. + * + * @see Video + * @see Audio * * @author Vaadin Ltd. * @since 3.0 @@ -60,7 +65,7 @@ public class Embedded extends AbstractComponent implements LegacyComponent { /** * Browser ("iframe") type. * - * @deprecated As of 7.0, use the {@link EmbeddedBrowser} component instead. + * @deprecated As of 7.0, use the {@link BrowserFrame} component instead. */ @Deprecated public static final int TYPE_BROWSER = 2; diff --git a/server/src/com/vaadin/ui/EmbeddedBrowser.java b/server/src/com/vaadin/ui/EmbeddedBrowser.java deleted file mode 100644 index 4e2ae18de8..0000000000 --- a/server/src/com/vaadin/ui/EmbeddedBrowser.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.vaadin.ui; - -import com.vaadin.shared.ui.embeddedbrowser.EmbeddedBrowserState; - -/** - * Component for embedding browser "iframe". - * - * @author Vaadin Ltd. - * @version - * @VERSION@ - * @since 7.0 - */ -public class EmbeddedBrowser extends AbstractEmbedded { - - @Override - public EmbeddedBrowserState getState() { - return (EmbeddedBrowserState) super.getState(); - } -} diff --git a/server/src/com/vaadin/ui/Flash.java b/server/src/com/vaadin/ui/Flash.java index 430018289a..726b6c21c4 100644 --- a/server/src/com/vaadin/ui/Flash.java +++ b/server/src/com/vaadin/ui/Flash.java @@ -6,10 +6,11 @@ package com.vaadin.ui; import java.util.HashMap; +import com.vaadin.server.Resource; import com.vaadin.shared.ui.flash.FlashState; /** - * Component for embedding flash objects. + * A component for displaying Adobe® Flash® content. * * @author Vaadin Ltd. * @version @@ -19,8 +20,39 @@ import com.vaadin.shared.ui.flash.FlashState; @SuppressWarnings("serial") public class Flash extends AbstractEmbedded { + /** + * Creates a new empty Flash component. + */ + public Flash() { + + } + + /** + * Creates a new empty Flash component with the given caption + * + * @param caption + * The caption for the component + */ + public Flash(String caption) { + setCaption(caption); + } + + /** + * Creates a new Flash component with the given caption and content. + * + * @param caption + * The caption for the component + * @param source + * A Resource representing the Flash content that should be + * displayed + */ + public Flash(String caption, Resource source) { + this(caption); + setSource(source); + } + @Override - public FlashState getState() { + protected FlashState getState() { return (FlashState) super.getState(); } diff --git a/server/src/com/vaadin/ui/Image.java b/server/src/com/vaadin/ui/Image.java index 178e557cf3..c1b27704d4 100644 --- a/server/src/com/vaadin/ui/Image.java +++ b/server/src/com/vaadin/ui/Image.java @@ -61,7 +61,7 @@ public class Image extends AbstractEmbedded { } @Override - public ImageState getState() { + protected ImageState getState() { return (ImageState) super.getState(); } |