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