Source Code Cross Referenced for Body.java in  » Library » Apache-beehive-1.0.2-src » org » apache » beehive » netui » tags » html » 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 » Library » Apache beehive 1.0.2 src » org.apache.beehive.netui.tags.html 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Licensed to the Apache Software Foundation (ASF) under one or more
003:         * contributor license agreements.  See the NOTICE file distributed with
004:         * this work for additional information regarding copyright ownership.
005:         * The ASF licenses this file to You under the Apache License, Version 2.0
006:         * (the "License"); you may not use this file except in compliance with
007:         * the License.  You may obtain a copy of the License at
008:         * 
009:         *     http://www.apache.org/licenses/LICENSE-2.0
010:         * 
011:         * Unless required by applicable law or agreed to in writing, software
012:         * distributed under the License is distributed on an "AS IS" BASIS,
013:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014:         * See the License for the specific language governing permissions and
015:         * limitations under the License.
016:         *
017:         * $Header:$
018:         */
019:        package org.apache.beehive.netui.tags.html;
020:
021:        import org.apache.beehive.netui.tags.ErrorHandling;
022:        import org.apache.beehive.netui.tags.javascript.IScriptReporter;
023:        import org.apache.beehive.netui.tags.rendering.AbstractHtmlState;
024:        import org.apache.beehive.netui.tags.rendering.BodyTag;
025:        import org.apache.beehive.netui.tags.rendering.TagRenderingBase;
026:        import org.apache.beehive.netui.tags.rendering.WriteRenderAppender;
027:
028:        import javax.servlet.http.HttpServletRequest;
029:        import javax.servlet.jsp.JspException;
030:
031:        /**
032:         * @jsptagref.tagdescription <p>
033:         * Renders an HTML &lt;body> tag with the attributes specified.
034:         * </p>
035:         * @netui:tag name="body" description="Output the &lt;body> container.  This tag allows the NetUI framework to output script and errors before the page is finished rendering."
036:         */
037:        public class Body extends HtmlBaseTag {
038:            private BodyTag.State _state = new BodyTag.State();
039:            private TagRenderingBase _br;
040:            private WriteRenderAppender _writer;
041:            private String _idScript;
042:
043:            /**
044:             * Return the name of the Tag.
045:             */
046:            public String getTagName() {
047:                return "Body";
048:            }
049:
050:            /**
051:             * This method will return the state associated with the tag.  This is used by this
052:             * base class to access the individual state objects created by the tags.
053:             * @return a subclass of the <code>AbstractHtmlState</code> class.
054:             */
055:            protected AbstractHtmlState getState() {
056:                return _state;
057:            }
058:
059:            /**
060:             * Sets the onLoad javascript event.
061:             * @param onload the onLoad event.
062:             * @jsptagref.attributedescription The onLoad JavaScript event.
063:             * @jsptagref.databindable false
064:             * @jsptagref.attributesyntaxvalue <i>string_onLoad</i>
065:             * @netui:attribute required="false" rtexprvalue="true"
066:             * description="The onLoad JavaScript event."
067:             */
068:            public void setOnLoad(String onload) {
069:                _state.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT,
070:                        ONLOAD, onload);
071:            }
072:
073:            /**
074:             * Sets the onUnload javascript event.
075:             * @param onunload the onUnload event.
076:             * @jsptagref.attributedescription The onLoad JavaScript event.
077:             * @jsptagref.databindable false
078:             * @jsptagref.attributesyntaxvalue <i>string_onUnload</i>
079:             * @netui:attribute required="false" rtexprvalue="true"
080:             * description="The onLoad JavaScript event."
081:             */
082:            public void setOnUnload(String onunload) {
083:                _state.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT,
084:                        ONUNLOAD, onunload);
085:            }
086:
087:            /**
088:             * Sets the background image of the page.
089:             * @param background the background image of the page.
090:             * @jsptagref.attributedescription The background image of the page.
091:             * @jsptagref.databindable false
092:             * @jsptagref.attributesyntaxvalue <i>string_background</i>
093:             * @netui:attribute required="false"  rtexprvalue="true"
094:             * description="The background image of the page."
095:             */
096:            public void setBackground(String background) {
097:                _state.registerAttribute(AbstractHtmlState.ATTR_GENERAL,
098:                        BACKGROUND, background);
099:            }
100:
101:            /**
102:             * Sets the bgcolor of the page.
103:             * @param bgcolor the background color of the page.
104:             * @jsptagref.attributedescription The background color of the page.
105:             * @jsptagref.databindable false
106:             * @jsptagref.attributesyntaxvalue <i>string_bgcolor</i>
107:             * @netui:attribute required="false"  rtexprvalue="true"
108:             * description="The background color of the page."
109:             */
110:            public void setBgcolor(String bgcolor) {
111:                _state.registerAttribute(AbstractHtmlState.ATTR_GENERAL,
112:                        BGCOLOR, bgcolor);
113:            }
114:
115:            /**
116:             * Sets the foreground text color of the page.
117:             * @param text the foreground text color of the page.
118:             * @jsptagref.attributedescription The foreground text color of the page.
119:             * @jsptagref.databindable false
120:             * @jsptagref.attributesyntaxvalue <i>string_text</i>
121:             * @netui:attribute required="false"  rtexprvalue="true"
122:             * description="The foreground text color of the page."
123:             */
124:            public void setText(String text) {
125:                _state.registerAttribute(AbstractHtmlState.ATTR_GENERAL, TEXT,
126:                        text);
127:            }
128:
129:            /**
130:             * Sets the the color of text marking unvisited hypertext links.
131:             * @param link the color of text marking unvisited hypertext links of the page.
132:             * @jsptagref.attributedescription The color of text marking unvisited hypertext links of the page
133:             * @jsptagref.databindable false
134:             * @jsptagref.attributesyntaxvalue <i>string_link</i>
135:             * @netui:attribute required="false"  rtexprvalue="true"
136:             * description="The color of text marking unvisited hypertext links of the page."
137:             */
138:            public void setLink(String link) {
139:                _state.registerAttribute(AbstractHtmlState.ATTR_GENERAL, LINK,
140:                        link);
141:            }
142:
143:            /**
144:             * Sets the the color of text marking visited hypertext links.
145:             * @param vlink the color of text marking visited hypertext links of the page.
146:             * @jsptagref.attributedescription The color of text marking visited hypertext links of the page
147:             * @jsptagref.databindable false
148:             * @jsptagref.attributesyntaxvalue <i>string_vlink</i>
149:             * @netui:attribute required="false"  rtexprvalue="true"
150:             * description="The color of text marking visited hypertext links of the page."
151:             */
152:            public void setVlink(String vlink) {
153:                _state.registerAttribute(AbstractHtmlState.ATTR_GENERAL, VLINK,
154:                        vlink);
155:            }
156:
157:            /**
158:             * Sets the color of text marking hypertext links when selected by the user.
159:             * @param alink the color of text marking hypertext links when selected by the user.
160:             * @jsptagref.attributedescription The color of text marking hypertext links when selected by the user
161:             * @jsptagref.databindable false
162:             * @jsptagref.attributesyntaxvalue <i>string_alink</i>
163:             * @netui:attribute required="false"  rtexprvalue="true"
164:             * description="The color of text marking hypertext links when selected by the user."
165:             */
166:            public void setAlink(String alink) {
167:                _state.registerAttribute(AbstractHtmlState.ATTR_GENERAL, ALINK,
168:                        alink);
169:            }
170:
171:            /**
172:             * Process the start of the Button.
173:             * @throws javax.servlet.jsp.JspException if a JSP exception has occurred
174:             */
175:            public int doStartTag() throws JspException {
176:                // we assume that tagId will over have override id if both are defined.
177:                if (_state.id != null) {
178:                    _idScript = renderNameAndId(
179:                            (HttpServletRequest) pageContext.getRequest(),
180:                            _state, null);
181:                }
182:
183:                // render the header...
184:                _writer = new WriteRenderAppender(pageContext);
185:                _br = TagRenderingBase.Factory.getRendering(
186:                        TagRenderingBase.BODY_TAG, pageContext.getRequest());
187:                _br.doStartTag(_writer, _state);
188:
189:                return EVAL_BODY_INCLUDE;
190:            }
191:
192:            /**
193:             * Render the button.
194:             * @throws JspException if a JSP exception has occurred
195:             */
196:            public int doEndTag() throws JspException {
197:                // if there were errors lets report them.
198:                if (hasErrors()) {
199:                    reportErrors();
200:                }
201:
202:                // Get the script reporter
203:                IScriptReporter sr = getScriptReporter();
204:                if (sr != null) {
205:                    //if (!sr.isInitScriptWritten()) {
206:                    //    String s = Bundle.getString("Tags_ClientReqScriptHeader", null);
207:                    //    registerTagError(s, null);
208:                    //}
209:
210:                    // write out any errors
211:                    ErrorHandling.reportCollectedErrors(pageContext, this );
212:
213:                    // write out the script before the end tag.
214:                    sr.writeScript(_writer);
215:
216:                    if (sr instanceof  Html) {
217:                        Html htmlSr = (Html) sr;
218:                        if (htmlSr.getIdScope() != null) {
219:                            htmlSr.endScope(_writer);
220:                        }
221:                    }
222:                }
223:
224:                if (_idScript != null)
225:                    write(_idScript);
226:
227:                _br.doEndTag(_writer);
228:
229:                // Evaluate the remainder of this page
230:                localRelease();
231:                return EVAL_PAGE;
232:            }
233:
234:            public void localRelease() {
235:                super.localRelease();
236:                _state.clear();
237:                _br = null;
238:                _writer = null;
239:            }
240:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.