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