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