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 image control creates an image tag.
40 * </html:p>
41 * <html:p>
42 * (The "alt" image tag can be set using the
43 * <html:code>shortDesc</html:code>
44 * attribute of the base bean type.
45 * </html:p>
46 *
47 * <h4>Events:</h4>
48 * <table border="1" width="100%" cellpadding="3" summary="">
49 * <tr bgcolor="#CCCCFF" class="TableHeadingColor">
50 * <th align="left">Type</th>
51 * <th align="left">Phases</th>
52 * <th align="left">Description</th>
53 * </tr>
54 * <tr class="TableRowColor">
55 * <td valign="top"><code>org.apache.myfaces.trinidad.event.AttributeChangeEvent</code></td>
56 * <td valign="top" nowrap>Invoke<br>Application<br>Apply<br>Request<br>Values</td>
57 * <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>
58 * </tr>
59 * </table>
60 */
61 public class CoreImage extends UIXObject
62 implements ClientBehaviorHolder
63 {
64 static public final String IMAGE_MAP_TYPE_NONE = "none";
65 static public final String IMAGE_MAP_TYPE_SERVER = "server";
66 static public final FacesBean.Type TYPE = new FacesBean.Type(
67 UIXObject.TYPE);
68 static public final PropertyKey INLINE_STYLE_KEY =
69 TYPE.registerKey("inlineStyle", String.class);
70 static public final PropertyKey STYLE_CLASS_KEY =
71 TYPE.registerKey("styleClass", String.class);
72 static public final PropertyKey SHORT_DESC_KEY =
73 TYPE.registerKey("shortDesc", String.class);
74 static public final PropertyKey PARTIAL_TRIGGERS_KEY =
75 TYPE.registerKey("partialTriggers", String[].class, null, 0, PropertyKey.Mutable.RARELY);
76 static public final PropertyKey ONCLICK_KEY =
77 TYPE.registerKey("onclick", String.class);
78 static public final PropertyKey ONDBLCLICK_KEY =
79 TYPE.registerKey("ondblclick", String.class);
80 static public final PropertyKey ONMOUSEDOWN_KEY =
81 TYPE.registerKey("onmousedown", String.class);
82 static public final PropertyKey ONMOUSEUP_KEY =
83 TYPE.registerKey("onmouseup", String.class);
84 static public final PropertyKey ONMOUSEOVER_KEY =
85 TYPE.registerKey("onmouseover", String.class);
86 static public final PropertyKey ONMOUSEMOVE_KEY =
87 TYPE.registerKey("onmousemove", String.class);
88 static public final PropertyKey ONMOUSEOUT_KEY =
89 TYPE.registerKey("onmouseout", String.class);
90 static public final PropertyKey ONKEYPRESS_KEY =
91 TYPE.registerKey("onkeypress", String.class);
92 static public final PropertyKey ONKEYDOWN_KEY =
93 TYPE.registerKey("onkeydown", String.class);
94 static public final PropertyKey ONKEYUP_KEY =
95 TYPE.registerKey("onkeyup", String.class);
96 static public final PropertyKey SOURCE_KEY =
97 TYPE.registerKey("source", String.class);
98 static public final PropertyKey LONG_DESC_URL_KEY =
99 TYPE.registerKey("longDescURL", String.class);
100 static public final PropertyKey IMAGE_MAP_TYPE_KEY =
101 TYPE.registerKey("imageMapType", String.class, "none");
102
103 static public final String COMPONENT_FAMILY =
104 "org.apache.myfaces.trinidad.Object";
105 static public final String COMPONENT_TYPE =
106 "org.apache.myfaces.trinidad.CoreImage";
107 // Supported client events for client behaviors:
108 private final static Collection<String> _EVENT_NAMES = Collections.unmodifiableCollection(
109 Arrays.asList(
110 "click", "dblclick", "mousedown", "mouseup", "mouseover", "mousemove",
111 "mouseout", "keypress", "keydown", "keyup"
112 ));
113
114 /**
115 * Construct an instance of the CoreImage.
116 */
117 public CoreImage()
118 {
119 super("org.apache.myfaces.trinidad.Image");
120 }
121
122 /**
123 * Gets the CSS styles to use for this component.
124 *
125 * @return the new inlineStyle value
126 */
127 final public String getInlineStyle()
128 {
129 return ComponentUtils.resolveString(getProperty(INLINE_STYLE_KEY));
130 }
131
132 /**
133 * Sets the CSS styles to use for this component.
134 *
135 * @param inlineStyle the new inlineStyle value
136 */
137 final public void setInlineStyle(String inlineStyle)
138 {
139 setProperty(INLINE_STYLE_KEY, (inlineStyle));
140 }
141
142 /**
143 * Gets a CSS style class to use for this component.
144 *
145 * @return the new styleClass value
146 */
147 final public String getStyleClass()
148 {
149 return ComponentUtils.resolveString(getProperty(STYLE_CLASS_KEY));
150 }
151
152 /**
153 * Sets a CSS style class to use for this component.
154 *
155 * @param styleClass the new styleClass value
156 */
157 final public void setStyleClass(String styleClass)
158 {
159 setProperty(STYLE_CLASS_KEY, (styleClass));
160 }
161
162 /**
163 * Gets The short description of the component. This text is commonly used by user agents to display tooltip help text.
164 *
165 * @return the new shortDesc value
166 */
167 final public String getShortDesc()
168 {
169 return ComponentUtils.resolveString(getProperty(SHORT_DESC_KEY));
170 }
171
172 /**
173 * Sets The short description of the component. This text is commonly used by user agents to display tooltip help text.
174 *
175 * @param shortDesc the new shortDesc value
176 */
177 final public void setShortDesc(String shortDesc)
178 {
179 setProperty(SHORT_DESC_KEY, (shortDesc));
180 }
181
182 /**
183 * Gets the IDs of the components that should trigger a partial update.
184 * <p>
185 * This component will listen on the trigger components. If one of the
186 * trigger components receives an event that will cause it to update
187 * in some way, this component will request to be updated too.</p>
188 * <p>
189 * Separate multiple triggers with a space. e.g., partialTriggers="cmp1 cmp2"
190 * </p>
191 * <p>
192 * Identifiers must account for NamingContainers. You can use a single colon to start the search from the root,
193 * or use multiple colons to move up through the NamingContainer. For example,
194 * "::" will pop out of this component's naming container (it pops out of itself if it is a naming container),
195 * ":::" will pop out of two naming containers, etc. The search for
196 * the partialTrigger begins from there. e.g., partialTriggers=":::commandButton1" the search begins for the
197 * component with id = commandButton1 after popping out of two naming containers relative to this component.
198 * To go into naming containers, you separate the naming containers with ':', e.g.,partialTriggers= "nc1:nc2:nc3:componentId".</p>
199 *
200 * @return the new partialTriggers value
201 */
202 final public String[] getPartialTriggers()
203 {
204 return (String[])getProperty(PARTIAL_TRIGGERS_KEY);
205 }
206
207 /**
208 * Sets the IDs of the components that should trigger a partial update.
209 * <p>
210 * This component will listen on the trigger components. If one of the
211 * trigger components receives an event that will cause it to update
212 * in some way, this component will request to be updated too.</p>
213 * <p>
214 * Separate multiple triggers with a space. e.g., partialTriggers="cmp1 cmp2"
215 * </p>
216 * <p>
217 * Identifiers must account for NamingContainers. You can use a single colon to start the search from the root,
218 * or use multiple colons to move up through the NamingContainer. For example,
219 * "::" will pop out of this component's naming container (it pops out of itself if it is a naming container),
220 * ":::" will pop out of two naming containers, etc. The search for
221 * the partialTrigger begins from there. e.g., partialTriggers=":::commandButton1" the search begins for the
222 * component with id = commandButton1 after popping out of two naming containers relative to this component.
223 * To go into naming containers, you separate the naming containers with ':', e.g.,partialTriggers= "nc1:nc2:nc3:componentId".</p>
224 *
225 * @param partialTriggers the new partialTriggers value
226 */
227 final public void setPartialTriggers(String[] partialTriggers)
228 {
229 setProperty(PARTIAL_TRIGGERS_KEY, (partialTriggers));
230 }
231
232 /**
233 * Gets an onclick Javascript handler.
234 *
235 * @return the new onclick value
236 */
237 final public String getOnclick()
238 {
239 return ComponentUtils.resolveString(getProperty(ONCLICK_KEY));
240 }
241
242 /**
243 * Sets an onclick Javascript handler.
244 *
245 * @param onclick the new onclick value
246 */
247 final public void setOnclick(String onclick)
248 {
249 setProperty(ONCLICK_KEY, (onclick));
250 }
251
252 /**
253 * Gets an ondblclick Javascript handler.
254 *
255 * @return the new ondblclick value
256 */
257 final public String getOndblclick()
258 {
259 return ComponentUtils.resolveString(getProperty(ONDBLCLICK_KEY));
260 }
261
262 /**
263 * Sets an ondblclick Javascript handler.
264 *
265 * @param ondblclick the new ondblclick value
266 */
267 final public void setOndblclick(String ondblclick)
268 {
269 setProperty(ONDBLCLICK_KEY, (ondblclick));
270 }
271
272 /**
273 * Gets an onmousedown Javascript handler.
274 *
275 * @return the new onmousedown value
276 */
277 final public String getOnmousedown()
278 {
279 return ComponentUtils.resolveString(getProperty(ONMOUSEDOWN_KEY));
280 }
281
282 /**
283 * Sets an onmousedown Javascript handler.
284 *
285 * @param onmousedown the new onmousedown value
286 */
287 final public void setOnmousedown(String onmousedown)
288 {
289 setProperty(ONMOUSEDOWN_KEY, (onmousedown));
290 }
291
292 /**
293 * Gets an onmouseup Javascript handler.
294 *
295 * @return the new onmouseup value
296 */
297 final public String getOnmouseup()
298 {
299 return ComponentUtils.resolveString(getProperty(ONMOUSEUP_KEY));
300 }
301
302 /**
303 * Sets an onmouseup Javascript handler.
304 *
305 * @param onmouseup the new onmouseup value
306 */
307 final public void setOnmouseup(String onmouseup)
308 {
309 setProperty(ONMOUSEUP_KEY, (onmouseup));
310 }
311
312 /**
313 * Gets an onmouseover Javascript handler.
314 *
315 * @return the new onmouseover value
316 */
317 final public String getOnmouseover()
318 {
319 return ComponentUtils.resolveString(getProperty(ONMOUSEOVER_KEY));
320 }
321
322 /**
323 * Sets an onmouseover Javascript handler.
324 *
325 * @param onmouseover the new onmouseover value
326 */
327 final public void setOnmouseover(String onmouseover)
328 {
329 setProperty(ONMOUSEOVER_KEY, (onmouseover));
330 }
331
332 /**
333 * Gets an onmousemove Javascript handler.
334 *
335 * @return the new onmousemove value
336 */
337 final public String getOnmousemove()
338 {
339 return ComponentUtils.resolveString(getProperty(ONMOUSEMOVE_KEY));
340 }
341
342 /**
343 * Sets an onmousemove Javascript handler.
344 *
345 * @param onmousemove the new onmousemove value
346 */
347 final public void setOnmousemove(String onmousemove)
348 {
349 setProperty(ONMOUSEMOVE_KEY, (onmousemove));
350 }
351
352 /**
353 * Gets an onmouseout Javascript handler.
354 *
355 * @return the new onmouseout value
356 */
357 final public String getOnmouseout()
358 {
359 return ComponentUtils.resolveString(getProperty(ONMOUSEOUT_KEY));
360 }
361
362 /**
363 * Sets an onmouseout Javascript handler.
364 *
365 * @param onmouseout the new onmouseout value
366 */
367 final public void setOnmouseout(String onmouseout)
368 {
369 setProperty(ONMOUSEOUT_KEY, (onmouseout));
370 }
371
372 /**
373 * Gets an onkeypress Javascript handler.
374 *
375 * @return the new onkeypress value
376 */
377 final public String getOnkeypress()
378 {
379 return ComponentUtils.resolveString(getProperty(ONKEYPRESS_KEY));
380 }
381
382 /**
383 * Sets an onkeypress Javascript handler.
384 *
385 * @param onkeypress the new onkeypress value
386 */
387 final public void setOnkeypress(String onkeypress)
388 {
389 setProperty(ONKEYPRESS_KEY, (onkeypress));
390 }
391
392 /**
393 * Gets an onkeydown Javascript handler.
394 *
395 * @return the new onkeydown value
396 */
397 final public String getOnkeydown()
398 {
399 return ComponentUtils.resolveString(getProperty(ONKEYDOWN_KEY));
400 }
401
402 /**
403 * Sets an onkeydown Javascript handler.
404 *
405 * @param onkeydown the new onkeydown value
406 */
407 final public void setOnkeydown(String onkeydown)
408 {
409 setProperty(ONKEYDOWN_KEY, (onkeydown));
410 }
411
412 /**
413 * Gets an onkeyup Javascript handler.
414 *
415 * @return the new onkeyup value
416 */
417 final public String getOnkeyup()
418 {
419 return ComponentUtils.resolveString(getProperty(ONKEYUP_KEY));
420 }
421
422 /**
423 * Sets an onkeyup Javascript handler.
424 *
425 * @param onkeyup the new onkeyup value
426 */
427 final public void setOnkeyup(String onkeyup)
428 {
429 setProperty(ONKEYUP_KEY, (onkeyup));
430 }
431
432 /**
433 * Gets the URI specifying the location of the image resource.
434 *
435 * @return the new source value
436 */
437 final public String getSource()
438 {
439 return ComponentUtils.resolveString(getProperty(SOURCE_KEY));
440 }
441
442 /**
443 * Sets the URI specifying the location of the image resource.
444 *
445 * @param source the new source value
446 */
447 final public void setSource(String source)
448 {
449 setProperty(SOURCE_KEY, (source));
450 }
451
452 /**
453 * Gets an URL that specifies a link to a long description of the image.
454 * This description should supplement the short description.
455 *
456 * @return the new longDescURL value
457 */
458 final public String getLongDescURL()
459 {
460 return ComponentUtils.resolveString(getProperty(LONG_DESC_URL_KEY));
461 }
462
463 /**
464 * Sets an URL that specifies a link to a long description of the image.
465 * This description should supplement the short description.
466 *
467 * @param longDescURL the new longDescURL value
468 */
469 final public void setLongDescURL(String longDescURL)
470 {
471 setProperty(LONG_DESC_URL_KEY, (longDescURL));
472 }
473
474 /**
475 * Gets If a server-side image map is desired, specify "server" and place
476 * inside a CoreGoLink component. The acceptable values
477 * are "server" or "none"; defaults to "none".
478 *
479 * @return the new imageMapType value
480 */
481 final public String getImageMapType()
482 {
483 return ComponentUtils.resolveString(getProperty(IMAGE_MAP_TYPE_KEY), "none");
484 }
485
486 /**
487 * Sets If a server-side image map is desired, specify "server" and place
488 * inside a CoreGoLink component. The acceptable values
489 * are "server" or "none"; defaults to "none".
490 *
491 * @param imageMapType the new imageMapType value
492 */
493 final public void setImageMapType(String imageMapType)
494 {
495 setProperty(IMAGE_MAP_TYPE_KEY, (imageMapType));
496 }
497
498 @Override
499 public String getDefaultEventName()
500 {
501 return "click";
502 }
503
504 @Override
505 public Collection<String> getEventNames()
506 {
507 return _EVENT_NAMES;
508 }
509
510 @Override
511 public Map<String, List<ClientBehavior>> getClientBehaviors()
512 {
513 return super.getClientBehaviors();
514 }
515
516 @Override
517 public void addClientBehavior(
518 String eventName,
519 ClientBehavior behavior)
520 {
521 super.addClientBehavior(eventName, behavior);
522 }
523
524 @Override
525 public String getFamily()
526 {
527 return COMPONENT_FAMILY;
528 }
529
530 @Override
531 protected FacesBean.Type getBeanType()
532 {
533 return TYPE;
534 }
535
536 /**
537 * Construct an instance of the CoreImage.
538 */
539 protected CoreImage(
540 String rendererType
541 )
542 {
543 super(rendererType);
544 }
545
546 static
547 {
548 TYPE.lockAndRegister("org.apache.myfaces.trinidad.Object","org.apache.myfaces.trinidad.Image");
549 }
550 }