Source Code Cross Referenced for Property.java in  » Portal » Open-Portal » com » sun » portal » admin » console » desktop » 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 » Open Portal » com.sun.portal.admin.console.desktop 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         * $Id: Property.java,v 1.9 2005/11/07 21:42:51 rt94277 Exp $
003:         * Copyright 2005 Sun Microsystems, Inc. All
004:         * rights reserved. Use of this product is subject
005:         * to license terms. Federal Acquisitions:
006:         * Commercial Software -- Government Users
007:         * Subject to Standard License Terms and
008:         * Conditions.
009:         *
010:         * Sun, Sun Microsystems, the Sun logo, and Sun ONE
011:         * are trademarks or registered trademarks of Sun Microsystems,
012:         * Inc. in the United States and other countries.
013:         */package com.sun.portal.admin.console.desktop;
014:
015:        import java.text.MessageFormat;
016:
017:        import com.sun.portal.admin.console.common.PSBaseBean;
018:        import com.sun.portal.admin.common.DesktopConstants;
019:        import java.util.List;
020:        import java.util.ArrayList;
021:        import java.util.Iterator;
022:        import com.sun.web.ui.model.Option;
023:
024:        public class Property {
025:
026:            public String name; //name of the property 
027:            public short type; //DesktopConstants.KEY_TYPE
028:            public boolean named; //DesktopConstants.KEY_NAMED 
029:            public List values = new ArrayList(); //DesktopConstants.KEY_VALUE
030:            public boolean advanced; //DesktopConstants.KEY_CATEGORY
031:            public String state; //DesktopConstants.KEY_STATE
032:
033:            public Property(String name, boolean named, short type,
034:                    Object value, boolean advanced, String state) {
035:                this .name = name;
036:                this .named = named;
037:                this .type = type;
038:                //the value is a List only if the type is string list
039:                if (type == DesktopConstants.TYPE_STRING_LIST_PROPERTY) {
040:                    this .values = (List) value;
041:                } else { //otherwise the value is just a string
042:                    this .values.add(0, value.toString());
043:                }
044:                this .advanced = advanced;
045:                this .state = state;
046:            }
047:
048:            public String getName() {
049:                return name;
050:            }
051:
052:            public boolean isNamed() {
053:                return named;
054:            }
055:
056:            public String getValue() {
057:                return (String) values.get(0);
058:            }
059:
060:            public void setvalue(String value) {
061:                values.add(0, value);
062:            }
063:
064:            public Boolean getBoolTrueValue() {
065:                return new Boolean((String) values.get(0));
066:            }
067:
068:            public void setBoolTrueValue(Boolean value) {
069:                values.add(0, value.toString());
070:            }
071:
072:            public Boolean getBoolFalseValue() {
073:                Boolean b = new Boolean(!getBoolTrueValue().booleanValue());
074:                return b;
075:            }
076:
077:            public void setBoolFalseValue(Boolean value) {
078:                //nothing
079:            }
080:
081:            public String getCategory() {
082:                if (advanced) {
083:                    return PSBaseBean.getLocalizedString("desktop",
084:                            "edit.properties.category.advanced");
085:                } else {
086:                    return PSBaseBean.getLocalizedString("desktop",
087:                            "edit.properties.category.basic");
088:                }
089:            }
090:
091:            public String getState() {
092:                return PSBaseBean.getLocalizedString("desktop", state);
093:            }
094:
095:            public String getStateTip() {
096:                return PSBaseBean.getLocalizedString("desktop", state
097:                        + ".toolTip");
098:            }
099:
100:            public boolean isCustomized() {
101:                if ("property.state.customized".equals(state)) {
102:                    return true;
103:                } else {
104:                    return false;
105:                }
106:            }
107:
108:            public boolean isInherited() {
109:                if ("property.state.inherited".equals(state)) {
110:                    return true;
111:                } else {
112:                    return false;
113:                }
114:            }
115:
116:            public boolean isNested() {
117:                if (type == DesktopConstants.TYPE_COLLECTION_PROPERTY) {
118:                    return true;
119:                } else {
120:                    return false;
121:                }
122:            }
123:
124:            public boolean isString() {
125:                if (type == DesktopConstants.TYPE_STRING_PROPERTY) {
126:                    return true;
127:                } else {
128:                    return false;
129:                }
130:            }
131:
132:            public boolean isNumeric() {
133:                if (type == DesktopConstants.TYPE_INTEGER_PROPERTY) {
134:                    return true;
135:                } else {
136:                    return false;
137:                }
138:            }
139:
140:            public boolean isBool() {
141:                if (type == DesktopConstants.TYPE_BOOLEAN_PROPERTY) {
142:                    return true;
143:                } else {
144:                    return false;
145:                }
146:            }
147:
148:            public String[] getValueArray() {
149:                Object[] oa = values.toArray();
150:                String[] sa = new String[oa.length];
151:                for (int i = 0; i < oa.length; i++) {
152:                    sa[i] = (String) oa[i];
153:                }
154:                return sa;
155:            }
156:
157:            public void setValueArray(String[] strValues) {
158:                values.clear();
159:                for (int i = 0; i < strValues.length; i++) {
160:                    values.add(strValues[i]);
161:                }
162:            }
163:
164:            public String getToolTipValues() {
165:                StringBuffer vlist = new StringBuffer();
166:                Iterator iter = values.iterator();
167:                while (iter.hasNext()) {
168:                    vlist.append((String) iter.next()).append(", ");
169:                }
170:                return vlist.toString();
171:            }
172:
173:            public String getNumValues() {
174:                String message = PSBaseBean.getLocalizedString("desktop",
175:                        "edit.properties.label.numValues");
176:                Object[] tokens = { new Integer(values.size()) };
177:                MessageFormat mf = new MessageFormat(message);
178:                message = mf.format(tokens);
179:                return message;
180:            }
181:
182:            public boolean isList() {
183:                if (type == DesktopConstants.TYPE_STRING_LIST_PROPERTY) {
184:                    return true;
185:                } else {
186:                    return false;
187:                }
188:            }
189:
190:            public boolean isListEmpty() {
191:                if (type == DesktopConstants.TYPE_STRING_LIST_PROPERTY
192:                        && values.isEmpty()) {
193:                    return true;
194:                } else {
195:                    return false;
196:                }
197:            }
198:
199:            /**
200:             * for debug purpose
201:             */
202:            //    public String toString() {
203:            //        return 
204:            //            "Name=" + name + ", " +
205:            //            "Value=" + values + ", " +
206:            //            "Type=" + type + ", " +
207:            //            "Advanced=" + advanced + ", " +
208:            //            "State=" + state;
209:            //        
210:            //    }
211:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.