Source Code Cross Referenced for Img.java in  » Ajax » zk » org » zkoss » web » servlet » dsp » action » 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 » Ajax » zk » org.zkoss.web.servlet.dsp.action.html 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /* Img.java
002:
003:        {{IS_NOTE
004:        	Purpose:
005:        		
006:        	Description:
007:        		
008:        	History:
009:        		Tue Sep 20 15:13:32     2005, Created by tomyeh
010:        }}IS_NOTE
011:
012:        Copyright (C) 2005 Potix Corporation. All Rights Reserved.
013:
014:        {{IS_RIGHT
015:        	This program is distributed under GPL Version 2.0 in the hope that
016:        	it will be useful, but WITHOUT ANY WARRANTY.
017:        }}IS_RIGHT
018:         */
019:        package org.zkoss.web.servlet.dsp.action.html;
020:
021:        import java.io.IOException;
022:
023:        import org.zkoss.web.mesg.MWeb;
024:        import org.zkoss.web.servlet.ServletException;
025:        import org.zkoss.web.servlet.dsp.action.AbstractAction;
026:        import org.zkoss.web.servlet.dsp.action.ActionContext;
027:
028:        /**
029:         * Generates the HTML <img> tag
030:         *
031:         * @author tomyeh
032:         */
033:        public class Img extends AbstractAction {
034:            private String _id, _onclick;
035:            private String _src, _height, _width, _border, _hspace, _vspace;
036:            private String _align, _title, _alt, _sclass, _style;
037:
038:            /** Returns the id attribute.
039:             * Default: null.
040:             */
041:            public String getId() {
042:                return _id;
043:            }
044:
045:            /** Sets the id attribute.
046:             */
047:            public void setId(String id) {
048:                _id = id;
049:            }
050:
051:            /** Returns the src (URL).
052:             * Default: null.
053:             */
054:            public String getSrc() {
055:                return _src;
056:            }
057:
058:            /** Sets the src (URL).
059:             */
060:            public void setSrc(String src) {
061:                _src = src;
062:            }
063:
064:            /** Returns the alignment.
065:             * Default: null.
066:             */
067:            public String getAlign() {
068:                return _align;
069:            }
070:
071:            /** Sets the alignment.
072:             */
073:            public void setAlign(String align) {
074:                _align = align;
075:            }
076:
077:            /** Returns the alt.
078:             * Default: null.
079:             */
080:            public String getAlt() {
081:                return _alt;
082:            }
083:
084:            /** Sets the alt.
085:             */
086:            public void setAlt(String alt) {
087:                _alt = alt;
088:            }
089:
090:            /** Returns the border.
091:             * Default: null.
092:             */
093:            public String getBorder() {
094:                return _border;
095:            }
096:
097:            /** Sets the border.
098:             */
099:            public void setBorder(String border) {
100:                _border = border;
101:            }
102:
103:            /** Returns the hspace.
104:             * Default: null.
105:             */
106:            public String getHspace() {
107:                return _hspace;
108:            }
109:
110:            /** Sets the hspace.
111:             */
112:            public void setHspace(String hspace) {
113:                _hspace = hspace;
114:            }
115:
116:            /** Returns the vspace.
117:             * Default: null.
118:             */
119:            public String getVspace() {
120:                return _vspace;
121:            }
122:
123:            /** Sets the vspace.
124:             */
125:            public void setVspace(String vspace) {
126:                _vspace = vspace;
127:            }
128:
129:            /** Returns the style class.
130:             * Default: null.
131:             */
132:            public String getSclass() {
133:                return _sclass;
134:            }
135:
136:            /** Sets the style class.
137:             */
138:            public void setSclass(String sclass) {
139:                _sclass = sclass;
140:            }
141:
142:            /** Returns the style.
143:             * Default: null.
144:             */
145:            public String getStyle() {
146:                return _style;
147:            }
148:
149:            /** Sets the style.
150:             */
151:            public void setStyle(String style) {
152:                _style = style;
153:            }
154:
155:            /** Returns the height.
156:             * Default: null.
157:             */
158:            public String getHeight() {
159:                return _height;
160:            }
161:
162:            /** Sets the height.
163:             */
164:            public void setHeight(String height) {
165:                _height = height;
166:            }
167:
168:            /** Returns the width.
169:             * Default: null.
170:             */
171:            public String getWidth() {
172:                return _width;
173:            }
174:
175:            /** Sets the width.
176:             */
177:            public void setWidth(String width) {
178:                _width = width;
179:            }
180:
181:            /** Returns the title.
182:             * Default: null (no title at all).
183:             */
184:            public String getTitle() {
185:                return _title;
186:            }
187:
188:            /** Sets the title.
189:             */
190:            public void setTitle(String title) {
191:                _title = title;
192:            }
193:
194:            /** Returns the onclick.
195:             * Default: null.
196:             */
197:            public String getOnclick() {
198:                return _onclick;
199:            }
200:
201:            /** Sets the onclick.
202:             */
203:            public void setOnclick(String onclick) {
204:                _onclick = onclick;
205:            }
206:
207:            //-- Action --//
208:            public void render(ActionContext ac, boolean nested)
209:                    throws javax.servlet.ServletException, IOException {
210:                if (!isEffective() || _src == null || _src.length() == 0)
211:                    return; //nothing to generate
212:                if (nested)
213:                    throw new ServletException(
214:                            MWeb.DSP_NESTED_ACTION_NOT_ALLOWED, new Object[] {
215:                                    this , new Integer(ac.getLineNumber()) });
216:
217:                final StringBuffer sb = new StringBuffer(64).append(
218:                        "<img src=\"").append(ac.encodeURL(_src)).append('"');
219:                append(sb, "id", _id);
220:                append(sb, "height", _height);
221:                append(sb, "width", _width);
222:                append(sb, "title", _title);
223:                append(sb, "align", _align);
224:                append(sb, "alt", _alt);
225:                append(sb, "class", _sclass);
226:                append(sb, "style", _style);
227:                append(sb, "border", _border);
228:                append(sb, "hspace", _hspace);
229:                append(sb, "vspace", _vspace);
230:                append(sb, "onclick", _onclick);
231:                sb.append("/>");
232:                ac.getOut().write(sb.toString());
233:            }
234:
235:            //-- Object --//
236:            public String toString() {
237:                return "image";
238:            }
239:        }
w__w__w___.__ja_v_a_2___s_.__c___o_m__ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.