|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.zkoss.zk.ui.AbstractComponent
org.zkoss.zk.ui.HtmlBasedComponent
org.zkoss.zul.impl.XulElement
org.zkoss.zul.Audio
public class Audio
An audio clip.
An extension to XUL.
| Nested Class Summary | |
|---|---|
protected class |
Audio.ExtraCtrl
A utility class to implement AbstractComponent.getExtraCtrl(). |
| Nested classes/interfaces inherited from class org.zkoss.zk.ui.AbstractComponent |
|---|
AbstractComponent.Children |
| Field Summary | |
|---|---|
protected java.lang.String |
_src
|
| Fields inherited from class org.zkoss.zk.ui.HtmlBasedComponent |
|---|
_zclass, RS_NO_DISPLAY, RS_NO_HEIGHT, RS_NO_WIDTH |
| Fields inherited from class org.zkoss.zk.ui.AbstractComponent |
|---|
_visible |
| Fields inherited from interface org.zkoss.zk.ui.Component |
|---|
APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPE |
| Constructor Summary | |
|---|---|
Audio()
|
|
Audio(java.lang.String src)
|
|
| Method Summary | |
|---|---|
java.lang.String |
getAlign()
Returns the alignment. |
java.lang.String |
getBorder()
Returns the width of the border. |
Audio |
getContent()
Returns the content set by setContent(org.zkoss.sound.Audio). |
java.lang.String |
getOuterAttrs()
Returns the exterior attributes for generating the enclosing HTML tag; never return null. |
java.lang.String |
getSrc()
Returns the src. |
boolean |
isAutostart()
Returns whether to auto start playing the audio. |
boolean |
isChildable()
Default: not childable. |
boolean |
isLoop()
Returns whether to play the audio repeatedly. |
protected java.lang.Object |
newExtraCtrl()
Used by AbstractComponent.getExtraCtrl() to create a client control. |
void |
pause()
Pauses the audio at the cient. |
void |
play()
Plays the audio at the client. |
void |
setAlign(java.lang.String align)
Sets the alignment: one of top, texttop, middle, absmiddle, bottom, absbottom, baseline, left, right and center. |
void |
setAutostart(boolean autostart)
Sets whether to auto start playing the audio. |
void |
setBorder(java.lang.String border)
Sets the width of the border. |
void |
setContent(Audio audio)
Sets the content directly. |
void |
setLoop(boolean loop)
Sets whether to play the audio repeatedly. |
void |
setSrc(java.lang.String src)
Sets the src. |
void |
stop()
Stops the audio at the cient. |
| Methods inherited from class org.zkoss.zul.impl.XulElement |
|---|
getAction, getActionAttrs, getAllOnClickAttrs, getContext, getCtrlKeys, getInnerAttrs, getPopup, getTooltip, setAction, setContext, setContext, setCtrlKeys, setPopup, setPopup, setTooltip, setTooltip |
| Methods inherited from class org.zkoss.zk.ui.HtmlBasedComponent |
|---|
focus, getAllOnClickAttrs, getDraggable, getDroppable, getHeight, getLeft, getMoldSclass, getRealSclass, getRealStyle, getRealStyleFlags, getSclass, getStyle, getTooltiptext, getTop, getWidth, getZclass, getZindex, getZIndex, redraw, setClass, setDraggable, setDroppable, setFocus, setHeight, setLeft, setMoldSclass, setSclass, setStyle, setTooltiptext, setTop, setWidth, setZclass, setZindex, setZIndex |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.zkoss.zul.impl.api.XulElement |
|---|
getAction, getContext, getCtrlKeys, getPopup, getTooltip, setAction, setContext, setContext, setCtrlKeys, setPopup, setPopup, setTooltip, setTooltip |
| Methods inherited from interface org.zkoss.zk.ui.api.HtmlBasedComponent |
|---|
focus, getHeight, getLeft, getSclass, getStyle, getTooltiptext, getTop, getWidth, getZclass, getZindex, getZIndex, setDraggable, setDroppable, setFocus, setHeight, setLeft, setSclass, setStyle, setTooltiptext, setTop, setWidth, setZclass, setZindex, setZIndex |
| Field Detail |
|---|
protected java.lang.String _src
| Constructor Detail |
|---|
public Audio()
public Audio(java.lang.String src)
| Method Detail |
|---|
public void play()
play in interface Audiopublic void stop()
stop in interface Audiopublic void pause()
pause in interface Audiopublic java.lang.String getAlign()
Default: null (use browser default).
getAlign in interface Audio
public void setAlign(java.lang.String align)
throws WrongValueException
setAlign in interface AudioWrongValueExceptionpublic java.lang.String getBorder()
Default: null (use browser default).
getBorder in interface Audio
public void setBorder(java.lang.String border)
throws WrongValueException
setBorder in interface AudioWrongValueExceptionpublic java.lang.String getSrc()
Default: null.
getSrc in interface Audiopublic void setSrc(java.lang.String src)
Calling this method implies setContent(null).
In other words, the last invocation of setSrc(java.lang.String) overrides
the previous setContent(org.zkoss.sound.Audio), if any.
setSrc in interface AudiosetContent(org.zkoss.sound.Audio)public final boolean isAutostart()
Default: false;
public final void setAutostart(boolean autostart)
public final boolean isLoop()
Default: false;
public final void setLoop(boolean loop)
public void setContent(Audio audio)
Default: null.
Calling this method implies setSrc(null).
In other words, the last invocation of setContent(org.zkoss.sound.Audio) overrides
the previous setSrc(java.lang.String), if any.
setContent in interface Audioaudio - the audio to display.setSrc(java.lang.String)public Audio getContent()
setContent(org.zkoss.sound.Audio).
Note: it won't fetch what is set thru by setSrc(java.lang.String).
It simply returns what is passed to setContent(org.zkoss.sound.Audio).
getContent in interface Audiopublic java.lang.String getOuterAttrs()
HtmlBasedComponentUsed only by component developers.
Default: Generates the tooltip text, style, sclass, draggable
and droppable attribute if necessary.
In other words, the corresponding attribute is generated if
HtmlBasedComponent.getTooltiptext(), HtmlBasedComponent.getRealStyle(),
HtmlBasedComponent.getSclass(), HtmlBasedComponent.getDraggable(), HtmlBasedComponent.getDroppable()
are defined.
You have to call both HtmlBasedComponent.getOuterAttrs() and
HtmlBasedComponent.getInnerAttrs() to generate complete attributes.
For simple components that all attributes are put on the outest HTML element, all you need is as follows.
<xx id="${self.uuid}"${self.outerAttrs}${self.innerAttrs}>
If you want to put attributes in a nested HTML element, you
shall use the following pattern. Notice: if HtmlBasedComponent.getInnerAttrs()
in a different tag, the tag must be named with "${self.uuid}!real".
<xx id="${self.uuid}"${self.outerAttrs}>
<yy id="${self.uuid}!real"${self.innerAttrs}>...
Note: This class handles non-deferrable event listeners automatically.
However, you have to invoke AbstractComponent.appendAsapAttr(java.lang.StringBuffer, java.lang.String) for each event
the component handles in HtmlBasedComponent.getOuterAttrs() as follows.
appendAsapAttr(sb, Events.ON_OPEN);
appendAsapAttr(sb, Events.ON_CHANGE);
Theorectically, you could put any attributes in either
HtmlBasedComponent.getInnerAttrs() or HtmlBasedComponent.getOuterAttrs().
However, zkau.js assumes all attributes are put at the outer one.
If you want something different, you have to provide your own
setAttr (refer to how checkbox is implemented).
getOuterAttrs in class XulElementpublic boolean isChildable()
isChildable in interface ComponentisChildable in class AbstractComponentprotected java.lang.Object newExtraCtrl()
HtmlBasedComponentAbstractComponent.getExtraCtrl() to create a client control.
It is used only by component developers.
Defaut: creates an instance of HtmlBasedComponent.ExtraCtrl.
newExtraCtrl in class HtmlBasedComponent
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||