Class WFlashObject
This class loads a .swf Flash file in the browser.
Flash objects must have their size set, so do not forget to call resize()
after instantiation or your content
will be invisible. JWt will modify width and height attributes of the Flash object if resize()
is called after the object is
instantiated; it is however not clear if this is permitted by the Flash plugin.
Any WWidget
can be set with setAlternativeContent()
, and this widget will be shown only when the browser has no
Flash support. By default, a 'Download Flash' button will be displayed that links to a
website where the Flash player can be downloaded. You may modify this to be any widget, such as a
WImage
, or a native JWt implementation of the Flash movie.
CSS
Styling through CSS is not applicable.
-
Nested Class Summary
Nested classes/interfaces inherited from class eu.webtoolkit.jwt.WObject
WObject.FormData
-
Constructor Summary
ConstructorDescriptionWFlashObject
(String url) Constructs a Flash widget.WFlashObject
(String url, WContainerWidget parentContainer) Constructs a Flash widget. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
getDomChanges
(List<DomElement> result, WApplication app) Get DOM changes for this widget.A JavaScript expression that returns the DOM node of the Flash object.void
remove()
Destructor.void
Resizes the widget.void
setAlternativeContent
(WWidget alternative) Sets content to be displayed if Flash is not available.void
setFlashParameter
(String name, CharSequence value) Sets a Flash parameter.void
setFlashVariable
(String name, CharSequence value) Sets a Flash variable.Methods inherited from class eu.webtoolkit.jwt.WWebWidget
addStyleClass, beingDeleted, blurred, callJavaScriptMember, childrenChanged, createDomElement, doJavaScript, enableAjax, escapeText, escapeText, escapeText, escapeText, find, findById, focussed, getAttributeValue, getBaseZIndex, getChildren, getClearSides, getDecorationStyle, getFloatSide, getHeight, getHtmlTagName, getId, getJavaScriptMember, getLineHeight, getMargin, getMaximumHeight, getMaximumWidth, getMinimumHeight, getMinimumWidth, getOffset, getPositionScheme, getScrollVisibilityMargin, getStyleClass, getTabIndex, getToolTip, getVerticalAlignment, getVerticalAlignmentLength, getWidth, hasFocus, hasStyleClass, isCanReceiveFocus, isDisabled, isEnabled, isHidden, isHiddenKeepsGeometry, isInline, isLoaded, isPopup, isRendered, isScrollVisibilityEnabled, isScrollVisible, isSetFirstFocus, isThemeStyleEnabled, isVisible, iterateChildren, jsStringLiteral, jsStringLiteral, load, manageWidget, parentResized, parentResized, propagateSetEnabled, propagateSetVisible, refresh, removeScript, removeStyleClass, render, scrollVisibilityChanged, setAttributeValue, setBaseZIndex, setCanReceiveFocus, setClearSides, setDecorationStyle, setDeferredToolTip, setDisabled, setFlexBox, setFloatSide, setFocus, setHidden, setHiddenKeepsGeometry, setHtmlTagName, setId, setInline, setJavaScriptMember, setLineHeight, setLoadLaterWhenInvisible, setMargin, setMaximumSize, setMinimumSize, setObjectName, setOffsets, setParentWidget, setPopup, setPositionScheme, setScrollVisibilityEnabled, setScrollVisibilityMargin, setSelectable, setStyleClass, setTabIndex, setThemeStyleEnabled, setToolTip, setVerticalAlignment, unescapeText, updateSignalConnection, voidEventSignal, widgetAdded, widgetRemoved
Methods inherited from class eu.webtoolkit.jwt.WWidget
acceptDrops, acceptDrops, addCssRule, addCssRule, addJSignal, addStyleClass, animateHide, animateShow, boxBorder, boxPadding, createJavaScript, disable, dropEvent, enable, getDropTouch, getJsRef, getParent, hide, htmlText, isExposed, isGlobalWidget, isLayoutSizeAware, layoutSizeChanged, needsRerender, positionAt, positionAt, removeFromParent, removeStyleClass, removeWidget, render, resize, scheduleRender, scheduleRender, scheduleRender, setClearSides, setDeferredToolTip, setFocus, setHeight, setHidden, setLayoutSizeAware, setMargin, setMargin, setMargin, setMargin, setMargin, setOffsets, setOffsets, setOffsets, setOffsets, setOffsets, setToolTip, setVerticalAlignment, setWidth, show, stopAcceptDrops, toggleStyleClass, toggleStyleClass, tr
Methods inherited from class eu.webtoolkit.jwt.WObject
getObjectName, setFormData
-
Constructor Details
-
WFlashObject
Constructs a Flash widget. -
WFlashObject
Constructs a Flash widget.
-
-
Method Details
-
remove
public void remove()Destructor.The Flash object is removed.
- Overrides:
remove
in classWWebWidget
- See Also:
-
resize
Description copied from class:WWidget
Resizes the widget.Specifies a fixed size for this widget, setting CSS
width
andheight
properties. By default a widget has automatic width and height, which sets a size for the widget following CSS rules.When the widget is not managed by a layout manager, the automatic (natural) size of a widget depends on whether they widget is a block or inline widget:
- a block widget takes by default the width of the parent, and the height that it needs based on its contents
- an inline widget takes the width and height that it needs based on its contents (possibly wrapping over multiple lines). The width and height of an inline widget cannot be changed (by the letter of CSS, although most browsers will react to it in varying ways).
When inserted in a layout manager, the size set will be used as a widget's preferred size, but the widget may be given a different size by the layout manager based on available space and stretch factors. The actual size given by a layout manager may be retrieved by making the widget "layout size aware", using
setLayoutSizeAware()
. If you have defined a"wtResize()"
JavaScript method for the widget, then this method will also be called.The default width and height of a widget is
WLength.Auto
.- Overrides:
resize
in classWWebWidget
- See Also:
-
setFlashParameter
Sets a Flash parameter.The Flash parameters are items such as quality, scale, menu, ... They are passed as PARAM objects to the Flash movie. See the adobe website for more information about these parameters: http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_12701
Setting the same Flash parameter a second time will overwrite the previous value. Flash parameters can only be set before the widget is rendered for the first time, so it is recommended to call this method shortly after construction before returning to the idle loop.
-
setFlashVariable
Sets a Flash variable.This method is a helper function to set variable values in the flashvars parameter.
The flash variables will be properly encoded (URL encoding) before being passed to the flashvars parameter.
Setting the same Flash variable a second time will overwrite the previous value. Flash variables can only be set before the widget is rendered for the first time, so it is recommended to call this method shortly after construction before returning to the idle loop.
-
getJsFlashRef
A JavaScript expression that returns the DOM node of the Flash object.The Flash object is not stored in
WWidget.getJsRef()
, but ingetJsFlashRef()
. Use this method in conjuction withWApplication#doJavaScript()
orJSlot
in custom JavaScript code to refer to the Flash content.The expression returned by
getJsFlashRef()
may be null, for example on IE when flash is not installed. -
setAlternativeContent
Sets content to be displayed if Flash is not available.Any widget can be a placeholder when Flash is not installed in the users browser. By default, this will show a 'Download Flash' button and link to the Flash download site.
Call this method with a NULL pointer to remove the alternative content.
-
getDomChanges
Description copied from class:WWebWidget
Get DOM changes for this widget.This is an internal function, and should not be called directly, or be overridden!
- Overrides:
getDomChanges
in classWWebWidget
-