Source Code Cross Referenced for DataLineRenderer.java in  » ERP-CRM-Financial » sakai » org » sakaiproject » jsf » renderer » 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 » ERP CRM Financial » sakai » org.sakaiproject.jsf.renderer 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**********************************************************************************
002:         * $URL: https://source.sakaiproject.org/svn/jsf/tags/sakai_2-4-1/widgets/src/java/org/sakaiproject/jsf/renderer/DataLineRenderer.java $
003:         * $Id: DataLineRenderer.java 9278 2006-05-10 23:29:21Z ray@media.berkeley.edu $
004:         ***********************************************************************************
005:         *
006:         * Copyright (c) 2003, 2004 The Sakai Foundation.
007:         *
008:         * Licensed under the Educational Community License, Version 1.0 (the "License");
009:         * you may not use this file except in compliance with the License.
010:         * You may obtain a copy of the License at
011:         *
012:         *      http://www.opensource.org/licenses/ecl1.php
013:         *
014:         * Unless required by applicable law or agreed to in writing, software
015:         * distributed under the License is distributed on an "AS IS" BASIS,
016:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017:         * See the License for the specific language governing permissions and
018:         * limitations under the License.
019:         *
020:         **********************************************************************************/package org.sakaiproject.jsf.renderer;
021:
022:        import java.io.IOException;
023:        import java.util.Iterator;
024:        import javax.faces.component.UIColumn;
025:        import javax.faces.component.UIComponent;
026:        import javax.faces.component.UIData;
027:        import javax.faces.component.UIOutput;
028:        import javax.faces.component.UIViewRoot;
029:        import javax.faces.context.FacesContext;
030:        import javax.faces.context.ResponseWriter;
031:        import javax.faces.render.Renderer;
032:
033:        import org.sakaiproject.jsf.util.RendererUtil;
034:
035:        /**
036:         * <p>Description: </p>
037:         * <p>Render a iterated data like a dataTable but without the table.</p>
038:         * <p> Based on example code by from the O'Reilley JSF book. </p>
039:         * <p>Copyright: Copyright (c) 2004</p>
040:         * <p>Organization: Sakai Project</p>
041:         * @author Ed Smiley
042:         * @version $Id: DataLineRenderer.java 9278 2006-05-10 23:29:21Z ray@media.berkeley.edu $
043:         */
044:
045:        public class DataLineRenderer extends Renderer {
046:
047:            /**
048:             * This component renders its children
049:             * @return true
050:             */
051:            public boolean getRendersChildren() {
052:                return true;
053:            }
054:
055:            /**
056:             * This is an output type component.
057:             * @param component
058:             * @return true if UIOutput
059:             */
060:            public boolean supportsComponentType(UIComponent component) {
061:                return (component instanceof  UIOutput);
062:            }
063:
064:            /**
065:             * no-op
066:             * @param context
067:             * @param component
068:             * @throws IOException
069:             */
070:            public void encodeBegin(FacesContext context, UIComponent component)
071:                    throws IOException {
072:                ;
073:            }
074:
075:            /**
076:             * We put all our processing in the encodeChildren method
077:             * @param context
078:             * @param component
079:             * @throws IOException
080:             */
081:            public void encodeChildren(FacesContext context,
082:                    UIComponent component) throws IOException {
083:                if (!component.isRendered()) {
084:                    return;
085:                }
086:
087:                String clientId = null;
088:
089:                if (component.getId() != null
090:                        && !component.getId().startsWith(
091:                                UIViewRoot.UNIQUE_ID_PREFIX)) {
092:                    clientId = component.getClientId(context);
093:                }
094:
095:                ResponseWriter writer = context.getResponseWriter();
096:
097:                if (clientId != null) {
098:                    writer.startElement("span", component);
099:                    writer.writeAttribute("id", clientId, "id");
100:                }
101:
102:                UIData data = (UIData) component;
103:
104:                int first = data.getFirst();
105:                int rows = data.getRows();
106:
107:                // this is a special separator attribute, not supported by UIData
108:                String separator = (String) RendererUtil.getAttribute(context,
109:                        component, "separator");
110:                if (separator == null)
111:                    separator = " | ";
112:
113:                for (int i = first, n = 0; n < rows; i++, n++) {
114:                    data.setRowIndex(i);
115:                    if (!data.isRowAvailable()) {
116:                        break;
117:                    }
118:
119:                    // between any two iterations add separator if there is one
120:                    if (i != first)
121:                        writer.write(separator);
122:
123:                    Iterator iter = data.getChildren().iterator();
124:                    while (iter.hasNext()) {
125:                        UIComponent column = (UIComponent) iter.next();
126:                        if (!(column instanceof  UIColumn)) {
127:                            continue;
128:                        }
129:                        RendererUtil.encodeRecursive(context, column);
130:                    }
131:                }
132:                if (clientId != null) {
133:                    writer.endElement("span");
134:                }
135:
136:            }
137:
138:            /**
139:             * no-op
140:             * @param context
141:             * @param component
142:             * @throws IOException
143:             */
144:            public void encodeEnd(FacesContext context, UIComponent component)
145:                    throws IOException {
146:                ;
147:            }
148:
149:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.