Source Code Cross Referenced for TableRowTag.java in  » Portal » gridsphere » org » gridsphere » provider » portletui » tags » 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 » Portal » gridsphere » org.gridsphere.provider.portletui.tags 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         * @author <a href="mailto:novotny@gridsphere.org">Jason Novotny</a>
003:         * @version $Id: TableRowTag.java 6385 2007-10-25 14:02:26Z wehrens $
004:         */package org.gridsphere.provider.portletui.tags;
005:
006:        import org.gridsphere.provider.portletui.beans.TableRowBean;
007:
008:        import javax.servlet.jsp.JspException;
009:        import javax.servlet.jsp.JspWriter;
010:        import javax.servlet.jsp.tagext.Tag;
011:
012:        /**
013:         * The <code>TableRowTag</code> represents a table row element that is conatined within a <code>TableTag</code>
014:         * and itself may contain <code>TableCellTag</code>s
015:         */
016:        public class TableRowTag extends BaseComponentTag {
017:
018:            protected TableRowBean rowBean = null;
019:            protected boolean isHeader = false;
020:            protected String align = null;
021:            protected String valign = null;
022:            protected boolean isZebra = false;
023:
024:            /**
025:             * Sets the table row bean
026:             *
027:             * @param tableRowBean the table row bean
028:             */
029:            public void setTableRowBean(TableRowBean tableRowBean) {
030:                rowBean = tableRowBean;
031:            }
032:
033:            /**
034:             * Returns the table row bean
035:             *
036:             * @return the table row bean
037:             */
038:            public TableRowBean getTableRowBean() {
039:                return rowBean;
040:            }
041:
042:            /**
043:             * Indicates if this table row is a table header
044:             *
045:             * @param isHeader is true if this row is a table header
046:             */
047:            public void setHeader(boolean isHeader) {
048:                this .isHeader = isHeader;
049:            }
050:
051:            /**
052:             * Indicates if this table row is a table header
053:             *
054:             * @return true if this row is a table header, false otherwise
055:             */
056:            public boolean getHeader() {
057:                return isHeader;
058:            }
059:
060:            /**
061:             * Sets the table alignment e.g. "left", "center" or "right"
062:             *
063:             * @param align the table alignment
064:             */
065:            public void setAlign(String align) {
066:                this .align = align;
067:            }
068:
069:            /**
070:             * Returns the table alignment e.g. "left", "center" or "right"
071:             *
072:             * @return the table alignment
073:             */
074:            public String getAlign() {
075:                return align;
076:            }
077:
078:            /**
079:             * Sets the table vertical alignment e.g. "top", "middle", "bottom" or "baseline"
080:             *
081:             * @param valign the table vertical alignment
082:             */
083:            public void setValign(String valign) {
084:                this .valign = valign;
085:            }
086:
087:            /**
088:             * Returns the table vertical alignment e.g. "top", "middle", "bottom" or "baseline"
089:             *
090:             * @return the table vertical alignment
091:             */
092:            public String getValign() {
093:                return valign;
094:            }
095:
096:            public void setZebra(boolean isZebra) {
097:                this .isZebra = isZebra;
098:            }
099:
100:            public boolean getZebra() {
101:                return isZebra;
102:            }
103:
104:            public void release() {
105:                rowBean = null;
106:                isHeader = false;
107:                align = null;
108:                valign = null;
109:                isZebra = false;
110:                super .release();
111:            }
112:
113:            public int doStartTag() throws JspException {
114:
115:                Tag parent = this .getParent();
116:                if (parent instanceof  TableTag) {
117:                    TableTag tableTag = (TableTag) parent;
118:                    int maxrows = tableTag.getMaxrows();
119:                    boolean filter = tableTag.getFilter();
120:                    // logic to determine if alternate (darkened row) should be set
121:                    if (tableTag.getZebra()) {
122:                        if ((tableTag.getRowCount() % 2) == 0) {
123:                            isZebra = true;
124:                        } else {
125:                            isZebra = false;
126:                        }
127:                    }
128:
129:                    // logic to determine what rows to display if table is broken into pages
130:                    if (!isHeader) {
131:                        tableTag.incrementRowCount();
132:                    }
133:
134:                    // need to determine which rows to display
135:                    int currpage = tableTag.getCurrentPage();
136:                    if (!isHeader) {
137:                        if (maxrows > 0) {
138:                            if (!filter) {
139:                                if ((tableTag.getRowCount() <= maxrows
140:                                        * currpage)
141:                                        || (tableTag.getRowCount() > maxrows
142:                                                * (currpage + 1))) {
143:                                    return EVAL_PAGE;
144:                                }
145:                            }
146:                        }
147:                    }
148:                }
149:
150:                if (!beanId.equals("")) {
151:                    rowBean = (TableRowBean) getTagBean();
152:                    if (rowBean == null)
153:                        rowBean = new TableRowBean();
154:                } else {
155:                    rowBean = new TableRowBean();
156:                    rowBean.setHeader(isHeader);
157:                    if (align != null)
158:                        rowBean.setAlign(align);
159:                    if (valign != null)
160:                        rowBean.setValign(valign);
161:                    if (cssStyle != null)
162:                        rowBean.setCssStyle(cssStyle);
163:                    if (cssClass != null)
164:                        rowBean.setCssClass(cssClass);
165:                }
166:
167:                rowBean.setZebra(isZebra);
168:
169:                try {
170:                    JspWriter out = pageContext.getOut();
171:                    out.print(rowBean.toStartString());
172:                } catch (Exception e) {
173:                    throw new JspException(e.getMessage());
174:                }
175:                return EVAL_BODY_INCLUDE;
176:            }
177:
178:            public int doEndTag() throws JspException {
179:                try {
180:                    JspWriter out = pageContext.getOut();
181:                    out.print(rowBean.toEndString());
182:                } catch (Exception e) {
183:                    throw new JspException(e.getMessage());
184:                }
185:                isZebra = false;
186:                super.doEndTag();
187:                return EVAL_PAGE;
188:            }
189:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.