Source Code Cross Referenced for Tool.java in  » ERP-CRM-Financial » sakai » org » sakaiproject » util » 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 » ERP CRM Financial » sakai » org.sakaiproject.util 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**********************************************************************************
002:         * $URL: https://source.sakaiproject.org/svn/tool/tags/sakai_2-4-1/tool-util/util/src/java/org/sakaiproject/util/Tool.java $
003:         * $Id: Tool.java 27663 2007-03-22 19:50:10Z bkirschn@umich.edu $
004:         ***********************************************************************************
005:         *
006:         * Copyright (c) 2005, 2006 The Sakai Foundation.
007:         * 
008:         * Licensed under the Educational Community License, Version 1.0 (the "License"); 
009:         * you may not use this file except in compliance with the License. 
010:         * You may obtain a copy of the License at
011:         * 
012:         *      http://www.opensource.org/licenses/ecl1.php
013:         * 
014:         * Unless required by applicable law or agreed to in writing, software 
015:         * distributed under the License is distributed on an "AS IS" BASIS, 
016:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
017:         * See the License for the specific language governing permissions and 
018:         * limitations under the License.
019:         *
020:         **********************************************************************************/package org.sakaiproject.util;
021:
022:        import java.util.Collections;
023:        import java.util.HashSet;
024:        import java.util.Properties;
025:        import java.util.Set;
026:        import org.apache.commons.logging.Log;
027:        import org.apache.commons.logging.LogFactory;
028:        import org.sakaiproject.tool.api.ActiveToolManager;
029:
030:        ;
031:
032:        /**
033:         * <p>
034:         * Tool is a utility class that implements the Tool interface.
035:         * </p>
036:         */
037:        public class Tool implements  org.sakaiproject.tool.api.Tool, Comparable {
038:            /** Our log (commons). */
039:            private static Log M_log = LogFactory.getLog(Tool.class);
040:
041:            /** The access security. */
042:            protected Tool.AccessSecurity m_accessSecurity = Tool.AccessSecurity.PORTAL;
043:
044:            /** The tool Manager that possesses the RessourceBundle. */
045:            private ActiveToolManager m_activeToolManager = org.sakaiproject.tool.cover.ActiveToolManager
046:                    .getInstance();
047:
048:            /** The set of categories. */
049:            protected Set m_categories = new HashSet();
050:
051:            /** The description string. */
052:            protected String m_description = null;
053:
054:            /** The configuration properties that are set by registration and may not be changed by confguration. */
055:            protected Properties m_finalConfig = new Properties();
056:
057:            /** Home destination. */
058:            protected String m_home = null;
059:
060:            /** The well known identifier string. */
061:            protected String m_id = null;
062:
063:            /** The set of keywords. */
064:            protected Set m_keywords = new HashSet();
065:
066:            /** The configuration properties that may be changed by configuration. */
067:            protected Properties m_mutableConfig = new Properties();
068:
069:            /** The title string. */
070:            protected String m_title = null;
071:
072:            /**
073:             * Construct
074:             */
075:            public Tool() {
076:            }
077:
078:            /**
079:             * @inheritDoc
080:             */
081:            public int compareTo(Object obj) {
082:                // let it throw a class case exception if the obj is not some sort of Tool
083:                org.sakaiproject.tool.api.Tool tool = (org.sakaiproject.tool.api.Tool) obj;
084:
085:                // do an id based
086:                return getId().compareTo(tool.getId());
087:            }
088:
089:            /**
090:             * {@inheritDoc}
091:             */
092:            public boolean equals(Object obj) {
093:                if (!(obj instanceof  Tool)) {
094:                    return false;
095:                }
096:
097:                return ((Tool) obj).getId().equals(getId());
098:            }
099:
100:            /**
101:             * @inheritDoc
102:             */
103:            public Tool.AccessSecurity getAccessSecurity() {
104:                return m_accessSecurity;
105:            }
106:
107:            /**
108:             * @inheritDoc
109:             */
110:            public Set getCategories() {
111:                return Collections.unmodifiableSet(m_categories);
112:            }
113:
114:            /**
115:             * @inheritDoc
116:             */
117:            public String getDescription() {
118:                final String localizedToolDescription = m_activeToolManager
119:                        .getLocalizedToolProperty(this .getId(), "description");
120:
121:                if (localizedToolDescription == null) {
122:                    return m_description;
123:                } else {
124:                    return localizedToolDescription;
125:                }
126:            }
127:
128:            /**
129:             * @inheritDoc
130:             */
131:            public Properties getFinalConfig() {
132:                // return a copy so that it is read only
133:                Properties rv = new Properties();
134:                rv.putAll(m_finalConfig);
135:                return rv;
136:            }
137:
138:            /**
139:             * {@inheritDoc}
140:             */
141:            public String getHome() {
142:                return m_home;
143:            }
144:
145:            /**
146:             * @inheritDoc
147:             */
148:            public String getId() {
149:                return m_id;
150:            }
151:
152:            /**
153:             * @inheritDoc
154:             */
155:            public Set getKeywords() {
156:                return Collections.unmodifiableSet(m_keywords);
157:            }
158:
159:            /**
160:             * @inheritDoc
161:             */
162:            public Properties getMutableConfig() {
163:                // return a copy so that it is read only
164:                Properties rv = new Properties();
165:                rv.putAll(m_mutableConfig);
166:                return rv;
167:            }
168:
169:            /**
170:             * @inheritDoc
171:             */
172:            public Properties getRegisteredConfig() {
173:                // combine the final and mutable, and return a copy so that it is read only
174:                Properties rv = new Properties();
175:                rv.putAll(m_finalConfig);
176:                rv.putAll(m_mutableConfig);
177:                return rv;
178:            }
179:
180:            /**
181:             * @inheritDoc
182:             */
183:            public String getTitle() {
184:                final String localizedToolTitle = m_activeToolManager
185:                        .getLocalizedToolProperty(this .getId(), "title");
186:
187:                if (localizedToolTitle == null) {
188:                    return m_title;
189:                } else {
190:                    return localizedToolTitle;
191:                }
192:            }
193:
194:            /**
195:             * {@inheritDoc}
196:             */
197:            public int hashCode() {
198:                return getId().hashCode();
199:            }
200:
201:            /**
202:             * Set the access security.
203:             * 
204:             * @param access
205:             *        The new access security setting.
206:             */
207:            public void setAccessSecurity(Tool.AccessSecurity access) {
208:                m_accessSecurity = access;
209:            }
210:
211:            /**
212:             * Set the categories.
213:             * 
214:             * @param categories
215:             *        The new categories set (Strings).
216:             */
217:            public void setCategories(Set categories) {
218:                m_categories = categories;
219:            }
220:
221:            /**
222:             * Set the description.
223:             * 
224:             * @param description
225:             *        The description to set.
226:             */
227:            public void setDescription(String description) {
228:                m_description = description;
229:            }
230:
231:            public void setHome(String home) {
232:                m_home = home;
233:            }
234:
235:            /**
236:             * Set the id.
237:             * 
238:             * @param m_id
239:             *        The m_id to set.
240:             */
241:            public void setId(String id) {
242:                m_id = id;
243:            }
244:
245:            /**
246:             * Set the keywords.
247:             * 
248:             * @param keywords
249:             *        The new keywords set (Strings).
250:             */
251:            public void setKeywords(Set keywords) {
252:                m_keywords = keywords;
253:            }
254:
255:            /**
256:             * Set the registered configuration.
257:             * 
258:             * @param config
259:             *        The new registered configuration Properties.
260:             */
261:            public void setRegisteredConfig(Properties finalConfig,
262:                    Properties mutableConfig) {
263:                m_finalConfig = finalConfig;
264:                if (m_finalConfig == null) {
265:                    m_finalConfig = new Properties();
266:                }
267:
268:                m_mutableConfig = mutableConfig;
269:                if (m_mutableConfig == null) {
270:                    m_mutableConfig = new Properties();
271:                }
272:            }
273:
274:            /**
275:             * Set the title.
276:             * 
277:             * @param title
278:             *        The title to set.
279:             */
280:            public void setTitle(String title) {
281:                m_title = title;
282:            }
283:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.