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.UIXOutput;
34 import org.apache.myfaces.trinidad.util.ComponentUtils;
35
36 /**
37 *
38 * <html:p>
39 * The outputFormatted bean accepts a string in its "value" attribute
40 * containing a very limited set of HTML markup and outputs formatted
41 * results. It is not intended as anything near to a generic HTML
42 * output engine, and will never be such a bean. Developers
43 * needing full HTML output should use <f:verbatim>
44 * or <tr:outputText> with escape="false".
45 * </html:p>
46 * <html:p>
47 * What this bean <html:em>does</html:em> provide is a limited
48 * ability to use a single source for translated or user-provided
49 * formatted text without further parsing or filtering or
50 * dangerous constructs (e.g., Javascript), and with some hope
51 * of successful output to non-HTML displays. It also supports
52 * more attributes than an unescaped outputText tag - for example,
53 * it supports styleClass.
54 * </html:p>
55 * <html:p>
56 * This component supports the following HTML markup:
57 * <html:ul>
58 * <html:li><br></html:li>
59 * <html:li><hr></html:li>
60 * <html:li><li>, <ol>, <ul></html:li>
61 * <html:li><p></html:li>
62 * <html:li><b></html:li>
63 * <html:li><i></html:li>
64 * <html:li><tt></html:li>
65 * <html:li><big></html:li>
66 * <html:li><small></html:li>
67 * <html:li><pre></html:li>
68 * <html:li><span></html:li>
69 * <html:li><a></html:li>
70 * </html:ul>
71 * and the following entities:
72 * <html:ul>
73 * <html:li>&lt;</html:li>
74 * <html:li>&gt;</html:li>
75 * <html:li>&amp;</html:li>
76 * <html:li>&reg;</html:li>
77 * <html:li>&copy;</html:li>
78 * <html:li>&nbsp;</html:li>
79 * <html:li>&quot;</html:li>
80 * </html:ul>
81 * </html:p>
82 * <html:p>
83 * Elements or entities other than these will be ignored. In addition,
84 * the CSS attributes ("class" and "style") and "href" are supported -
85 * all others are ignored.
86 * </html:p>
87 * <html:p>
88 * No guarantee is made that the input HTML will
89 * be output without modification. For example, paragraph
90 * and list-item elements will always be closed even if left
91 * open in the input text. Other HTML markup may be replaced
92 * with output more appropriate to the current look-and-feel
93 * or user agent.
94 * </html:p>
95 * <html:p>
96 * Note: The escaping rules are different in a .jspx file than they are in
97 * a .jsp file. See the example below.
98 * </html:p>
99 *
100 * <h4>Events:</h4>
101 * <table border="1" width="100%" cellpadding="3" summary="">
102 * <tr bgcolor="#CCCCFF" class="TableHeadingColor">
103 * <th align="left">Type</th>
104 * <th align="left">Phases</th>
105 * <th align="left">Description</th>
106 * </tr>
107 * <tr class="TableRowColor">
108 * <td valign="top"><code>org.apache.myfaces.trinidad.event.AttributeChangeEvent</code></td>
109 * <td valign="top" nowrap>Invoke<br>Application<br>Apply<br>Request<br>Values</td>
110 * <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>
111 * </tr>
112 * </table>
113 */
114 public class CoreOutputFormatted extends UIXOutput
115 implements ClientBehaviorHolder
116 {
117 static public final String STYLE_USAGE_PAGE_STAMP = "pageStamp";
118 static public final String STYLE_USAGE_INSTRUCTION = "instruction";
119 static public final String STYLE_USAGE_IN_CONTEXT_BRANDING = "inContextBranding";
120 static public final FacesBean.Type TYPE = new FacesBean.Type(
121 UIXOutput.TYPE);
122 static public final PropertyKey STYLE_USAGE_KEY =
123 TYPE.registerKey("styleUsage", String.class);
124 static public final PropertyKey INLINE_STYLE_KEY =
125 TYPE.registerKey("inlineStyle", String.class);
126 static public final PropertyKey STYLE_CLASS_KEY =
127 TYPE.registerKey("styleClass", String.class);
128 static public final PropertyKey SHORT_DESC_KEY =
129 TYPE.registerKey("shortDesc", String.class);
130 static public final PropertyKey PARTIAL_TRIGGERS_KEY =
131 TYPE.registerKey("partialTriggers", String[].class, null, 0, PropertyKey.Mutable.RARELY);
132 static public final PropertyKey ONCLICK_KEY =
133 TYPE.registerKey("onclick", String.class);
134 static public final PropertyKey ONDBLCLICK_KEY =
135 TYPE.registerKey("ondblclick", String.class);
136 static public final PropertyKey ONMOUSEDOWN_KEY =
137 TYPE.registerKey("onmousedown", String.class);
138 static public final PropertyKey ONMOUSEUP_KEY =
139 TYPE.registerKey("onmouseup", String.class);
140 static public final PropertyKey ONMOUSEOVER_KEY =
141 TYPE.registerKey("onmouseover", String.class);
142 static public final PropertyKey ONMOUSEMOVE_KEY =
143 TYPE.registerKey("onmousemove", String.class);
144 static public final PropertyKey ONMOUSEOUT_KEY =
145 TYPE.registerKey("onmouseout", String.class);
146 static public final PropertyKey ONKEYPRESS_KEY =
147 TYPE.registerKey("onkeypress", String.class);
148 static public final PropertyKey ONKEYDOWN_KEY =
149 TYPE.registerKey("onkeydown", String.class);
150 static public final PropertyKey ONKEYUP_KEY =
151 TYPE.registerKey("onkeyup", String.class);
152
153 static public final String COMPONENT_FAMILY =
154 "org.apache.myfaces.trinidad.Output";
155 static public final String COMPONENT_TYPE =
156 "org.apache.myfaces.trinidad.CoreOutputFormatted";
157 // Supported client events for client behaviors:
158 private final static Collection<String> _EVENT_NAMES = Collections.unmodifiableCollection(
159 Arrays.asList(
160 "click", "dblclick", "mousedown", "mouseup", "mouseover", "mousemove",
161 "mouseout", "keypress", "keydown", "keyup"
162 ));
163
164 /**
165 * Construct an instance of the CoreOutputFormatted.
166 */
167 public CoreOutputFormatted()
168 {
169 super("org.apache.myfaces.trinidad.Formatted");
170 }
171
172 /**
173 * Gets the style usage, intended to make it easier to
174 * put the correct style on the text.
175 * Set this attribute when the outputFormatted
176 * is for instruction text, page stamp text, or inContextBranding
177 * text.
178 * The valid values are "instruction" ,
179 * "pageStamp", and "inContextBranding".
180 * If styleUsage and styleClass attributes are both set,
181 * the styleClass attribute takes precedence.
182 *
183 * @return the new styleUsage value
184 */
185 final public String getStyleUsage()
186 {
187 return ComponentUtils.resolveString(getProperty(STYLE_USAGE_KEY));
188 }
189
190 /**
191 * Sets the style usage, intended to make it easier to
192 * put the correct style on the text.
193 * Set this attribute when the outputFormatted
194 * is for instruction text, page stamp text, or inContextBranding
195 * text.
196 * The valid values are "instruction" ,
197 * "pageStamp", and "inContextBranding".
198 * If styleUsage and styleClass attributes are both set,
199 * the styleClass attribute takes precedence.
200 *
201 * @param styleUsage the new styleUsage value
202 */
203 final public void setStyleUsage(String styleUsage)
204 {
205 setProperty(STYLE_USAGE_KEY, (styleUsage));
206 }
207
208 /**
209 * Gets the CSS styles to use for this component.
210 *
211 * @return the new inlineStyle value
212 */
213 final public String getInlineStyle()
214 {
215 return ComponentUtils.resolveString(getProperty(INLINE_STYLE_KEY));
216 }
217
218 /**
219 * Sets the CSS styles to use for this component.
220 *
221 * @param inlineStyle the new inlineStyle value
222 */
223 final public void setInlineStyle(String inlineStyle)
224 {
225 setProperty(INLINE_STYLE_KEY, (inlineStyle));
226 }
227
228 /**
229 * Gets a CSS style class to use for this component.
230 *
231 * @return the new styleClass value
232 */
233 final public String getStyleClass()
234 {
235 return ComponentUtils.resolveString(getProperty(STYLE_CLASS_KEY));
236 }
237
238 /**
239 * Sets a CSS style class to use for this component.
240 *
241 * @param styleClass the new styleClass value
242 */
243 final public void setStyleClass(String styleClass)
244 {
245 setProperty(STYLE_CLASS_KEY, (styleClass));
246 }
247
248 /**
249 * Gets The short description of the component. This text is commonly used by user agents to display tooltip help text.
250 *
251 * @return the new shortDesc value
252 */
253 final public String getShortDesc()
254 {
255 return ComponentUtils.resolveString(getProperty(SHORT_DESC_KEY));
256 }
257
258 /**
259 * Sets The short description of the component. This text is commonly used by user agents to display tooltip help text.
260 *
261 * @param shortDesc the new shortDesc value
262 */
263 final public void setShortDesc(String shortDesc)
264 {
265 setProperty(SHORT_DESC_KEY, (shortDesc));
266 }
267
268 /**
269 * Gets the IDs of the components that should trigger a partial update.
270 * <p>
271 * This component will listen on the trigger components. If one of the
272 * trigger components receives an event that will cause it to update
273 * in some way, this component will request to be updated too.</p>
274 * <p>
275 * Separate multiple triggers with a space. e.g., partialTriggers="cmp1 cmp2"
276 * </p>
277 * <p>
278 * Identifiers must account for NamingContainers. You can use a single colon to start the search from the root,
279 * or use multiple colons to move up through the NamingContainer. For example,
280 * "::" will pop out of this component's naming container (it pops out of itself if it is a naming container),
281 * ":::" will pop out of two naming containers, etc. The search for
282 * the partialTrigger begins from there. e.g., partialTriggers=":::commandButton1" the search begins for the
283 * component with id = commandButton1 after popping out of two naming containers relative to this component.
284 * To go into naming containers, you separate the naming containers with ':', e.g.,partialTriggers= "nc1:nc2:nc3:componentId".</p>
285 *
286 * @return the new partialTriggers value
287 */
288 final public String[] getPartialTriggers()
289 {
290 return (String[])getProperty(PARTIAL_TRIGGERS_KEY);
291 }
292
293 /**
294 * Sets the IDs of the components that should trigger a partial update.
295 * <p>
296 * This component will listen on the trigger components. If one of the
297 * trigger components receives an event that will cause it to update
298 * in some way, this component will request to be updated too.</p>
299 * <p>
300 * Separate multiple triggers with a space. e.g., partialTriggers="cmp1 cmp2"
301 * </p>
302 * <p>
303 * Identifiers must account for NamingContainers. You can use a single colon to start the search from the root,
304 * or use multiple colons to move up through the NamingContainer. For example,
305 * "::" will pop out of this component's naming container (it pops out of itself if it is a naming container),
306 * ":::" will pop out of two naming containers, etc. The search for
307 * the partialTrigger begins from there. e.g., partialTriggers=":::commandButton1" the search begins for the
308 * component with id = commandButton1 after popping out of two naming containers relative to this component.
309 * To go into naming containers, you separate the naming containers with ':', e.g.,partialTriggers= "nc1:nc2:nc3:componentId".</p>
310 *
311 * @param partialTriggers the new partialTriggers value
312 */
313 final public void setPartialTriggers(String[] partialTriggers)
314 {
315 setProperty(PARTIAL_TRIGGERS_KEY, (partialTriggers));
316 }
317
318 /**
319 * Gets an onclick Javascript handler.
320 *
321 * @return the new onclick value
322 */
323 final public String getOnclick()
324 {
325 return ComponentUtils.resolveString(getProperty(ONCLICK_KEY));
326 }
327
328 /**
329 * Sets an onclick Javascript handler.
330 *
331 * @param onclick the new onclick value
332 */
333 final public void setOnclick(String onclick)
334 {
335 setProperty(ONCLICK_KEY, (onclick));
336 }
337
338 /**
339 * Gets an ondblclick Javascript handler.
340 *
341 * @return the new ondblclick value
342 */
343 final public String getOndblclick()
344 {
345 return ComponentUtils.resolveString(getProperty(ONDBLCLICK_KEY));
346 }
347
348 /**
349 * Sets an ondblclick Javascript handler.
350 *
351 * @param ondblclick the new ondblclick value
352 */
353 final public void setOndblclick(String ondblclick)
354 {
355 setProperty(ONDBLCLICK_KEY, (ondblclick));
356 }
357
358 /**
359 * Gets an onmousedown Javascript handler.
360 *
361 * @return the new onmousedown value
362 */
363 final public String getOnmousedown()
364 {
365 return ComponentUtils.resolveString(getProperty(ONMOUSEDOWN_KEY));
366 }
367
368 /**
369 * Sets an onmousedown Javascript handler.
370 *
371 * @param onmousedown the new onmousedown value
372 */
373 final public void setOnmousedown(String onmousedown)
374 {
375 setProperty(ONMOUSEDOWN_KEY, (onmousedown));
376 }
377
378 /**
379 * Gets an onmouseup Javascript handler.
380 *
381 * @return the new onmouseup value
382 */
383 final public String getOnmouseup()
384 {
385 return ComponentUtils.resolveString(getProperty(ONMOUSEUP_KEY));
386 }
387
388 /**
389 * Sets an onmouseup Javascript handler.
390 *
391 * @param onmouseup the new onmouseup value
392 */
393 final public void setOnmouseup(String onmouseup)
394 {
395 setProperty(ONMOUSEUP_KEY, (onmouseup));
396 }
397
398 /**
399 * Gets an onmouseover Javascript handler.
400 *
401 * @return the new onmouseover value
402 */
403 final public String getOnmouseover()
404 {
405 return ComponentUtils.resolveString(getProperty(ONMOUSEOVER_KEY));
406 }
407
408 /**
409 * Sets an onmouseover Javascript handler.
410 *
411 * @param onmouseover the new onmouseover value
412 */
413 final public void setOnmouseover(String onmouseover)
414 {
415 setProperty(ONMOUSEOVER_KEY, (onmouseover));
416 }
417
418 /**
419 * Gets an onmousemove Javascript handler.
420 *
421 * @return the new onmousemove value
422 */
423 final public String getOnmousemove()
424 {
425 return ComponentUtils.resolveString(getProperty(ONMOUSEMOVE_KEY));
426 }
427
428 /**
429 * Sets an onmousemove Javascript handler.
430 *
431 * @param onmousemove the new onmousemove value
432 */
433 final public void setOnmousemove(String onmousemove)
434 {
435 setProperty(ONMOUSEMOVE_KEY, (onmousemove));
436 }
437
438 /**
439 * Gets an onmouseout Javascript handler.
440 *
441 * @return the new onmouseout value
442 */
443 final public String getOnmouseout()
444 {
445 return ComponentUtils.resolveString(getProperty(ONMOUSEOUT_KEY));
446 }
447
448 /**
449 * Sets an onmouseout Javascript handler.
450 *
451 * @param onmouseout the new onmouseout value
452 */
453 final public void setOnmouseout(String onmouseout)
454 {
455 setProperty(ONMOUSEOUT_KEY, (onmouseout));
456 }
457
458 /**
459 * Gets an onkeypress Javascript handler.
460 *
461 * @return the new onkeypress value
462 */
463 final public String getOnkeypress()
464 {
465 return ComponentUtils.resolveString(getProperty(ONKEYPRESS_KEY));
466 }
467
468 /**
469 * Sets an onkeypress Javascript handler.
470 *
471 * @param onkeypress the new onkeypress value
472 */
473 final public void setOnkeypress(String onkeypress)
474 {
475 setProperty(ONKEYPRESS_KEY, (onkeypress));
476 }
477
478 /**
479 * Gets an onkeydown Javascript handler.
480 *
481 * @return the new onkeydown value
482 */
483 final public String getOnkeydown()
484 {
485 return ComponentUtils.resolveString(getProperty(ONKEYDOWN_KEY));
486 }
487
488 /**
489 * Sets an onkeydown Javascript handler.
490 *
491 * @param onkeydown the new onkeydown value
492 */
493 final public void setOnkeydown(String onkeydown)
494 {
495 setProperty(ONKEYDOWN_KEY, (onkeydown));
496 }
497
498 /**
499 * Gets an onkeyup Javascript handler.
500 *
501 * @return the new onkeyup value
502 */
503 final public String getOnkeyup()
504 {
505 return ComponentUtils.resolveString(getProperty(ONKEYUP_KEY));
506 }
507
508 /**
509 * Sets an onkeyup Javascript handler.
510 *
511 * @param onkeyup the new onkeyup value
512 */
513 final public void setOnkeyup(String onkeyup)
514 {
515 setProperty(ONKEYUP_KEY, (onkeyup));
516 }
517
518 @Override
519 public String getDefaultEventName()
520 {
521 return "click";
522 }
523
524 @Override
525 public Collection<String> getEventNames()
526 {
527 return _EVENT_NAMES;
528 }
529
530 @Override
531 public Map<String, List<ClientBehavior>> getClientBehaviors()
532 {
533 return super.getClientBehaviors();
534 }
535
536 @Override
537 public void addClientBehavior(
538 String eventName,
539 ClientBehavior behavior)
540 {
541 super.addClientBehavior(eventName, behavior);
542 }
543
544 @Override
545 public String getFamily()
546 {
547 return COMPONENT_FAMILY;
548 }
549
550 @Override
551 protected FacesBean.Type getBeanType()
552 {
553 return TYPE;
554 }
555
556 /**
557 * Construct an instance of the CoreOutputFormatted.
558 */
559 protected CoreOutputFormatted(
560 String rendererType
561 )
562 {
563 super(rendererType);
564 }
565
566 static
567 {
568 TYPE.lockAndRegister("org.apache.myfaces.trinidad.Output","org.apache.myfaces.trinidad.Formatted");
569 }
570 }