Source Code Cross Referenced for EditableListBase.java in  » IDE-Netbeans » visualweb.api.designer » com » sun » rave » web » ui » component » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » IDE Netbeans » visualweb.api.designer » com.sun.rave.web.ui.component 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003:         *
004:         * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
005:         *
006:         * The contents of this file are subject to the terms of either the GNU
007:         * General Public License Version 2 only ("GPL") or the Common
008:         * Development and Distribution License("CDDL") (collectively, the
009:         * "License"). You may not use this file except in compliance with the
010:         * License. You can obtain a copy of the License at
011:         * http://www.netbeans.org/cddl-gplv2.html
012:         * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
013:         * specific language governing permissions and limitations under the
014:         * License.  When distributing the software, include this License Header
015:         * Notice in each file and include the License file at
016:         * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
017:         * particular file as subject to the "Classpath" exception as provided
018:         * by Sun in the GPL Version 2 section of the License file that
019:         * accompanied this code. If applicable, add the following below the
020:         * License Header, with the fields enclosed by brackets [] replaced by
021:         * your own identifying information:
022:         * "Portions Copyrighted [year] [name of copyright owner]"
023:         *
024:         * Contributor(s):
025:         *
026:         * The Original Software is NetBeans. The Initial Developer of the Original
027:         * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
028:         * Microsystems, Inc. All Rights Reserved.
029:         *
030:         * If you wish your version of this file to be governed by only the CDDL
031:         * or only the GPL Version 2, indicate your decision by adding
032:         * "[Contributor] elects to include this software in this distribution
033:         * under the [CDDL or GPL Version 2] license." If you do not indicate a
034:         * single choice of license, a recipient has the option to distribute
035:         * your version of this file under either the CDDL, the GPL Version 2 or
036:         * to extend the choice of license to its licensees as provided above.
037:         * However, if you add GPL Version 2 code and therefore, elected the GPL
038:         * Version 2 license, then the option applies only if the new code is
039:         * made subject to such option by the copyright holder.
040:         */
041:        package com.sun.rave.web.ui.component;
042:
043:        import java.io.IOException;
044:        import javax.faces.component.UIComponent;
045:        import javax.faces.context.FacesContext;
046:        import javax.faces.el.MethodBinding;
047:        import javax.faces.el.ValueBinding;
048:
049:        /**
050:         * <h4>About this tag</h4>
051:         * 
052:         *     <p>This tag renders an EditableList component. Use this component
053:         *     when web application users need to create and modify a list of
054:         *     strings. The application user can add new strings by typing them
055:         *     into the textfield and clicking the "Add" button, and remove them
056:         *     by selecting one or more items from the list and clicking the
057:         *     "Remove" button.</p>  
058:         * 
059:         *     <h4>Configuring the <code>ui:editableList</code> tag</h4>
060:         * 
061:         *     <p> Use the <code>list</code> attribute to bind the component
062:         *     to a model. The value must be an EL expression that corresponds to
063:         *     a managed bean or a property of a managed bean, and it must
064:         *     evaluate to an array of  <code>java.lang.String</code>. 
065:         *     </p> 
066:         * 
067:         *     <p>To set the label of the textfield, use the
068:         *     <code>fieldLabel</code> attribute. To set the label of the
069:         *     textfield, use the <code>listLabel</code> attribute. To validate
070:         *     new items, use the <code>fieldValidator</code> attribute; to
071:         *     validate the contents of the list once the user has finished
072:         *     adding and removing items, specify a <code>labelValidator</code>.</p> 
073:         * 
074:         *     <h4>Facets</h4>
075:         * 
076:         *     <ul>
077:         *     <li><code>fieldLabel</code>: use this facet to specify a custom 
078:         *     component for the textfield label.</li>
079:         *     <li><code>listLabel</code>: use this facet to specify a custom 
080:         *     component for the textfield label.</li>
081:         *     <li><code>field</code>: use this facet to specify a custom 
082:         *     component for the textfield.</li>
083:         *      <li><code>addButton</code>: use this facet to specify a custom 
084:         *     component for the add button.</li>
085:         *      <li><code>removeButton</code>: use this facet to specify a custom 
086:         *     component for the remove button.</li>
087:         *     <li><code>search</code>: use this facet to specify a custom 
088:         *     component for the search button. The component is rendered
089:         *     on the same row as the text field and the "Add" button, 
090:         *     after the "Add" button.</li>
091:         *     <li><code>readOnly</code>: use this facet to specify a custom 
092:         *     component for display a readonly version of the component.</li>
093:         *     <li><code>header</code>: use this facet to specify a header,
094:         *     rendered in a table row above the component.</li>
095:         *     <li><code>footer</code>: use this facet to specify a header,
096:         *     rendered in a table row below the component.</li>
097:         *     </ul>
098:         * 
099:         *     <h4>Client-side JavaScript functions</h4>
100:         * 
101:         *     <ul>
102:         *     <li>NONE yet</li> 
103:         *     </ul>
104:         * 
105:         *     <h4>Example</h4>
106:         * <pre>
107:         *         &lt;ui:editableList id="compid"
108:         *                          list="#{ListBean.list}" 
109:         *                          fieldLabel="#{msgs.textfield_label}"
110:         *                          listLabel="#{msgs.list_label}"
111:         *                          sorted="true" 
112:         * 			 searchButton="true"
113:         *                          fieldValidator="#{ListBean.validateNewItem}"
114:         *                          listValidator="#{ListBean.validateList}"/&gt;
115:         * 
116:         * </pre>
117:         * <p>Auto-generated component class.
118:         * Do <strong>NOT</strong> modify; all changes
119:         * <strong>will</strong> be lost!</p>
120:         */
121:
122:        public abstract class EditableListBase extends
123:                javax.faces.component.UIInput {
124:
125:            /**
126:             * <p>Construct a new <code>EditableListBase</code>.</p>
127:             */
128:            public EditableListBase() {
129:                super ();
130:                setRendererType("com.sun.rave.web.ui.EditableList");
131:            }
132:
133:            /**
134:             * <p>Return the identifier of the component family to which this
135:             * component belongs.  This identifier, in conjunction with the value
136:             * of the <code>rendererType</code> property, may be used to select
137:             * the appropriate {@link Renderer} for this component instance.</p>
138:             */
139:            public String getFamily() {
140:                return "com.sun.rave.web.ui.EditableList";
141:            }
142:
143:            /**
144:             * <p>Return the <code>ValueBinding</code> stored for the
145:             * specified name (if any), respecting any property aliases.</p>
146:             *
147:             * @param name Name of value binding to retrieve
148:             */
149:            public ValueBinding getValueBinding(String name) {
150:                if (name.equals("list")) {
151:                    return super .getValueBinding("value");
152:                }
153:                if (name.equals("listValidator")) {
154:                    return super .getValueBinding("validator");
155:                }
156:                return super .getValueBinding(name);
157:            }
158:
159:            /**
160:             * <p>Set the <code>ValueBinding</code> stored for the
161:             * specified name (if any), respecting any property
162:             * aliases.</p>
163:             *
164:             * @param name    Name of value binding to set
165:             * @param binding ValueBinding to set, or null to remove
166:             */
167:            public void setValueBinding(String name, ValueBinding binding) {
168:                if (name.equals("list")) {
169:                    super .setValueBinding("value", binding);
170:                    return;
171:                }
172:                if (name.equals("listValidator")) {
173:                    super .setValueBinding("validator", binding);
174:                    return;
175:                }
176:                super .setValueBinding(name, binding);
177:            }
178:
179:            // disabled
180:            private boolean disabled = false;
181:            private boolean disabled_set = false;
182:
183:            /**
184:             * <p>Flag indicating that the user is not permitted to activate this
185:             *         component, and that the component's value will not be submitted with the
186:             *         form.</p>
187:             */
188:            public boolean isDisabled() {
189:                if (this .disabled_set) {
190:                    return this .disabled;
191:                }
192:                ValueBinding _vb = getValueBinding("disabled");
193:                if (_vb != null) {
194:                    Object _result = _vb.getValue(getFacesContext());
195:                    if (_result == null) {
196:                        return false;
197:                    } else {
198:                        return ((Boolean) _result).booleanValue();
199:                    }
200:                }
201:                return false;
202:            }
203:
204:            /**
205:             * <p>Flag indicating that the user is not permitted to activate this
206:             *         component, and that the component's value will not be submitted with the
207:             *         form.</p>
208:             * @see #isDisabled()
209:             */
210:            public void setDisabled(boolean disabled) {
211:                this .disabled = disabled;
212:                this .disabled_set = true;
213:            }
214:
215:            // fieldLabel
216:            private String fieldLabel = null;
217:
218:            /**
219:             * <p>The label of the text field</p>
220:             */
221:            public String getFieldLabel() {
222:                if (this .fieldLabel != null) {
223:                    return this .fieldLabel;
224:                }
225:                ValueBinding _vb = getValueBinding("fieldLabel");
226:                if (_vb != null) {
227:                    return (String) _vb.getValue(getFacesContext());
228:                }
229:                return null;
230:            }
231:
232:            /**
233:             * <p>The label of the text field</p>
234:             * @see #getFieldLabel()
235:             */
236:            public void setFieldLabel(String fieldLabel) {
237:                this .fieldLabel = fieldLabel;
238:            }
239:
240:            // fieldValidator
241:            private javax.faces.el.MethodBinding fieldValidator = null;
242:
243:            /**
244:             * <p>
245:             *           A validator which will be applied to entries made into the
246:             * 	  textfield. Specify this to be the <code>validate()</code>
247:             * 	  method of a <code>javax.faces.validator.Validator</code>, or
248:             * 	  to another method with the same argument structure and
249:             * 	  exceptions.  </p>
250:             */
251:            public javax.faces.el.MethodBinding getFieldValidator() {
252:                if (this .fieldValidator != null) {
253:                    return this .fieldValidator;
254:                }
255:                ValueBinding _vb = getValueBinding("fieldValidator");
256:                if (_vb != null) {
257:                    return (javax.faces.el.MethodBinding) _vb
258:                            .getValue(getFacesContext());
259:                }
260:                return null;
261:            }
262:
263:            /**
264:             * <p>
265:             *           A validator which will be applied to entries made into the
266:             * 	  textfield. Specify this to be the <code>validate()</code>
267:             * 	  method of a <code>javax.faces.validator.Validator</code>, or
268:             * 	  to another method with the same argument structure and
269:             * 	  exceptions.  </p>
270:             * @see #getFieldValidator()
271:             */
272:            public void setFieldValidator(
273:                    javax.faces.el.MethodBinding fieldValidator) {
274:                this .fieldValidator = fieldValidator;
275:            }
276:
277:            // labelLevel
278:            private int labelLevel = Integer.MIN_VALUE;
279:            private boolean labelLevel_set = false;
280:
281:            /**
282:             * <p>Sets the style level for the generated labels. Valid values
283:             * 	are 1 (largest), 2 and 3 (smallest). The default value is 2.</p>
284:             */
285:            public int getLabelLevel() {
286:                if (this .labelLevel_set) {
287:                    return this .labelLevel;
288:                }
289:                ValueBinding _vb = getValueBinding("labelLevel");
290:                if (_vb != null) {
291:                    Object _result = _vb.getValue(getFacesContext());
292:                    if (_result == null) {
293:                        return Integer.MIN_VALUE;
294:                    } else {
295:                        return ((Integer) _result).intValue();
296:                    }
297:                }
298:                return 2;
299:            }
300:
301:            /**
302:             * <p>Sets the style level for the generated labels. Valid values
303:             * 	are 1 (largest), 2 and 3 (smallest). The default value is 2.</p>
304:             * @see #getLabelLevel()
305:             */
306:            public void setLabelLevel(int labelLevel) {
307:                this .labelLevel = labelLevel;
308:                this .labelLevel_set = true;
309:            }
310:
311:            // list
312:            /**
313:             * <p>
314:             *       The object that represents the list. It must be a JavaServer
315:             *       Faces EL expression that evaluates to an array of Objects or to
316:             *       a <code>java.util.List</code>.</p>
317:             */
318:            public Object getList() {
319:                return getValue();
320:            }
321:
322:            /**
323:             * <p>
324:             *       The object that represents the list. It must be a JavaServer
325:             *       Faces EL expression that evaluates to an array of Objects or to
326:             *       a <code>java.util.List</code>.</p>
327:             * @see #getList()
328:             */
329:            public void setList(Object list) {
330:                setValue(list);
331:            }
332:
333:            // listLabel
334:            private String listLabel = null;
335:
336:            /**
337:             * <p>The label of the list</p>
338:             */
339:            public String getListLabel() {
340:                if (this .listLabel != null) {
341:                    return this .listLabel;
342:                }
343:                ValueBinding _vb = getValueBinding("listLabel");
344:                if (_vb != null) {
345:                    return (String) _vb.getValue(getFacesContext());
346:                }
347:                return null;
348:            }
349:
350:            /**
351:             * <p>The label of the list</p>
352:             * @see #getListLabel()
353:             */
354:            public void setListLabel(String listLabel) {
355:                this .listLabel = listLabel;
356:            }
357:
358:            // listOnTop
359:            private boolean listOnTop = false;
360:            private boolean listOnTop_set = false;
361:
362:            /**
363:             * <p>Flag indicating whether the list should be on top of the
364:             * 	textfield or vice versa. By default, the textfield is on top.</p>
365:             */
366:            public boolean isListOnTop() {
367:                if (this .listOnTop_set) {
368:                    return this .listOnTop;
369:                }
370:                ValueBinding _vb = getValueBinding("listOnTop");
371:                if (_vb != null) {
372:                    Object _result = _vb.getValue(getFacesContext());
373:                    if (_result == null) {
374:                        return false;
375:                    } else {
376:                        return ((Boolean) _result).booleanValue();
377:                    }
378:                }
379:                return false;
380:            }
381:
382:            /**
383:             * <p>Flag indicating whether the list should be on top of the
384:             * 	textfield or vice versa. By default, the textfield is on top.</p>
385:             * @see #isListOnTop()
386:             */
387:            public void setListOnTop(boolean listOnTop) {
388:                this .listOnTop = listOnTop;
389:                this .listOnTop_set = true;
390:            }
391:
392:            // listValidator
393:            /**
394:             * <p>
395:             *       A validator which will be applied to the contents of the list
396:             *       (e.g. to verify that the list has a minimum number of
397:             *       entries). Specify this to be the <code>validate()</code>
398:             * 	  method of a <code>javax.faces.validator.Validator</code>, or
399:             * 	  to another method with the same argument structure and
400:             * 	  exceptions.  </p>
401:             */
402:            public javax.faces.el.MethodBinding getListValidator() {
403:                return getValidator();
404:            }
405:
406:            /**
407:             * <p>
408:             *       A validator which will be applied to the contents of the list
409:             *       (e.g. to verify that the list has a minimum number of
410:             *       entries). Specify this to be the <code>validate()</code>
411:             * 	  method of a <code>javax.faces.validator.Validator</code>, or
412:             * 	  to another method with the same argument structure and
413:             * 	  exceptions.  </p>
414:             * @see #getListValidator()
415:             */
416:            public void setListValidator(
417:                    javax.faces.el.MethodBinding listValidator) {
418:                setValidator(listValidator);
419:            }
420:
421:            // maxLength
422:            private int maxLength = Integer.MIN_VALUE;
423:            private boolean maxLength_set = false;
424:
425:            /**
426:             * <p>The maximum number of characters allowed for each string in the list.</p>
427:             */
428:            public int getMaxLength() {
429:                if (this .maxLength_set) {
430:                    return this .maxLength;
431:                }
432:                ValueBinding _vb = getValueBinding("maxLength");
433:                if (_vb != null) {
434:                    Object _result = _vb.getValue(getFacesContext());
435:                    if (_result == null) {
436:                        return Integer.MIN_VALUE;
437:                    } else {
438:                        return ((Integer) _result).intValue();
439:                    }
440:                }
441:                return 25;
442:            }
443:
444:            /**
445:             * <p>The maximum number of characters allowed for each string in the list.</p>
446:             * @see #getMaxLength()
447:             */
448:            public void setMaxLength(int maxLength) {
449:                this .maxLength = maxLength;
450:                this .maxLength_set = true;
451:            }
452:
453:            // multiple
454:            private boolean multiple = false;
455:            private boolean multiple_set = false;
456:
457:            /**
458:             * <p>Flag indicating that the application user may make select
459:             * 	more than one option from the listbox .</p>
460:             */
461:            public boolean isMultiple() {
462:                if (this .multiple_set) {
463:                    return this .multiple;
464:                }
465:                ValueBinding _vb = getValueBinding("multiple");
466:                if (_vb != null) {
467:                    Object _result = _vb.getValue(getFacesContext());
468:                    if (_result == null) {
469:                        return false;
470:                    } else {
471:                        return ((Boolean) _result).booleanValue();
472:                    }
473:                }
474:                return false;
475:            }
476:
477:            /**
478:             * <p>Flag indicating that the application user may make select
479:             * 	more than one option from the listbox .</p>
480:             * @see #isMultiple()
481:             */
482:            public void setMultiple(boolean multiple) {
483:                this .multiple = multiple;
484:                this .multiple_set = true;
485:            }
486:
487:            // readOnly
488:            private boolean readOnly = false;
489:            private boolean readOnly_set = false;
490:
491:            /**
492:             * <p>If this attribute is set to true, the value of the component is
493:             *       rendered as text, preceded by the label if one was defined.</p>
494:             */
495:            public boolean isReadOnly() {
496:                if (this .readOnly_set) {
497:                    return this .readOnly;
498:                }
499:                ValueBinding _vb = getValueBinding("readOnly");
500:                if (_vb != null) {
501:                    Object _result = _vb.getValue(getFacesContext());
502:                    if (_result == null) {
503:                        return false;
504:                    } else {
505:                        return ((Boolean) _result).booleanValue();
506:                    }
507:                }
508:                return false;
509:            }
510:
511:            /**
512:             * <p>If this attribute is set to true, the value of the component is
513:             *       rendered as text, preceded by the label if one was defined.</p>
514:             * @see #isReadOnly()
515:             */
516:            public void setReadOnly(boolean readOnly) {
517:                this .readOnly = readOnly;
518:                this .readOnly_set = true;
519:            }
520:
521:            // rows
522:            private int rows = Integer.MIN_VALUE;
523:            private boolean rows_set = false;
524:
525:            /**
526:             * <p>The number of items to display. The default value is 6.</p>
527:             */
528:            public int getRows() {
529:                if (this .rows_set) {
530:                    return this .rows;
531:                }
532:                ValueBinding _vb = getValueBinding("rows");
533:                if (_vb != null) {
534:                    Object _result = _vb.getValue(getFacesContext());
535:                    if (_result == null) {
536:                        return Integer.MIN_VALUE;
537:                    } else {
538:                        return ((Integer) _result).intValue();
539:                    }
540:                }
541:                return 6;
542:            }
543:
544:            /**
545:             * <p>The number of items to display. The default value is 6.</p>
546:             * @see #getRows()
547:             */
548:            public void setRows(int rows) {
549:                this .rows = rows;
550:                this .rows_set = true;
551:            }
552:
553:            // sorted
554:            private boolean sorted = false;
555:            private boolean sorted_set = false;
556:
557:            /**
558:             * <p>Set this attribute to true if the list items should be
559:             *       sorted. The sorting is performed using a Collator configured
560:             *       with the locale from the FacesContext.</p>
561:             */
562:            public boolean isSorted() {
563:                if (this .sorted_set) {
564:                    return this .sorted;
565:                }
566:                ValueBinding _vb = getValueBinding("sorted");
567:                if (_vb != null) {
568:                    Object _result = _vb.getValue(getFacesContext());
569:                    if (_result == null) {
570:                        return false;
571:                    } else {
572:                        return ((Boolean) _result).booleanValue();
573:                    }
574:                }
575:                return false;
576:            }
577:
578:            /**
579:             * <p>Set this attribute to true if the list items should be
580:             *       sorted. The sorting is performed using a Collator configured
581:             *       with the locale from the FacesContext.</p>
582:             * @see #isSorted()
583:             */
584:            public void setSorted(boolean sorted) {
585:                this .sorted = sorted;
586:                this .sorted_set = true;
587:            }
588:
589:            // style
590:            private String style = null;
591:
592:            /**
593:             * <p>CSS style(s) to be applied when this component is rendered.</p>
594:             */
595:            public String getStyle() {
596:                if (this .style != null) {
597:                    return this .style;
598:                }
599:                ValueBinding _vb = getValueBinding("style");
600:                if (_vb != null) {
601:                    return (String) _vb.getValue(getFacesContext());
602:                }
603:                return null;
604:            }
605:
606:            /**
607:             * <p>CSS style(s) to be applied when this component is rendered.</p>
608:             * @see #getStyle()
609:             */
610:            public void setStyle(String style) {
611:                this .style = style;
612:            }
613:
614:            // styleClass
615:            private String styleClass = null;
616:
617:            /**
618:             * <p>CSS style class(es) to be applied when this component is rendered.</p>
619:             */
620:            public String getStyleClass() {
621:                if (this .styleClass != null) {
622:                    return this .styleClass;
623:                }
624:                ValueBinding _vb = getValueBinding("styleClass");
625:                if (_vb != null) {
626:                    return (String) _vb.getValue(getFacesContext());
627:                }
628:                return null;
629:            }
630:
631:            /**
632:             * <p>CSS style class(es) to be applied when this component is rendered.</p>
633:             * @see #getStyleClass()
634:             */
635:            public void setStyleClass(String styleClass) {
636:                this .styleClass = styleClass;
637:            }
638:
639:            // tabIndex
640:            private int tabIndex = Integer.MIN_VALUE;
641:            private boolean tabIndex_set = false;
642:
643:            /**
644:             * <p>The position of this component in the tabbing order sequence</p>
645:             */
646:            public int getTabIndex() {
647:                if (this .tabIndex_set) {
648:                    return this .tabIndex;
649:                }
650:                ValueBinding _vb = getValueBinding("tabIndex");
651:                if (_vb != null) {
652:                    Object _result = _vb.getValue(getFacesContext());
653:                    if (_result == null) {
654:                        return Integer.MIN_VALUE;
655:                    } else {
656:                        return ((Integer) _result).intValue();
657:                    }
658:                }
659:                return Integer.MIN_VALUE;
660:            }
661:
662:            /**
663:             * <p>The position of this component in the tabbing order sequence</p>
664:             * @see #getTabIndex()
665:             */
666:            public void setTabIndex(int tabIndex) {
667:                this .tabIndex = tabIndex;
668:                this .tabIndex_set = true;
669:            }
670:
671:            // toolTip
672:            private String toolTip = null;
673:
674:            /**
675:             * <p>Display the text as a tooltip for this component</p>
676:             */
677:            public String getToolTip() {
678:                if (this .toolTip != null) {
679:                    return this .toolTip;
680:                }
681:                ValueBinding _vb = getValueBinding("toolTip");
682:                if (_vb != null) {
683:                    return (String) _vb.getValue(getFacesContext());
684:                }
685:                return null;
686:            }
687:
688:            /**
689:             * <p>Display the text as a tooltip for this component</p>
690:             * @see #getToolTip()
691:             */
692:            public void setToolTip(String toolTip) {
693:                this .toolTip = toolTip;
694:            }
695:
696:            // visible
697:            private boolean visible = false;
698:            private boolean visible_set = false;
699:
700:            /**
701:             * <p>Use the visible attribute to indicate whether the component should be
702:             *     viewable by the user in the rendered HTML page. If set to false, the
703:             *     HTML code for the component is present in the page, but the component
704:             *     is hidden with style attributes. By default, visible is set to true, so
705:             *     HTML for the component HTML is included and visible to the user. If the
706:             *     component is not visible, it can still be processed on subsequent form
707:             *     submissions because the HTML is present.</p>
708:             */
709:            public boolean isVisible() {
710:                if (this .visible_set) {
711:                    return this .visible;
712:                }
713:                ValueBinding _vb = getValueBinding("visible");
714:                if (_vb != null) {
715:                    Object _result = _vb.getValue(getFacesContext());
716:                    if (_result == null) {
717:                        return false;
718:                    } else {
719:                        return ((Boolean) _result).booleanValue();
720:                    }
721:                }
722:                return true;
723:            }
724:
725:            /**
726:             * <p>Use the visible attribute to indicate whether the component should be
727:             *     viewable by the user in the rendered HTML page. If set to false, the
728:             *     HTML code for the component is present in the page, but the component
729:             *     is hidden with style attributes. By default, visible is set to true, so
730:             *     HTML for the component HTML is included and visible to the user. If the
731:             *     component is not visible, it can still be processed on subsequent form
732:             *     submissions because the HTML is present.</p>
733:             * @see #isVisible()
734:             */
735:            public void setVisible(boolean visible) {
736:                this .visible = visible;
737:                this .visible_set = true;
738:            }
739:
740:            /**
741:             * <p>Restore the state of this component.</p>
742:             */
743:            public void restoreState(FacesContext _context, Object _state) {
744:                Object _values[] = (Object[]) _state;
745:                super .restoreState(_context, _values[0]);
746:                this .disabled = ((Boolean) _values[1]).booleanValue();
747:                this .disabled_set = ((Boolean) _values[2]).booleanValue();
748:                this .fieldLabel = (String) _values[3];
749:                this .fieldValidator = (javax.faces.el.MethodBinding) restoreAttachedState(
750:                        _context, _values[4]);
751:                this .labelLevel = ((Integer) _values[5]).intValue();
752:                this .labelLevel_set = ((Boolean) _values[6]).booleanValue();
753:                this .listLabel = (String) _values[7];
754:                this .listOnTop = ((Boolean) _values[8]).booleanValue();
755:                this .listOnTop_set = ((Boolean) _values[9]).booleanValue();
756:                this .maxLength = ((Integer) _values[10]).intValue();
757:                this .maxLength_set = ((Boolean) _values[11]).booleanValue();
758:                this .multiple = ((Boolean) _values[12]).booleanValue();
759:                this .multiple_set = ((Boolean) _values[13]).booleanValue();
760:                this .readOnly = ((Boolean) _values[14]).booleanValue();
761:                this .readOnly_set = ((Boolean) _values[15]).booleanValue();
762:                this .rows = ((Integer) _values[16]).intValue();
763:                this .rows_set = ((Boolean) _values[17]).booleanValue();
764:                this .sorted = ((Boolean) _values[18]).booleanValue();
765:                this .sorted_set = ((Boolean) _values[19]).booleanValue();
766:                this .style = (String) _values[20];
767:                this .styleClass = (String) _values[21];
768:                this .tabIndex = ((Integer) _values[22]).intValue();
769:                this .tabIndex_set = ((Boolean) _values[23]).booleanValue();
770:                this .toolTip = (String) _values[24];
771:                this .visible = ((Boolean) _values[25]).booleanValue();
772:                this .visible_set = ((Boolean) _values[26]).booleanValue();
773:            }
774:
775:            /**
776:             * <p>Save the state of this component.</p>
777:             */
778:            public Object saveState(FacesContext _context) {
779:                Object _values[] = new Object[27];
780:                _values[0] = super .saveState(_context);
781:                _values[1] = this .disabled ? Boolean.TRUE : Boolean.FALSE;
782:                _values[2] = this .disabled_set ? Boolean.TRUE : Boolean.FALSE;
783:                _values[3] = this .fieldLabel;
784:                _values[4] = saveAttachedState(_context, fieldValidator);
785:                _values[5] = new Integer(this .labelLevel);
786:                _values[6] = this .labelLevel_set ? Boolean.TRUE : Boolean.FALSE;
787:                _values[7] = this .listLabel;
788:                _values[8] = this .listOnTop ? Boolean.TRUE : Boolean.FALSE;
789:                _values[9] = this .listOnTop_set ? Boolean.TRUE : Boolean.FALSE;
790:                _values[10] = new Integer(this .maxLength);
791:                _values[11] = this .maxLength_set ? Boolean.TRUE : Boolean.FALSE;
792:                _values[12] = this .multiple ? Boolean.TRUE : Boolean.FALSE;
793:                _values[13] = this .multiple_set ? Boolean.TRUE : Boolean.FALSE;
794:                _values[14] = this .readOnly ? Boolean.TRUE : Boolean.FALSE;
795:                _values[15] = this .readOnly_set ? Boolean.TRUE : Boolean.FALSE;
796:                _values[16] = new Integer(this .rows);
797:                _values[17] = this .rows_set ? Boolean.TRUE : Boolean.FALSE;
798:                _values[18] = this .sorted ? Boolean.TRUE : Boolean.FALSE;
799:                _values[19] = this .sorted_set ? Boolean.TRUE : Boolean.FALSE;
800:                _values[20] = this .style;
801:                _values[21] = this .styleClass;
802:                _values[22] = new Integer(this .tabIndex);
803:                _values[23] = this .tabIndex_set ? Boolean.TRUE : Boolean.FALSE;
804:                _values[24] = this .toolTip;
805:                _values[25] = this .visible ? Boolean.TRUE : Boolean.FALSE;
806:                _values[26] = this.visible_set ? Boolean.TRUE : Boolean.FALSE;
807:                return _values;
808:            }
809:
810:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.