Source Code Cross Referenced for PanelTag.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: PanelTag.java 6385 2007-10-25 14:02:26Z wehrens $
004:         */package org.gridsphere.provider.portletui.tags;
005:
006:        import org.gridsphere.provider.portletui.beans.PanelBean;
007:
008:        import javax.servlet.jsp.JspException;
009:        import javax.servlet.jsp.JspWriter;
010:        import java.util.StringTokenizer;
011:
012:        /**
013:         * A <code>PanelTag</code> represents a stylized table that generally conatins other <code>TableTag</code> or
014:         * <code>FrameTag</code> nested tags
015:         */
016:        public class PanelTag extends BaseComponentTag {
017:
018:            protected String width = PanelBean.PANEL_WIDTH;
019:            protected String cellSpacing = PanelBean.PANEL_SPACING;
020:            protected String cellPadding = PanelBean.PANEL_PADDING;
021:            protected String align = null;
022:            protected String border = PanelBean.PANEL_BORDER;
023:            protected String cols = "100%";
024:            protected String[] colArray;
025:            protected int numCols = 1;
026:            protected PanelBean panelBean = null;
027:            protected int counter = 0;
028:
029:            /**
030:             * Sets the panel (table) cell spacing
031:             *
032:             * @param cellPadding the panel cell padding
033:             */
034:            public void setCellpadding(String cellPadding) {
035:                this .cellPadding = cellPadding;
036:            }
037:
038:            /**
039:             * Returns the panel (table) cell padding
040:             *
041:             * @return the panel cell padding
042:             */
043:            public String getCellpadding() {
044:                return cellPadding;
045:            }
046:
047:            /**
048:             * Sets the table alignment e.g. "left", "center" or "right"
049:             *
050:             * @param align the table alignment
051:             */
052:            public void setAlign(String align) {
053:                this .align = align;
054:            }
055:
056:            /**
057:             * Returns the table alignment e.g. "left", "center" or "right"
058:             *
059:             * @return the table alignment
060:             */
061:            public String getAlign() {
062:                return align;
063:            }
064:
065:            /**
066:             * Sets the table border
067:             *
068:             * @param border the panel border
069:             */
070:            public void setBorder(String border) {
071:                this .border = border;
072:            }
073:
074:            /**
075:             * Returns the panel border
076:             *
077:             * @return the panel border
078:             */
079:            public String getBorder() {
080:                return border;
081:            }
082:
083:            /**
084:             * Sets the panel width
085:             *
086:             * @param width the panel width
087:             */
088:            public void setWidth(String width) {
089:                this .width = width;
090:            }
091:
092:            /**
093:             * Returns the panel width
094:             *
095:             * @return the panel width
096:             */
097:            public String getWidth() {
098:                return width;
099:            }
100:
101:            /**
102:             * Sets the number of columns in the panel
103:             *
104:             * @param cols the number of columns
105:             */
106:            public void setCols(String cols) {
107:                this .cols = cols;
108:            }
109:
110:            /**
111:             * Returns the number of columns in the panel
112:             *
113:             * @return the number of columns in the panel
114:             */
115:            public String getCols() {
116:                return cols;
117:            }
118:
119:            /**
120:             * Returns the number of columns in the panel
121:             *
122:             * @return the number of columns in the panel
123:             */
124:            public int getNumCols() {
125:                return numCols;
126:            }
127:
128:            /**
129:             * Returns the number of columns in the panel
130:             *
131:             * @return the number of columns in the panel
132:             */
133:            public String[] getColArray() {
134:                return colArray;
135:            }
136:
137:            public void setColumnCounter(int counter) {
138:                this .counter = counter;
139:            }
140:
141:            public int getColumnCounter() {
142:                return counter;
143:            }
144:
145:            /**
146:             * Sets the panel cell spacing
147:             *
148:             * @param cellSpacing the panel cell spacing
149:             */
150:            public void setCellSpacing(String cellSpacing) {
151:                this .cellSpacing = cellSpacing;
152:            }
153:
154:            /**
155:             * Returns the panel cell spacing
156:             *
157:             * @return the panel cell spacing
158:             */
159:            public String getCellSpacing() {
160:                return cellSpacing;
161:            }
162:
163:            public int doStartTag() throws JspException {
164:                boolean includeBody = true;
165:
166:                counter = 0;
167:                if (!beanId.equals("")) {
168:                    panelBean = (PanelBean) getTagBean();
169:                    if (panelBean == null) {
170:                        panelBean = new PanelBean();
171:                        this .setBaseComponentBean(panelBean);
172:                    } else {
173:                        includeBody = false;
174:                    }
175:                } else {
176:                    panelBean = new PanelBean();
177:                    this .setBaseComponentBean(panelBean);
178:                    panelBean.setWidth(width);
179:
180:                    StringTokenizer st = new StringTokenizer(cols, ",");
181:                    numCols = st.countTokens();
182:                    colArray = new String[numCols];
183:                    int i = 0;
184:                    String colStr;
185:                    while (st.hasMoreElements()) {
186:                        colStr = (String) st.nextElement();
187:                        colArray[i++] = colStr.trim();
188:                    }
189:
190:                    panelBean.setCols(cols);
191:                    panelBean.setColArray(colArray);
192:                    panelBean.setNumCols(numCols);
193:                    panelBean.setCellSpacing(cellSpacing);
194:                    panelBean.setCellPadding(cellPadding);
195:                    panelBean.setBorder(border);
196:                    panelBean.setCssClass(cssClass);
197:                    panelBean.setCssStyle(cssStyle);
198:                    if (align != null)
199:                        panelBean.setAlign(align);
200:                }
201:
202:                try {
203:                    JspWriter out = pageContext.getOut();
204:
205:                    out.print(panelBean.toStartString());
206:                } catch (Exception e) {
207:                    throw new JspException(e.getMessage());
208:                }
209:                if (includeBody) {
210:                    return EVAL_BODY_INCLUDE;
211:                } else {
212:                    return SKIP_BODY;
213:                }
214:            }
215:
216:            public int doEndTag() throws JspException {
217:                try {
218:                    JspWriter out = pageContext.getOut();
219:                    out.print(panelBean.toEndString());
220:                } catch (Exception e) {
221:                    throw new JspException(e.getMessage());
222:                }
223:
224:                return EVAL_PAGE;
225:            }
226:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.