Source Code Cross Referenced for JspBox.java in  » J2EE » Sofia » com » salmonllc » jsp » 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 » J2EE » Sofia » com.salmonllc.jsp 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package com.salmonllc.jsp;
002:
003:        /////////////////////////
004:        //$Archive: /SOFIA/SourceCode/com/salmonllc/jsp/JspBox.java $
005:        //$Author: Dan $
006:        //$Revision: 9 $
007:        //$Modtime: 12/19/03 1:07p $
008:        /////////////////////////
009:        import com.salmonllc.html.HtmlPage;
010:        import com.salmonllc.properties.Props;
011:
012:        /**
013:         * This container draws a box around the components inside
014:         */
015:
016:        public class JspBox extends JspContainer {
017:            private String _lineWidth, _bgColor, _lineColor, _theme, _width,
018:                    _margin, _height;
019:
020:            /**
021:             * Creates a new JSP Box
022:             */
023:            public JspBox(String name, HtmlPage p) {
024:                this (name, p, null);
025:            }
026:
027:            /**
028:             * Creates a new JSP Box with the specified theme
029:             */
030:            public JspBox(String name, HtmlPage p, String theme) {
031:                super (name, p);
032:                setTheme(theme);
033:            }
034:
035:            /**
036:             *Generates the Html for the component. This method is called by the framework and should not be called directly
037:             */
038:            public void generateHTML(TagWriter t, String box)
039:                    throws java.io.IOException {
040:                StringBuffer sb = new StringBuffer();
041:
042:                if (_lineColor.toUpperCase().equals("NONE"))
043:                    sb.append("<table border=\"0\"");
044:                else {
045:                    sb.append("<table border=\"0\" bgcolor=\"");
046:                    sb.append(_lineColor);
047:                }
048:                if (_width != null) {
049:                    sb.append("\" width=\"");
050:                    sb.append(_width);
051:                }
052:                if (_height != null) {
053:                    sb.append("\" height=\"");
054:                    sb.append(_height);
055:                }
056:                sb.append("\" cellpadding=\"");
057:                sb.append(_lineWidth);
058:                sb.append("\" cellspacing=\"0\"><tr><td>");
059:                sb
060:                        .append("<table height=\"100%\" width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"");
061:                sb.append(_margin);
062:                sb.append("\">");
063:                if (_bgColor.toUpperCase().equals("NONE"))
064:                    sb.append("<tr>");
065:                else {
066:                    sb.append("<tr bgcolor=\"");
067:                    sb.append(_bgColor);
068:                    sb.append("\">");
069:                }
070:                sb.append("<td>");
071:
072:                t.print(sb.toString(), TagWriter.TYPE_BEGIN_TAG);
073:                t.print(box, TagWriter.TYPE_CONTENT);
074:                t.print("</td></tr></table></td></tr></table>",
075:                        TagWriter.TYPE_END_TAG);
076:
077:            }
078:
079:            /**
080:             * Returns the background color of the box contents
081:             */
082:
083:            public String getBgColor() {
084:                return _bgColor;
085:            }
086:
087:            /**
088:             * Returns the line color for the line surrounding the box
089:             */
090:
091:            public String getLineColor() {
092:                return _lineColor;
093:            }
094:
095:            /**
096:             * Returns the width of the line of the box in pixels
097:             */
098:            public String getLineWidth() {
099:                return _lineWidth;
100:            }
101:
102:            /**
103:             * Returns the gap in pixels between the border line and the contents of the box
104:             */
105:
106:            public String getMargin() {
107:                return _margin;
108:            }
109:
110:            /**
111:             * This method returns the property theme for the component.
112:             * @param theme The theme to use.
113:             */
114:            public String getTheme() {
115:                return _theme;
116:            }
117:
118:            /**
119:             * Returns the width of the table
120:             */
121:            public String getWidth() {
122:                return _width;
123:            }
124:
125:            /**
126:             * Sets the background color of the box contents
127:             */
128:
129:            public void setBgColor(String bgColor) {
130:                _bgColor = bgColor;
131:            }
132:
133:            /**
134:             * Sets the line color for the line surrounding the box
135:             */
136:
137:            public void setLineColor(String lineColor) {
138:                _lineColor = lineColor;
139:            }
140:
141:            /**
142:             * Sets the width of the line of the box in pixels
143:             */
144:
145:            public void setLineWidth(String lineWidth) {
146:                _lineWidth = lineWidth;
147:            }
148:
149:            /**
150:             * Sets the gap in pixels between the border line and the contents of the box
151:             */
152:            public void setMargin(String borderSpacing) {
153:                _margin = borderSpacing;
154:            }
155:
156:            /**
157:             * This method sets the property theme for the component.
158:             * @param theme The theme to use.
159:             */
160:            public void setTheme(String theme) {
161:                Props prop = getPage().getPageProperties();
162:
163:                _lineWidth = prop.getThemeProperty(theme, Props.BOX_LINE_WIDTH);
164:                if (_lineWidth == null)
165:                    _lineWidth = "1";
166:                _margin = prop.getThemeProperty(theme, Props.BOX_MARGIN);
167:                if (_margin == null)
168:                    _margin = "1";
169:
170:                _lineColor = prop.getThemeProperty(theme, Props.BOX_LINE_COLOR);
171:                if (_lineColor == null)
172:                    _lineColor = "black";
173:
174:                _bgColor = prop.getThemeProperty(theme, Props.BOX_BG_COLOR);
175:                if (_bgColor == null)
176:                    _bgColor = "white";
177:
178:                _theme = theme;
179:            }
180:
181:            /**
182:             * Sets the width of the table
183:             */
184:            public void setWidth(String width) {
185:                _width = width;
186:            }
187:
188:            /**
189:             * @return the height of the table
190:             */
191:            public String getHeight() {
192:                return _height;
193:            }
194:
195:            /**
196:             * Sets the height of the table
197:             */
198:            public void setHeight(String string) {
199:                _height = string;
200:            }
201:
202:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.