Source Code Cross Referenced for BaseComponentBean.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:novotny@gridsphere.org">Jason Novotny</a>
003:         * @version $Id: BaseComponentBean.java 6385 2007-10-25 14:02:26Z wehrens $
004:         */
005:
006:        package org.gridsphere.provider.portletui.beans;
007:
008:        import java.util.Locale;
009:
010:        /**
011:         * The abstract <code>BaseComponentBean</code> defines the visual bean properties of all ui tag beans
012:         */
013:        public abstract class BaseComponentBean extends BaseBean implements 
014:                Comparable {
015:
016:            protected String name = null;
017:            protected String value = null;
018:            protected boolean readonly = false;
019:            protected boolean disabled = false;
020:            protected String key = null;
021:
022:            protected String cssStyle = null;
023:            protected String cssClass = null;
024:            protected String id = null;
025:
026:            /**
027:             * Constructs a default base component bean
028:             */
029:            public BaseComponentBean() {
030:                super ();
031:            }
032:
033:            /**
034:             * Constructs a base component bean using the supplied visual bean type identifier
035:             *
036:             * @param vbName the supplied visual bean type identifier
037:             */
038:            public BaseComponentBean(String vbName) {
039:                super (vbName);
040:            }
041:
042:            /**
043:             * Sets the id of the bean  (not to be confused with beanId)
044:             *
045:             * @param id the id of the bean
046:             */
047:            public void setId(String id) {
048:                this .id = id;
049:            }
050:
051:            /**
052:             * Gets the id of the bean
053:             *
054:             * @return id of the bean
055:             */
056:            public String getId() {
057:                return this .id;
058:            }
059:
060:            /**
061:             * Sets the name of the bean
062:             *
063:             * @param name the name of the bean
064:             */
065:            public void setName(String name) {
066:                this .name = name;
067:            }
068:
069:            /**
070:             * Returns the name of the bean
071:             *
072:             * @return name of the bean
073:             */
074:            public String getName() {
075:                return this .name;
076:            }
077:
078:            /**
079:             * Sets the bean value
080:             *
081:             * @param value the bean value
082:             */
083:            public void setValue(String value) {
084:                this .value = value;
085:            }
086:
087:            /**
088:             * Returns the bean value
089:             *
090:             * @return the bean value
091:             */
092:            public String getValue() {
093:                return value;
094:            }
095:
096:            /**
097:             * Returns the key used to identify localized text
098:             *
099:             * @return the key used to identify localized text
100:             */
101:            public String getKey() {
102:                return key;
103:            }
104:
105:            /**
106:             * Sets the key used to identify localized text
107:             *
108:             * @param key the key used to identify localized text
109:             */
110:            public void setKey(String key) {
111:                this .key = key;
112:            }
113:
114:            /**
115:             * Returns true if bean is in disabled state.
116:             *
117:             * @return state
118:             */
119:            public boolean isDisabled() {
120:                return disabled;
121:            }
122:
123:            /**
124:             * Sets the disabled attribute of the bean to be 'flag' state
125:             *
126:             * @param flag is true if the bean is to be disabled, false otherwise
127:             */
128:            public void setDisabled(boolean flag) {
129:                this .disabled = flag;
130:            }
131:
132:            /**
133:             * Returns disabled String if bean is disabled
134:             *
135:             * @return disabled String if bean is disabled or blank otherwise
136:             */
137:            protected String checkDisabled() {
138:                if (disabled) {
139:                    // 'disabled' replaced by 'disabled="disabled"' for XHTML 1.0 Strict compliance
140:                    return " disabled=\"disabled\" ";
141:                } else {
142:                    return "";
143:                }
144:            }
145:
146:            /**
147:             * Sets the bean to readonly
148:             *
149:             * @param flag is true if the bean is read-only, false otherwise
150:             */
151:            public void setReadOnly(boolean flag) {
152:                this .readonly = flag;
153:            }
154:
155:            /**
156:             * Returns the read-only status of the bean
157:             *
158:             * @return true if bean is read-only, false otherwise
159:             */
160:            public boolean isReadOnly() {
161:                return readonly;
162:            }
163:
164:            /**
165:             * Returns 'readonly' string if bean is read-only, blank string otherwise
166:             *
167:             * @return 'readonly' string if bean is read-only, blank string otherwise
168:             */
169:            protected String checkReadOnly() {
170:                if (readonly) {
171:                    return " readonly ";
172:                } else {
173:                    return "";
174:                }
175:            }
176:
177:            public int compareTo(Object o) {
178:                BaseComponentBean otherBean = (BaseComponentBean) o;
179:                return value.compareToIgnoreCase(otherBean.getValue());
180:            }
181:
182:            /**
183:             * Returns the current css style
184:             *
185:             * @return css style of the element
186:             */
187:            public String getCssStyle() {
188:                return cssStyle;
189:            }
190:
191:            /**
192:             * Sets the css style of the element.
193:             *
194:             * @param cssStyle the css style
195:             */
196:            public void setCssStyle(String cssStyle) {
197:                if (cssStyle != null)
198:                    this .cssStyle = cssStyle;
199:            }
200:
201:            /**
202:             * Returns the current css class of the element.
203:             *
204:             * @return css class of the element
205:             */
206:            public String getCssClass() {
207:                return cssClass;
208:            }
209:
210:            /**
211:             * Sets the css class of the element. If null nothing will be changed.
212:             *
213:             * @param cssClass the css class
214:             */
215:            public void setCssClass(String cssClass) {
216:                if (cssClass != null)
217:                    this .cssClass = cssClass;
218:            }
219:
220:            public void clearCssClass() {
221:                this .cssClass = null;
222:            }
223:
224:            public void addCssClass(String cssClass) {
225:                if (this .cssClass == null)
226:                    this .cssClass = "";
227:                if (cssClass != null)
228:                    this .cssClass += " " + cssClass;
229:            }
230:
231:            /**
232:             * Returns the formatted css commands for inserting into html components.
233:             *
234:             * @return formatted css string for style/class attribute
235:             */
236:            protected String getFormattedCss() {
237:                String result = "";
238:                if (this .cssStyle != null) {
239:                    result = " style=\"" + this .cssStyle + "\"";
240:                }
241:                if (this .cssClass != null) {
242:                    result += " class=\"" + this .cssClass + "\"";
243:                }
244:                return result;
245:            }
246:
247:            public Locale getLocale() {
248:                return locale;
249:            }
250:
251:            public void setLocale(Locale locale) {
252:                this .locale = locale;
253:            }
254:
255:            /**
256:             * Adds a css style to the exiting style.
257:             *
258:             * @param style style to be added
259:             */
260:            public void addCssStyle(String style) {
261:                if (cssStyle != null) {
262:                    cssStyle += style;
263:                } else {
264:                    this .setCssStyle(style);
265:                }
266:
267:            }
268:
269:            /**
270:             * Deletes the current css style.
271:             */
272:            public void deleteCssStyle() {
273:                cssStyle = null;
274:            }
275:
276:            /**
277:             * Deletes the current css class setting.
278:             */
279:            public void deleteCssClass() {
280:                cssClass = null;
281:            }
282:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.