|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.vaadin.server.AbstractClientConnector
com.vaadin.ui.AbstractComponent
com.vaadin.ui.AbstractMedia
public abstract class AbstractMedia
Abstract base class for the HTML5 media components.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface com.vaadin.ui.Component |
---|
Component.ErrorEvent, Component.Event, Component.Focusable, Component.Listener |
Nested classes/interfaces inherited from interface com.vaadin.server.ClientConnector |
---|
ClientConnector.AttachEvent, ClientConnector.AttachListener, ClientConnector.ConnectorErrorEvent, ClientConnector.DetachEvent, ClientConnector.DetachListener |
Nested classes/interfaces inherited from interface com.vaadin.server.Sizeable |
---|
Sizeable.Unit |
Field Summary |
---|
Fields inherited from class com.vaadin.ui.AbstractComponent |
---|
DESIGN_ATTR_PLAIN_TEXT |
Fields inherited from interface com.vaadin.server.Sizeable |
---|
SIZE_UNDEFINED, UNITS_CM, UNITS_EM, UNITS_EX, UNITS_INCH, UNITS_MM, UNITS_PERCENTAGE, UNITS_PICAS, UNITS_PIXELS, UNITS_POINTS |
Constructor Summary | |
---|---|
AbstractMedia()
|
Method Summary | |
---|---|
void |
addSource(Resource source)
Adds an alternative media file to the sources list. |
java.lang.String |
getAltText()
|
protected java.util.Collection<java.lang.String> |
getCustomAttributes()
Returns a collection of attributes that should not be handled by the basic implementation of the readDesign and writeDesign
methods. |
java.util.List<Resource> |
getSources()
|
protected com.vaadin.shared.ui.AbstractMediaState |
getState()
Returns the shared state bean with information to be sent from the server to the client. |
protected com.vaadin.shared.ui.AbstractMediaState |
getState(boolean markAsDirty)
Returns the shared state for this connector. |
boolean |
handleConnectorRequest(VaadinRequest request,
VaadinResponse response,
java.lang.String path)
Handle a request directed to this connector. |
boolean |
isAutoplay()
|
boolean |
isHtmlContentAllowed()
|
boolean |
isMuted()
|
boolean |
isShowControls()
|
void |
pause()
Pauses the media. |
void |
play()
Starts playback of the media. |
void |
readDesign(org.jsoup.nodes.Element design,
DesignContext designContext)
Reads the component state from the given design. |
void |
setAltText(java.lang.String altText)
Sets the alternative text to be displayed if the browser does not support HTML5. |
void |
setAutoplay(boolean autoplay)
Sets whether the media is to automatically start playback when enough data has been loaded. |
void |
setHtmlContentAllowed(boolean htmlContentAllowed)
Set whether the alternative text ( setAltText(String) ) is
rendered as HTML or not. |
void |
setMuted(boolean muted)
Set whether to mute the audio or not. |
void |
setShowControls(boolean showControls)
Sets whether or not the browser should show native media controls. |
void |
setSource(Resource source)
Sets a single media file as the source of the media component. |
void |
setSources(Resource... sources)
Set multiple sources at once. |
void |
writeDesign(org.jsoup.nodes.Element design,
DesignContext designContext)
Writes the component state to the given design. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.vaadin.ui.Component |
---|
getUI |
Methods inherited from interface com.vaadin.server.ClientConnector |
---|
addAttachListener, addDetachListener, encodeState, getErrorHandler, getExtensions, getRpcManager, getStateType, isAttached, markAsDirty, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler |
Methods inherited from interface com.vaadin.shared.Connector |
---|
getConnectorId |
Constructor Detail |
---|
public AbstractMedia()
Method Detail |
---|
protected com.vaadin.shared.ui.AbstractMediaState getState()
AbstractComponent
getState
in class AbstractComponent
protected com.vaadin.shared.ui.AbstractMediaState getState(boolean markAsDirty)
AbstractClientConnector
getState
in class AbstractComponent
markAsDirty
- true if the connector should automatically be marked dirty,
false otherwise
AbstractClientConnector.getState()
public void setSource(Resource source)
source
- public void addSource(Resource source)
source
- public boolean handleConnectorRequest(VaadinRequest request, VaadinResponse response, java.lang.String path) throws java.io.IOException
ClientConnector
ConnectorResource
s.
Requests to /APP/connector/[ui id]/[connector id]/
are
routed to this method with the remaining part of the requested path
available in the path parameter.
NOTE that the session is not locked when this method is called. It is the responsibility of the connector to ensure that the session is locked while handling state or other session related data. For best performance the session should be unlocked before writing a large response to the client.
handleConnectorRequest
in interface ClientConnector
handleConnectorRequest
in class AbstractClientConnector
request
- the request that should be handledresponse
- the response object to which the response should be writtenpath
- the requested relative path
true
if the request has been handled,
false
if no response has been written.
java.io.IOException
- if there is a problem generating a response.public void setSources(Resource... sources)
sources
- public java.util.List<Resource> getSources()
public void setShowControls(boolean showControls)
showControls
- public boolean isShowControls()
public void setAltText(java.lang.String altText)
setHtmlContentAllowed(boolean)
is set to true. With HTML
rendering, this method can also be used to implement fallback to a
flash-based player, see the Mozilla Developer Network for details.
altText
- public java.lang.String getAltText()
public void setHtmlContentAllowed(boolean htmlContentAllowed)
setAltText(String)
) is
rendered as HTML or not.
htmlContentAllowed
- public boolean isHtmlContentAllowed()
setAltText(String)
) is to
be rendered as HTML.public void setAutoplay(boolean autoplay)
autoplay
- public boolean isAutoplay()
public void setMuted(boolean muted)
muted
- public boolean isMuted()
public void pause()
public void play()
public void writeDesign(org.jsoup.nodes.Element design, DesignContext designContext)
Component
The component is responsible not only for writing its own state but also for ensuring that its children write their state to the design.
This method must not modify the component state.
writeDesign
in interface Component
writeDesign
in class AbstractComponent
design
- The element to write the component state to. Any previous
attributes or child nodes are not cleared.designContext
- The DesignContext instance used for writing the designpublic void readDesign(org.jsoup.nodes.Element design, DesignContext designContext)
Component
The component is responsible not only for updating its own state but also for ensuring that its children update their state based on the design.
It is assumed that the component is in its default state when this method is called. Reading should only take into consideration attributes specified in the design and not reset any unspecified attributes to their defaults.
This method must not modify the design.
readDesign
in interface Component
readDesign
in class AbstractComponent
design
- The element to obtain the state fromdesignContext
- The DesignContext instance used for parsing the designprotected java.util.Collection<java.lang.String> getCustomAttributes()
AbstractComponent
readDesign
and writeDesign
methods. Typically these are handled in a custom way in the overridden
versions of the above methods
getCustomAttributes
in class AbstractComponent
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |