|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.Widget
com.google.gwt.user.client.ui.Composite
com.bramosystems.oss.player.core.client.ui.SWFWidget
public class SWFWidget
Widget to embed a generic Shockwave Flash application.
SimplePanel panel = new SimplePanel(); // create panel to hold the widget
Widget swf = null;
try {
// create the player
swf = new SWFWidget("www.example.com/mediafile.swf", "250px", "200px",
PluginVersion.get(8, 0, 0));
swf.addProperty("allowScriptAccess", "true"); // Note: add SWF property before adding object to panel.
swf.addProperty("flashVars", "param1=value1¶m2=value2");
} catch(PluginVersionException e) {
// catch plugin version exception and alert user to download plugin first.
// An option is to use the utility method -
getMissingPluginNotice(String, String, boolean)
swf = SWFWidget.getMissingPluginNotice("Missing Plugin",
".. some nice message telling the user to click and download plugin first ..",
false);
} catch(PluginNotFoundException e) {
// catch PluginNotFoundException and tell user to download plugin, possibly providing
// a link to the plugin download page.
swf = new HTML(".. another kind of message telling the user to download plugin..");
}
panel.setWidget(swf); // add object to panel.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject |
---|
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled |
Field Summary |
---|
Fields inherited from class com.google.gwt.user.client.ui.UIObject |
---|
DEBUG_ID_PREFIX |
Constructor Summary | |
---|---|
SWFWidget(String sourceURL,
String width,
String height,
PluginVersion minFlashVersion)
Constructs SWFWidget with the specified height and
width to embed Flash application located at sourceURL if the client
has a Flash plugin of version minFlashVersion or later installed. |
Method Summary | |
---|---|
void |
addProperty(String name,
String value)
Adds the property name with value value to the properties list of the
Flash object. |
String |
getId()
Returns the ID of this object. |
static com.google.gwt.user.client.ui.Widget |
getMissingPluginNotice(PluginVersion version)
Convenience method to get a widget that may be used to notify the user when the required Flash plugin is not available. |
static com.google.gwt.user.client.ui.Widget |
getMissingPluginNotice(String title,
String message,
boolean asHTML)
Returns a widget that may be used to notify the user when the required Flash plugin is not available. |
protected void |
onLoad()
|
Methods inherited from class com.google.gwt.user.client.ui.Composite |
---|
getWidget, initWidget, isAttached, onAttach, onBrowserEvent, onDetach, setWidget |
Methods inherited from class com.google.gwt.user.client.ui.Widget |
---|
addAttachHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, onUnload, removeFromParent, setLayoutData, sinkEvents |
Methods inherited from class com.google.gwt.user.client.ui.UIObject |
---|
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, toString, unsinkEvents |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SWFWidget(String sourceURL, String width, String height, PluginVersion minFlashVersion) throws PluginNotFoundException, PluginVersionException
SWFWidget
with the specified height
and
width
to embed Flash application located at sourceURL
if the client
has a Flash plugin of version minFlashVersion
or later installed.
height
and width
are specified as CSS units.
sourceURL
- the URL of the media to playbackheight
- the height of the playerwidth
- the width of the player.minFlashVersion
- minimum version of the required Flash plugin
PluginVersionException
- if the required Flash plugin version is not installed on the client.
PluginNotFoundException
- if the Flash plugin is not installed on the client.
NullPointerException
- if sourceURL
, height
or width
is null.PluginVersion
Method Detail |
---|
public void addProperty(String name, String value)
name
with value value
to the properties list of the
Flash object.
Adding a property more than once removes previous values and only the last value is used. Also adding a null or empty value for a named property removes the property from the list if it has been added before.
The following properties are included by default and should not be used with this method:
Note: For all named properties to take effect, this method should be called before adding this widget to a panel.
name
- property namevalue
- property valueprotected void onLoad()
onLoad
in class com.google.gwt.user.client.ui.Widget
public String getId()
id
and name
attributes of the generated object and
embed tags.
public static com.google.gwt.user.client.ui.Widget getMissingPluginNotice(String title, String message, boolean asHTML)
title
- the title of the messagemessage
- descriptive message to notify user about the missing pluginasHTML
- true
if message
should be interpreted as HTML,
false
otherwise.
PlayerUtil.getMissingPluginNotice(Plugin, String, String, boolean)
public static com.google.gwt.user.client.ui.Widget getMissingPluginNotice(PluginVersion version)
This is same as calling getMissingPluginNotice("Missing Plugin",
"Adobe Flash Player [version] or later is required. Click here to get Flash", false)
version
- the required Flash version
getMissingPluginNotice(String, String, boolean)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |