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


001:        /*
002:         * @author <a href="mailto:oliver.wehrens@aei.mpg.de">Oliver Wehrens</a>
003:         * @version $Id: ImageBean.java 6385 2007-10-25 14:02:26Z wehrens $
004:         */
005:        package org.gridsphere.provider.portletui.beans;
006:
007:        /**
008:         * A <code>ImageBean</code> represents an image element
009:         */
010:        public class ImageBean extends BaseComponentBean implements  TagBean {
011:
012:            public static final String NAME = "im";
013:            public String src = "";
014:            public String alt = null;
015:            public String title = null;
016:            public String border = "0";
017:            protected String width = null;
018:            protected String height = null;
019:            protected String align = null;
020:
021:            /**
022:             * Constructs a default image bean
023:             */
024:            public ImageBean() {
025:                super (NAME);
026:            }
027:
028:            /**
029:             * Constructs an image bean using a supplied  bean identifier
030:             *
031:             * @param beanId the bean identifier
032:             */
033:            public ImageBean(String beanId) {
034:                super (NAME);
035:                this .beanId = beanId;
036:            }
037:
038:            /**
039:             * Returns the image source
040:             *
041:             * @return the image source
042:             */
043:            public String getSrc() {
044:                return src;
045:            }
046:
047:            /**
048:             * Sets the image source
049:             *
050:             * @param src the image source
051:             */
052:            public void setSrc(String src) {
053:                this .src = src;
054:            }
055:
056:            /**
057:             * Returns the image alt tag
058:             *
059:             * @return the image alt tag
060:             */
061:            public String getAlt() {
062:                return alt;
063:            }
064:
065:            /**
066:             * Sets the image alt tag
067:             *
068:             * @param alt the image alt tag
069:             */
070:            public void setAlt(String alt) {
071:                this .alt = alt;
072:            }
073:
074:            /**
075:             * Returns the image title
076:             *
077:             * @return the image title
078:             */
079:            public String getTitle() {
080:                return title;
081:            }
082:
083:            /**
084:             * Sets the image title
085:             *
086:             * @param title the image title
087:             */
088:            public void setTitle(String title) {
089:                this .title = title;
090:            }
091:
092:            /**
093:             * Sets the table alignment e.g. "left", "top", "bottom" or "right"
094:             *
095:             * @param align the table alignment
096:             */
097:            public void setAlign(String align) {
098:                this .align = align;
099:            }
100:
101:            /**
102:             * Returns the table alignment e.g. "left", "top", "bottom" or "right"
103:             *
104:             * @return the table alignment
105:             */
106:            public String getAlign() {
107:                return align;
108:            }
109:
110:            /**
111:             * Sets the table cell width
112:             *
113:             * @param width the table cell width
114:             */
115:            public void setWidth(String width) {
116:                this .width = width;
117:            }
118:
119:            /**
120:             * Returns the table cell width
121:             *
122:             * @return the table cell width
123:             */
124:            public String getWidth() {
125:                return width;
126:            }
127:
128:            /**
129:             * Sets the table cell height
130:             *
131:             * @param height the table cell height
132:             */
133:            public void setHeight(String height) {
134:                this .height = height;
135:            }
136:
137:            /**
138:             * Returns the table cell height
139:             *
140:             * @return the table cell height
141:             */
142:            public String getHeight() {
143:                return height;
144:            }
145:
146:            /**
147:             * Return the image title border
148:             *
149:             * @return the image title border
150:             */
151:            public String getBorder() {
152:                return border;
153:            }
154:
155:            /**
156:             * Sets the image title border
157:             *
158:             * @param border the image title border
159:             */
160:            public void setBorder(String border) {
161:                this .border = border;
162:            }
163:
164:            public String toStartString() {
165:                if (src.equals(""))
166:                    return "";
167:                StringBuffer sb = new StringBuffer();
168:                // the 'border' attribute has been removed for XHTML 1.0 Strict compliance
169:                sb.append("<img src=\"" + this .src + "\"");
170:                if (width != null)
171:                    sb.append(" width=\"" + width + "\"");
172:                if (height != null)
173:                    sb.append(" height=\"" + height + "\"");
174:                if (align != null)
175:                    sb.append(" align=\"" + align + "\"");
176:                // the else case should NEVER be reached, the 'alt' attribute should ALWAYS be specified!
177:                if (alt != null)
178:                    sb.append(" alt=\"" + alt + "\"");
179:                else
180:                    sb.append(" alt=\"image\"");
181:                if (title != null)
182:                    sb.append(" title=\"" + title + "\"");
183:                sb.append(" />");
184:                return sb.toString();
185:            }
186:
187:            public String toEndString() {
188:                return "";
189:            }
190:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.