/** Sets the content directly. * Default: null. * * <p>Calling this method implies setSrc(null). * In other words, the last invocation of {@link #setContent} overrides * the previous {@link #setSrc}, if any. * @param media the media for this inline frame. * @see #setSrc */ public void setContent(Media media) { if (_src != null || media != _media) { _media = RepeatableMedia.getInstance(media); //Use RepeatableMedia since it might be reloaded //if the component is invalidated or overlapped wnd (Bug 1896797) _src = null; if (_media != null) ++_medver; //enforce browser to reload smartUpdate("src", new EncodedSrc()); //Bug 1850895 } }
/** * Returns a repeatable media with a repeatable input stream or * reader, or null if the given media is null. */ public static Media getInstance(Media media) { if (media != null && !media.inMemory() && !(media instanceof RepeatableMedia)) { if (media.isBinary()) { final InputStream data = media.getStreamData(), after = RepeatableInputStream.getInstance(data); if (data != after) return new RepeatableMedia(media, after); } else { final Reader data = media.getReaderData(), after = RepeatableReader.getInstance(data); if (data != after) return new RepeatableMedia(media, after); } } return media; }
/** Sets the content of the flash directly. * Default: null. * * <p>Calling this method implies setSrc(null). * In other words, the last invocation of {@link #setContent} overrides * the previous {@link #setSrc}, if any. * @param media the media representing the flash, i.e., SWF. * @see #setSrc * @since 3.6.1 */ public void setContent(Media media) { if (_src != null || media != _media) { _media = RepeatableMedia.getInstance(media); //Use RepeatableMedia since it might be reloaded //if the component is in an overlapped wnd (Bug 1896797) _src = null; if (_media != null) ++_medver; //enforce browser to reload smartUpdate("src", new EncodedSrc()); } }