1 // WARNING: This file was automatically generated. Do not edit it directly,
2 // or you will lose your changes.
3
4 /*
5 * Licensed to the Apache Software Foundation (ASF) under one
6 * or more contributor license agreements. See the NOTICE file
7 * distributed with this work for additional information
8 * regarding copyright ownership. The ASF licenses this file
9 * to you under the Apache License, Version 2.0 (the
10 * "License"); you may not use this file except in compliance
11 * with the License. You may obtain a copy of the License at
12 *
13 * http://www.apache.org/licenses/LICENSE-2.0
14 *
15 * Unless required by applicable law or agreed to in writing,
16 * software distributed under the License is distributed on an
17 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
18 * KIND, either express or implied. See the License for the
19 * specific language governing permissions and limitations
20 * under the License.
21 */
22 package org.apache.myfaces.trinidad.component.core.output;
23
24 import java.util.Arrays;
25 import java.util.Collection;
26 import java.util.Collections;
27 import java.util.List;
28 import java.util.Map;
29 import javax.faces.component.behavior.ClientBehavior;
30 import javax.faces.component.behavior.ClientBehaviorHolder;
31 import org.apache.myfaces.trinidad.bean.FacesBean;
32 import org.apache.myfaces.trinidad.bean.PropertyKey;
33 import org.apache.myfaces.trinidad.component.UIXObject;
34 import org.apache.myfaces.trinidad.util.ComponentUtils;
35
36 /**
37 *
38 * <html:p>
39 * The media component displays media content, such as audio, video,
40 * or image in a player embedded in the user agent.
41 * The media control displays the media specified by the "source"
42 * attribute in the appropriate media player. If a particular
43 * media player is desired, it can be specified using the "player"
44 * attribute. The media control attempts to intelligently handle
45 * two tricky aspects of cross-platform media display--determining
46 * the best player to display the media, and sizing the media player.
47 * </html:p>
48 * <html:p>
49 * The media control attempts to pick the appropriate media player
50 * using the following steps:
51 * <html:ol>
52 * <html:li>
53 * If the primary MIME type of the content is "image", the
54 * built in user-agent support will be used.
55 * </html:li>
56 * <html:li>
57 * If a media player has been specified by the "player" attribute
58 * and that player is available on the user agent and can display
59 * the media resource, that player will be used.
60 * </html:li>
61 * <html:li>
62 * If one player is especially good at playing the media resource
63 * and that player is available on the user agent, that player
64 * will be used.
65 * </html:li>
66 * <html:li>
67 * If one player is especially dominant on the user agent and that
68 * player can play the media resource, that player will be used.
69 * </html:li>
70 * <html:li>
71 * the "link" player will be used.
72 * </html:li>
73 * </html:ol>
74 * </html:p>
75 * <html:p>
76 * The media component supports two approaches to
77 * sizing the media control
78 * setting the "width" and "height" attributes, which specify the
79 * amount of space reserved on the user agent for the media control,
80 * and setting the "innerWidth" and "innerHeight" attributes, which
81 * specify the size of the media resource content. Since it is almost
82 * impossible to determine the correct width and height to use across
83 * different players and different player control configurations,
84 * specifying the "innerWidth" and "innerHeight" is the recommended
85 * strategy.
86 * </html:p>
87 * <html:p>
88 * If the size of the media control isn't specified by one of the above
89 * approaches, a default inner size, determined by the content type of
90 * the media resource, will be used. This works well for audio content,
91 * but can cause content to be clipped or occupy too much space for
92 * video content.
93 * </html:p>
94 *
95 * <h4>Events:</h4>
96 * <table border="1" width="100%" cellpadding="3" summary="">
97 * <tr bgcolor="#CCCCFF" class="TableHeadingColor">
98 * <th align="left">Type</th>
99 * <th align="left">Phases</th>
100 * <th align="left">Description</th>
101 * </tr>
102 * <tr class="TableRowColor">
103 * <td valign="top"><code>org.apache.myfaces.trinidad.event.AttributeChangeEvent</code></td>
104 * <td valign="top" nowrap>Invoke<br>Application<br>Apply<br>Request<br>Values</td>
105 * <td valign="top">Event delivered to describe an attribute change. Attribute change events are not delivered for any programmatic change to a property. They are only delivered when a renderer changes a property without the application's specific request. An example of an attribute change event might include the width of a column that supported client-side resizing.</td>
106 * </tr>
107 * </table>
108 */
109 public class CoreMedia extends UIXObject
110 implements ClientBehaviorHolder
111 {
112 static public final String PLAYER_WINDOWS = "windows";
113 static public final String PLAYER_QUICKTIME = "quicktime";
114 static public final String PLAYER_LINK = "link";
115 static public final String PLAYER_REAL = "real";
116 static public final String CONTROLS_NONE_VISIBLE = "noneVisible";
117 static public final String CONTROLS_NONE = "none";
118 static public final String CONTROLS_TYPICAL = "typical";
119 static public final String CONTROLS_ALL = "all";
120 static public final String CONTROLS_MINIMAL = "minimal";
121 static public final FacesBean.Type TYPE = new FacesBean.Type(
122 UIXObject.TYPE);
123 static public final PropertyKey WIDTH_KEY =
124 TYPE.registerKey("width", String.class);
125 static public final PropertyKey HEIGHT_KEY =
126 TYPE.registerKey("height", String.class);
127 static public final PropertyKey INNER_WIDTH_KEY =
128 TYPE.registerKey("innerWidth", Integer.class);
129 static public final PropertyKey INNER_HEIGHT_KEY =
130 TYPE.registerKey("innerHeight", Integer.class);
131 static public final PropertyKey SOURCE_KEY =
132 TYPE.registerKey("source", String.class);
133 static public final PropertyKey AUTOSTART_KEY =
134 TYPE.registerKey("autostart", Boolean.class, Boolean.FALSE);
135 static public final PropertyKey PLAY_COUNT_KEY =
136 TYPE.registerKey("playCount", Integer.class);
137 static public final PropertyKey CONTENT_TYPE_KEY =
138 TYPE.registerKey("contentType", String.class);
139 static public final PropertyKey STANDBY_TEXT_KEY =
140 TYPE.registerKey("standbyText", String.class);
141 static public final PropertyKey PLAYER_KEY =
142 TYPE.registerKey("player", String.class);
143 static public final PropertyKey CONTROLS_KEY =
144 TYPE.registerKey("controls", String.class, "typical");
145 static public final PropertyKey INLINE_STYLE_KEY =
146 TYPE.registerKey("inlineStyle", String.class);
147 static public final PropertyKey STYLE_CLASS_KEY =
148 TYPE.registerKey("styleClass", String.class);
149 static public final PropertyKey SHORT_DESC_KEY =
150 TYPE.registerKey("shortDesc", String.class);
151 static public final PropertyKey PARTIAL_TRIGGERS_KEY =
152 TYPE.registerKey("partialTriggers", String[].class, null, 0, PropertyKey.Mutable.RARELY);
153 static public final PropertyKey ONCLICK_KEY =
154 TYPE.registerKey("onclick", String.class);
155 static public final PropertyKey ONDBLCLICK_KEY =
156 TYPE.registerKey("ondblclick", String.class);
157 static public final PropertyKey ONMOUSEDOWN_KEY =
158 TYPE.registerKey("onmousedown", String.class);
159 static public final PropertyKey ONMOUSEUP_KEY =
160 TYPE.registerKey("onmouseup", String.class);
161 static public final PropertyKey ONMOUSEOVER_KEY =
162 TYPE.registerKey("onmouseover", String.class);
163 static public final PropertyKey ONMOUSEMOVE_KEY =
164 TYPE.registerKey("onmousemove", String.class);
165 static public final PropertyKey ONMOUSEOUT_KEY =
166 TYPE.registerKey("onmouseout", String.class);
167 static public final PropertyKey ONKEYPRESS_KEY =
168 TYPE.registerKey("onkeypress", String.class);
169 static public final PropertyKey ONKEYDOWN_KEY =
170 TYPE.registerKey("onkeydown", String.class);
171 static public final PropertyKey ONKEYUP_KEY =
172 TYPE.registerKey("onkeyup", String.class);
173
174 static public final String COMPONENT_FAMILY =
175 "org.apache.myfaces.trinidad.Object";
176 static public final String COMPONENT_TYPE =
177 "org.apache.myfaces.trinidad.CoreMedia";
178 // Supported client events for client behaviors:
179 private final static Collection<String> _EVENT_NAMES = Collections.unmodifiableCollection(
180 Arrays.asList(
181 "click", "dblclick", "mousedown", "mouseup", "mouseover", "mousemove",
182 "mouseout", "keypress", "keydown", "keyup"
183 ));
184
185 /**
186 * Construct an instance of the CoreMedia.
187 */
188 public CoreMedia()
189 {
190 super("org.apache.myfaces.trinidad.Media");
191 }
192
193 /**
194 * Gets <html> width in pixels to reserve for the media player plus its content.
195 * As the extra width needed for the media player controls can vary
196 * from media player to media player and depend on the controls
197 * displayed in the media player, it is recommended that the
198 * "innerWidth" attribute be used in preference to this attribute.
199 * <p>
200 * If both the "width" and "innerWidth" attributes are specified,
201 * the "width" attribute will be used.
202 * </p>
203 * <p>
204 * If no width is specified, the width of the media control is
205 * determined by calculating the "innerWidth" and adding any extra
206 * width necessary to display the media player controls.
207 * </p></html>
208 *
209 * @return the new width value
210 */
211 final public String getWidth()
212 {
213 return ComponentUtils.resolveString(getProperty(WIDTH_KEY));
214 }
215
216 /**
217 * Sets <html> width in pixels to reserve for the media player plus its content.
218 * As the extra width needed for the media player controls can vary
219 * from media player to media player and depend on the controls
220 * displayed in the media player, it is recommended that the
221 * "innerWidth" attribute be used in preference to this attribute.
222 * <p>
223 * If both the "width" and "innerWidth" attributes are specified,
224 * the "width" attribute will be used.
225 * </p>
226 * <p>
227 * If no width is specified, the width of the media control is
228 * determined by calculating the "innerWidth" and adding any extra
229 * width necessary to display the media player controls.
230 * </p></html>
231 *
232 * @param width the new width value
233 */
234 final public void setWidth(String width)
235 {
236 setProperty(WIDTH_KEY, (width));
237 }
238
239 /**
240 * Sets <html> width in pixels to reserve for the media player plus its content.
241 * As the extra width needed for the media player controls can vary
242 * from media player to media player and depend on the controls
243 * displayed in the media player, it is recommended that the
244 * "innerWidth" attribute be used in preference to this attribute.
245 * <p>
246 * If both the "width" and "innerWidth" attributes are specified,
247 * the "width" attribute will be used.
248 * </p>
249 * <p>
250 * If no width is specified, the width of the media control is
251 * determined by calculating the "innerWidth" and adding any extra
252 * width necessary to display the media player controls.
253 * </p></html>
254 *
255 * @param width the new width value
256 */
257 final public void setWidth(int width)
258 {
259 setProperty(WIDTH_KEY, Integer.valueOf(width));
260 }
261
262 /**
263 * Gets <html> height in pixels to reserve for the media player plus its content.
264 * As the extra height needed for the media player controls can vary
265 * from media player to media player and depend on the controls
266 * displayed in the media player, it is recommended that the
267 * "innerHeight" attribute be used in preference to this attribute.
268 * <p>
269 * If both the "height" and "innerHeight" attributes are specified,
270 * the "height" attribute will be used.
271 * </p>
272 * <p>
273 * If no height is specified, the height of the media control is
274 * determined by calculating the "innerHeight" and adding any extra
275 * height necessary to display the media player controls.
276 * </p></html>
277 *
278 * @return the new height value
279 */
280 final public String getHeight()
281 {
282 return ComponentUtils.resolveString(getProperty(HEIGHT_KEY));
283 }
284
285 /**
286 * Sets <html> height in pixels to reserve for the media player plus its content.
287 * As the extra height needed for the media player controls can vary
288 * from media player to media player and depend on the controls
289 * displayed in the media player, it is recommended that the
290 * "innerHeight" attribute be used in preference to this attribute.
291 * <p>
292 * If both the "height" and "innerHeight" attributes are specified,
293 * the "height" attribute will be used.
294 * </p>
295 * <p>
296 * If no height is specified, the height of the media control is
297 * determined by calculating the "innerHeight" and adding any extra
298 * height necessary to display the media player controls.
299 * </p></html>
300 *
301 * @param height the new height value
302 */
303 final public void setHeight(String height)
304 {
305 setProperty(HEIGHT_KEY, (height));
306 }
307
308 /**
309 * Sets <html> height in pixels to reserve for the media player plus its content.
310 * As the extra height needed for the media player controls can vary
311 * from media player to media player and depend on the controls
312 * displayed in the media player, it is recommended that the
313 * "innerHeight" attribute be used in preference to this attribute.
314 * <p>
315 * If both the "height" and "innerHeight" attributes are specified,
316 * the "height" attribute will be used.
317 * </p>
318 * <p>
319 * If no height is specified, the height of the media control is
320 * determined by calculating the "innerHeight" and adding any extra
321 * height necessary to display the media player controls.
322 * </p></html>
323 *
324 * @param height the new height value
325 */
326 final public void setHeight(int height)
327 {
328 setProperty(HEIGHT_KEY, Integer.valueOf(height));
329 }
330
331 /**
332 * Gets <html> width in pixels to reserve for the media player content. This
333 * will typically be set to the pixel width of the media resource
334 * to display.
335 * <p>
336 * If no "innerWidth" is specified, the "innerWidth" will be defaulted
337 * based on the content type of the media resource to play.
338 * </p>
339 * <p>
340 * If both the "width" and "innerWidth" attributes are specified,
341 * the "width" attribute will be used.
342 * </p></html>
343 *
344 * @return the new innerWidth value
345 */
346 final public int getInnerWidth()
347 {
348 return ComponentUtils.resolveInteger(getProperty(INNER_WIDTH_KEY));
349 }
350
351 /**
352 * Sets <html> width in pixels to reserve for the media player content. This
353 * will typically be set to the pixel width of the media resource
354 * to display.
355 * <p>
356 * If no "innerWidth" is specified, the "innerWidth" will be defaulted
357 * based on the content type of the media resource to play.
358 * </p>
359 * <p>
360 * If both the "width" and "innerWidth" attributes are specified,
361 * the "width" attribute will be used.
362 * </p></html>
363 *
364 * @param innerWidth the new innerWidth value
365 */
366 final public void setInnerWidth(int innerWidth)
367 {
368 setProperty(INNER_WIDTH_KEY, Integer.valueOf(innerWidth));
369 }
370
371 /**
372 * Gets <html> height in pixels to reserve for the media player content. This
373 * will typically be set to the pixel height of the media resource
374 * to display.
375 * <p>
376 * If no "innerHeight" is specified, the "innerHeight" will be defaulted
377 * based on the content type of the media resource to play.
378 * </p>
379 * <p>
380 * If both the "height" and "innerHeight" attributes are specified,
381 * the "height" attribute will be used.
382 * </p></html>
383 *
384 * @return the new innerHeight value
385 */
386 final public int getInnerHeight()
387 {
388 return ComponentUtils.resolveInteger(getProperty(INNER_HEIGHT_KEY));
389 }
390
391 /**
392 * Sets <html> height in pixels to reserve for the media player content. This
393 * will typically be set to the pixel height of the media resource
394 * to display.
395 * <p>
396 * If no "innerHeight" is specified, the "innerHeight" will be defaulted
397 * based on the content type of the media resource to play.
398 * </p>
399 * <p>
400 * If both the "height" and "innerHeight" attributes are specified,
401 * the "height" attribute will be used.
402 * </p></html>
403 *
404 * @param innerHeight the new innerHeight value
405 */
406 final public void setInnerHeight(int innerHeight)
407 {
408 setProperty(INNER_HEIGHT_KEY, Integer.valueOf(innerHeight));
409 }
410
411 /**
412 * Gets the URI specifying the location of the media resource. If no
413 * contentType is specified, the contentType will be inferred from
414 * the extension of the source attribute.
415 *
416 * @return the new source value
417 */
418 final public String getSource()
419 {
420 return ComponentUtils.resolveString(getProperty(SOURCE_KEY));
421 }
422
423 /**
424 * Sets the URI specifying the location of the media resource. If no
425 * contentType is specified, the contentType will be inferred from
426 * the extension of the source attribute.
427 *
428 * @param source the new source value
429 */
430 final public void setSource(String source)
431 {
432 setProperty(SOURCE_KEY, (source));
433 }
434
435 /**
436 * Gets a boolean value that controls whether the media resource loads
437 * and plays automatically without user initiation. When set to "true",
438 * the media resource will load and play as soon as possible.
439 *
440 * @return the new autostart value
441 */
442 final public boolean isAutostart()
443 {
444 return ComponentUtils.resolveBoolean(getProperty(AUTOSTART_KEY), false);
445 }
446
447 /**
448 * Sets a boolean value that controls whether the media resource loads
449 * and plays automatically without user initiation. When set to "true",
450 * the media resource will load and play as soon as possible.
451 *
452 * @param autostart the new autostart value
453 */
454 final public void setAutostart(boolean autostart)
455 {
456 setProperty(AUTOSTART_KEY, autostart ? Boolean.TRUE : Boolean.FALSE);
457 }
458
459 /**
460 * Gets the number of times the media resource will play. If set to "0",
461 * the resource will loop until the user stops the playing.
462 *
463 * @return the new playCount value
464 */
465 final public int getPlayCount()
466 {
467 return ComponentUtils.resolveInteger(getProperty(PLAY_COUNT_KEY));
468 }
469
470 /**
471 * Sets the number of times the media resource will play. If set to "0",
472 * the resource will loop until the user stops the playing.
473 *
474 * @param playCount the new playCount value
475 */
476 final public void setPlayCount(int playCount)
477 {
478 setProperty(PLAY_COUNT_KEY, Integer.valueOf(playCount));
479 }
480
481 /**
482 * Gets the MIME type of the media content returned by the "source" URI.
483 * This attribute is used as a hint when determining which player to
484 * pick, how the controls of the player are to be configured, and
485 * the default size of the media player. If it isn't specified, an
486 * attempt will be made to derive this information from the extension
487 * of the source URI.
488 *
489 * @return the new contentType value
490 */
491 final public String getContentType()
492 {
493 return ComponentUtils.resolveString(getProperty(CONTENT_TYPE_KEY));
494 }
495
496 /**
497 * Sets the MIME type of the media content returned by the "source" URI.
498 * This attribute is used as a hint when determining which player to
499 * pick, how the controls of the player are to be configured, and
500 * the default size of the media player. If it isn't specified, an
501 * attempt will be made to derive this information from the extension
502 * of the source URI.
503 *
504 * @param contentType the new contentType value
505 */
506 final public void setContentType(String contentType)
507 {
508 setProperty(CONTENT_TYPE_KEY, (contentType));
509 }
510
511 /**
512 * Gets Message to display in the media player while the media resource
513 * is loading.
514 *
515 * @return the new standbyText value
516 */
517 final public String getStandbyText()
518 {
519 return ComponentUtils.resolveString(getProperty(STANDBY_TEXT_KEY));
520 }
521
522 /**
523 * Sets Message to display in the media player while the media resource
524 * is loading.
525 *
526 * @param standbyText the new standbyText value
527 */
528 final public void setStandbyText(String standbyText)
529 {
530 setProperty(STANDBY_TEXT_KEY, (standbyText));
531 }
532
533 /**
534 * Gets <html> which media player to use to play the media resource. If possible,
535 * the media control will accomodate this request. However, if
536 * the requested player is not available on the user agent, or does
537 * not support playing the media resource, an alternate player
538 * will be used instead. In all cases, the "link" player is used
539 * as a fallback if no other player is available, or the requested
540 * player fails for some reason.
541 * <ul>
542 * <li>
543 * <code>"none"</code>
544 * <p>
545 * use a link in the user agent page to launch the playing of the
546 * media resource.
547 * </p>
548 * <p>
549 * This player setting uses the least amount of space on the page
550 * and uses the user agent's built in content type mapping
551 * to determine how to display the media resource.
552 * </p>
553 * </li>
554 * <li>
555 * <code>"quicktime"</code>
556 * <p>
557 * use the Apple QuickTime player.
558 * </p>
559 * </li>
560 * <li>
561 * <code>"windows"</code>
562 * <p>
563 * use the Windows Media Player.
564 * </p>
565 * </li>
566 * <li>
567 * <code>"real"</code>
568 * <p>
569 * use the Real Player.
570 * </p>
571 * </li>
572 * </ul></html>
573 *
574 * @return the new player value
575 */
576 final public String getPlayer()
577 {
578 return ComponentUtils.resolveString(getProperty(PLAYER_KEY));
579 }
580
581 /**
582 * Sets <html> which media player to use to play the media resource. If possible,
583 * the media control will accomodate this request. However, if
584 * the requested player is not available on the user agent, or does
585 * not support playing the media resource, an alternate player
586 * will be used instead. In all cases, the "link" player is used
587 * as a fallback if no other player is available, or the requested
588 * player fails for some reason.
589 * <ul>
590 * <li>
591 * <code>"none"</code>
592 * <p>
593 * use a link in the user agent page to launch the playing of the
594 * media resource.
595 * </p>
596 * <p>
597 * This player setting uses the least amount of space on the page
598 * and uses the user agent's built in content type mapping
599 * to determine how to display the media resource.
600 * </p>
601 * </li>
602 * <li>
603 * <code>"quicktime"</code>
604 * <p>
605 * use the Apple QuickTime player.
606 * </p>
607 * </li>
608 * <li>
609 * <code>"windows"</code>
610 * <p>
611 * use the Windows Media Player.
612 * </p>
613 * </li>
614 * <li>
615 * <code>"real"</code>
616 * <p>
617 * use the Real Player.
618 * </p>
619 * </li>
620 * </ul></html>
621 *
622 * @param player the new player value
623 */
624 final public void setPlayer(String player)
625 {
626 setProperty(PLAYER_KEY, (player));
627 }
628
629 /**
630 * Gets <html> the set of controls made available to the user for controlling
631 * the media playback. The actual set of controls displayed for the
632 * same value may differ between players. Likewise, the amount of
633 * space occupied by the controls will differ from media player to
634 * media player. This can cause problems if the size of the
635 * media control has been specified by the "width" and "height"
636 * attributes rather than "innerWidth" and "innerHeight".
637 * <ul>
638 * <li>
639 * <code>"none"</code>
640 * <p>
641 * don't show any controls for the media player and don't allow
642 * control access through alternate means, such as context menus.
643 * </p>
644 * <p>
645 * This value is typically only used in kiosk-type applications
646 * where no user control over the playing of the media is allowed.
647 * It is typically used in conjunction with setting the
648 * "autostart" attribute to "true", and the "playCount" attribute
649 * to "0" to cause the media play immediately and then loop.
650 * </p>
651 * </li>
652 * <li>
653 * <code>"noneVisible"</code>
654 * <p>
655 * don't show any controls for the media player but allow control
656 * access through alternate means, such as context menus.
657 * </p>
658 * <p>
659 * This value is typically only used in applications where user
660 * control over the playing of the media is allowed, but
661 * not encouraged. It is typically used in conjunction with
662 * setting the "autostart" attribute to "true", and the
663 * "playCount" attribute to "0" to cause the media to play
664 * immediately and then loop.
665 * </p>
666 * </li>
667 * <li>
668 * <code>"minimal"</code>
669 * <p>
670 * show a minimal set of controls for playing media on the media
671 * player.
672 * </p>
673 * <p>
674 * This value gives users control over the most
675 * important media playing controls, while occupying the least
676 * amount of additional space on the user agent.
677 * </p>
678 * </li>
679 * <li>
680 * <code>"typical"</code>
681 * <p>
682 * show the typical set of controls for playing media on the
683 * media player.
684 * </p>
685 * <p>
686 * This value, the default, gives users control over the most
687 * common media playing controls, without occupying an inordinate
688 * amount of extra space on the user agent.
689 * </p>
690 * </li>
691 * <li>
692 * <code>"all"</code>
693 * <p>
694 * Show all available controls for playing media on the media player
695 * </p>
696 * <p>
697 * Using this setting can cause large amount of additional space
698 * to be required, depending on the media player used.
699 * </p>
700 * </li>
701 * </ul>
702 * <p>
703 * The default of this attribute is <code>"typical"</code>.
704 * </p></html>
705 *
706 * @return the new controls value
707 */
708 final public String getControls()
709 {
710 return ComponentUtils.resolveString(getProperty(CONTROLS_KEY), "typical");
711 }
712
713 /**
714 * Sets <html> the set of controls made available to the user for controlling
715 * the media playback. The actual set of controls displayed for the
716 * same value may differ between players. Likewise, the amount of
717 * space occupied by the controls will differ from media player to
718 * media player. This can cause problems if the size of the
719 * media control has been specified by the "width" and "height"
720 * attributes rather than "innerWidth" and "innerHeight".
721 * <ul>
722 * <li>
723 * <code>"none"</code>
724 * <p>
725 * don't show any controls for the media player and don't allow
726 * control access through alternate means, such as context menus.
727 * </p>
728 * <p>
729 * This value is typically only used in kiosk-type applications
730 * where no user control over the playing of the media is allowed.
731 * It is typically used in conjunction with setting the
732 * "autostart" attribute to "true", and the "playCount" attribute
733 * to "0" to cause the media play immediately and then loop.
734 * </p>
735 * </li>
736 * <li>
737 * <code>"noneVisible"</code>
738 * <p>
739 * don't show any controls for the media player but allow control
740 * access through alternate means, such as context menus.
741 * </p>
742 * <p>
743 * This value is typically only used in applications where user
744 * control over the playing of the media is allowed, but
745 * not encouraged. It is typically used in conjunction with
746 * setting the "autostart" attribute to "true", and the
747 * "playCount" attribute to "0" to cause the media to play
748 * immediately and then loop.
749 * </p>
750 * </li>
751 * <li>
752 * <code>"minimal"</code>
753 * <p>
754 * show a minimal set of controls for playing media on the media
755 * player.
756 * </p>
757 * <p>
758 * This value gives users control over the most
759 * important media playing controls, while occupying the least
760 * amount of additional space on the user agent.
761 * </p>
762 * </li>
763 * <li>
764 * <code>"typical"</code>
765 * <p>
766 * show the typical set of controls for playing media on the
767 * media player.
768 * </p>
769 * <p>
770 * This value, the default, gives users control over the most
771 * common media playing controls, without occupying an inordinate
772 * amount of extra space on the user agent.
773 * </p>
774 * </li>
775 * <li>
776 * <code>"all"</code>
777 * <p>
778 * Show all available controls for playing media on the media player
779 * </p>
780 * <p>
781 * Using this setting can cause large amount of additional space
782 * to be required, depending on the media player used.
783 * </p>
784 * </li>
785 * </ul>
786 * <p>
787 * The default of this attribute is <code>"typical"</code>.
788 * </p></html>
789 *
790 * @param controls the new controls value
791 */
792 final public void setControls(String controls)
793 {
794 setProperty(CONTROLS_KEY, (controls));
795 }
796
797 /**
798 * Gets the CSS styles to use for this component.
799 *
800 * @return the new inlineStyle value
801 */
802 final public String getInlineStyle()
803 {
804 return ComponentUtils.resolveString(getProperty(INLINE_STYLE_KEY));
805 }
806
807 /**
808 * Sets the CSS styles to use for this component.
809 *
810 * @param inlineStyle the new inlineStyle value
811 */
812 final public void setInlineStyle(String inlineStyle)
813 {
814 setProperty(INLINE_STYLE_KEY, (inlineStyle));
815 }
816
817 /**
818 * Gets a CSS style class to use for this component.
819 *
820 * @return the new styleClass value
821 */
822 final public String getStyleClass()
823 {
824 return ComponentUtils.resolveString(getProperty(STYLE_CLASS_KEY));
825 }
826
827 /**
828 * Sets a CSS style class to use for this component.
829 *
830 * @param styleClass the new styleClass value
831 */
832 final public void setStyleClass(String styleClass)
833 {
834 setProperty(STYLE_CLASS_KEY, (styleClass));
835 }
836
837 /**
838 * Gets The short description of the component. This text is commonly used by user agents to display tooltip help text.
839 *
840 * @return the new shortDesc value
841 */
842 final public String getShortDesc()
843 {
844 return ComponentUtils.resolveString(getProperty(SHORT_DESC_KEY));
845 }
846
847 /**
848 * Sets The short description of the component. This text is commonly used by user agents to display tooltip help text.
849 *
850 * @param shortDesc the new shortDesc value
851 */
852 final public void setShortDesc(String shortDesc)
853 {
854 setProperty(SHORT_DESC_KEY, (shortDesc));
855 }
856
857 /**
858 * Gets the IDs of the components that should trigger a partial update.
859 * <p>
860 * This component will listen on the trigger components. If one of the
861 * trigger components receives an event that will cause it to update
862 * in some way, this component will request to be updated too.</p>
863 * <p>
864 * Separate multiple triggers with a space. e.g., partialTriggers="cmp1 cmp2"
865 * </p>
866 * <p>
867 * Identifiers must account for NamingContainers. You can use a single colon to start the search from the root,
868 * or use multiple colons to move up through the NamingContainer. For example,
869 * "::" will pop out of this component's naming container (it pops out of itself if it is a naming container),
870 * ":::" will pop out of two naming containers, etc. The search for
871 * the partialTrigger begins from there. e.g., partialTriggers=":::commandButton1" the search begins for the
872 * component with id = commandButton1 after popping out of two naming containers relative to this component.
873 * To go into naming containers, you separate the naming containers with ':', e.g.,partialTriggers= "nc1:nc2:nc3:componentId".</p>
874 *
875 * @return the new partialTriggers value
876 */
877 final public String[] getPartialTriggers()
878 {
879 return (String[])getProperty(PARTIAL_TRIGGERS_KEY);
880 }
881
882 /**
883 * Sets the IDs of the components that should trigger a partial update.
884 * <p>
885 * This component will listen on the trigger components. If one of the
886 * trigger components receives an event that will cause it to update
887 * in some way, this component will request to be updated too.</p>
888 * <p>
889 * Separate multiple triggers with a space. e.g., partialTriggers="cmp1 cmp2"
890 * </p>
891 * <p>
892 * Identifiers must account for NamingContainers. You can use a single colon to start the search from the root,
893 * or use multiple colons to move up through the NamingContainer. For example,
894 * "::" will pop out of this component's naming container (it pops out of itself if it is a naming container),
895 * ":::" will pop out of two naming containers, etc. The search for
896 * the partialTrigger begins from there. e.g., partialTriggers=":::commandButton1" the search begins for the
897 * component with id = commandButton1 after popping out of two naming containers relative to this component.
898 * To go into naming containers, you separate the naming containers with ':', e.g.,partialTriggers= "nc1:nc2:nc3:componentId".</p>
899 *
900 * @param partialTriggers the new partialTriggers value
901 */
902 final public void setPartialTriggers(String[] partialTriggers)
903 {
904 setProperty(PARTIAL_TRIGGERS_KEY, (partialTriggers));
905 }
906
907 /**
908 * Gets an onclick Javascript handler.
909 *
910 * @return the new onclick value
911 */
912 final public String getOnclick()
913 {
914 return ComponentUtils.resolveString(getProperty(ONCLICK_KEY));
915 }
916
917 /**
918 * Sets an onclick Javascript handler.
919 *
920 * @param onclick the new onclick value
921 */
922 final public void setOnclick(String onclick)
923 {
924 setProperty(ONCLICK_KEY, (onclick));
925 }
926
927 /**
928 * Gets an ondblclick Javascript handler.
929 *
930 * @return the new ondblclick value
931 */
932 final public String getOndblclick()
933 {
934 return ComponentUtils.resolveString(getProperty(ONDBLCLICK_KEY));
935 }
936
937 /**
938 * Sets an ondblclick Javascript handler.
939 *
940 * @param ondblclick the new ondblclick value
941 */
942 final public void setOndblclick(String ondblclick)
943 {
944 setProperty(ONDBLCLICK_KEY, (ondblclick));
945 }
946
947 /**
948 * Gets an onmousedown Javascript handler.
949 *
950 * @return the new onmousedown value
951 */
952 final public String getOnmousedown()
953 {
954 return ComponentUtils.resolveString(getProperty(ONMOUSEDOWN_KEY));
955 }
956
957 /**
958 * Sets an onmousedown Javascript handler.
959 *
960 * @param onmousedown the new onmousedown value
961 */
962 final public void setOnmousedown(String onmousedown)
963 {
964 setProperty(ONMOUSEDOWN_KEY, (onmousedown));
965 }
966
967 /**
968 * Gets an onmouseup Javascript handler.
969 *
970 * @return the new onmouseup value
971 */
972 final public String getOnmouseup()
973 {
974 return ComponentUtils.resolveString(getProperty(ONMOUSEUP_KEY));
975 }
976
977 /**
978 * Sets an onmouseup Javascript handler.
979 *
980 * @param onmouseup the new onmouseup value
981 */
982 final public void setOnmouseup(String onmouseup)
983 {
984 setProperty(ONMOUSEUP_KEY, (onmouseup));
985 }
986
987 /**
988 * Gets an onmouseover Javascript handler.
989 *
990 * @return the new onmouseover value
991 */
992 final public String getOnmouseover()
993 {
994 return ComponentUtils.resolveString(getProperty(ONMOUSEOVER_KEY));
995 }
996
997 /**
998 * Sets an onmouseover Javascript handler.
999 *
1000 * @param onmouseover the new onmouseover value
1001 */
1002 final public void setOnmouseover(String onmouseover)
1003 {
1004 setProperty(ONMOUSEOVER_KEY, (onmouseover));
1005 }
1006
1007 /**
1008 * Gets an onmousemove Javascript handler.
1009 *
1010 * @return the new onmousemove value
1011 */
1012 final public String getOnmousemove()
1013 {
1014 return ComponentUtils.resolveString(getProperty(ONMOUSEMOVE_KEY));
1015 }
1016
1017 /**
1018 * Sets an onmousemove Javascript handler.
1019 *
1020 * @param onmousemove the new onmousemove value
1021 */
1022 final public void setOnmousemove(String onmousemove)
1023 {
1024 setProperty(ONMOUSEMOVE_KEY, (onmousemove));
1025 }
1026
1027 /**
1028 * Gets an onmouseout Javascript handler.
1029 *
1030 * @return the new onmouseout value
1031 */
1032 final public String getOnmouseout()
1033 {
1034 return ComponentUtils.resolveString(getProperty(ONMOUSEOUT_KEY));
1035 }
1036
1037 /**
1038 * Sets an onmouseout Javascript handler.
1039 *
1040 * @param onmouseout the new onmouseout value
1041 */
1042 final public void setOnmouseout(String onmouseout)
1043 {
1044 setProperty(ONMOUSEOUT_KEY, (onmouseout));
1045 }
1046
1047 /**
1048 * Gets an onkeypress Javascript handler.
1049 *
1050 * @return the new onkeypress value
1051 */
1052 final public String getOnkeypress()
1053 {
1054 return ComponentUtils.resolveString(getProperty(ONKEYPRESS_KEY));
1055 }
1056
1057 /**
1058 * Sets an onkeypress Javascript handler.
1059 *
1060 * @param onkeypress the new onkeypress value
1061 */
1062 final public void setOnkeypress(String onkeypress)
1063 {
1064 setProperty(ONKEYPRESS_KEY, (onkeypress));
1065 }
1066
1067 /**
1068 * Gets an onkeydown Javascript handler.
1069 *
1070 * @return the new onkeydown value
1071 */
1072 final public String getOnkeydown()
1073 {
1074 return ComponentUtils.resolveString(getProperty(ONKEYDOWN_KEY));
1075 }
1076
1077 /**
1078 * Sets an onkeydown Javascript handler.
1079 *
1080 * @param onkeydown the new onkeydown value
1081 */
1082 final public void setOnkeydown(String onkeydown)
1083 {
1084 setProperty(ONKEYDOWN_KEY, (onkeydown));
1085 }
1086
1087 /**
1088 * Gets an onkeyup Javascript handler.
1089 *
1090 * @return the new onkeyup value
1091 */
1092 final public String getOnkeyup()
1093 {
1094 return ComponentUtils.resolveString(getProperty(ONKEYUP_KEY));
1095 }
1096
1097 /**
1098 * Sets an onkeyup Javascript handler.
1099 *
1100 * @param onkeyup the new onkeyup value
1101 */
1102 final public void setOnkeyup(String onkeyup)
1103 {
1104 setProperty(ONKEYUP_KEY, (onkeyup));
1105 }
1106
1107 @Override
1108 public String getDefaultEventName()
1109 {
1110 return "click";
1111 }
1112
1113 @Override
1114 public Collection<String> getEventNames()
1115 {
1116 return _EVENT_NAMES;
1117 }
1118
1119 @Override
1120 public Map<String, List<ClientBehavior>> getClientBehaviors()
1121 {
1122 return super.getClientBehaviors();
1123 }
1124
1125 @Override
1126 public void addClientBehavior(
1127 String eventName,
1128 ClientBehavior behavior)
1129 {
1130 super.addClientBehavior(eventName, behavior);
1131 }
1132
1133 @Override
1134 public String getFamily()
1135 {
1136 return COMPONENT_FAMILY;
1137 }
1138
1139 @Override
1140 protected FacesBean.Type getBeanType()
1141 {
1142 return TYPE;
1143 }
1144
1145 /**
1146 * Construct an instance of the CoreMedia.
1147 */
1148 protected CoreMedia(
1149 String rendererType
1150 )
1151 {
1152 super(rendererType);
1153 }
1154
1155 static
1156 {
1157 TYPE.lockAndRegister("org.apache.myfaces.trinidad.Object","org.apache.myfaces.trinidad.Media");
1158 }
1159 }