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


001:        /**********************************************************************************
002:         * $URL: https://source.sakaiproject.org/svn/content/tags/sakai_2-4-1/content-util/util/src/java/org/sakaiproject/content/util/BaseResourceAction.java $
003:         * $Id: BaseResourceAction.java 22149 2007-03-04 19:23:40Z jimeng@umich.edu $
004:         ***********************************************************************************
005:         *
006:         * Copyright (c) 2006, 2007 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.content.util;
021:
022:        import org.sakaiproject.content.api.ContentEntity;
023:        import org.sakaiproject.content.api.ResourceToolAction;
024:
025:        /**
026:         * Created by IntelliJ IDEA.
027:         * User: johnellis
028:         * Date: Jan 26, 2007
029:         * Time: 10:38:01 AM
030:         * To change this template use File | Settings | File Templates.
031:         */
032:        public class BaseResourceAction implements  ResourceToolAction {
033:            protected String id;
034:            protected ActionType actionType;
035:            protected String typeId;
036:            protected boolean available = true;
037:            protected Localizer localizer = null;
038:
039:            public BaseResourceAction(String id, ActionType actionType,
040:                    String typeId) {
041:                this .id = id;
042:                this .actionType = actionType;
043:                this .typeId = typeId;
044:            }
045:
046:            /**
047:             * Access the id of this action (which must be unique within this type and must be limited to alphnumeric characters).
048:             *
049:             * @return
050:             */
051:            public String getId() {
052:                return id;
053:            }
054:
055:            /**
056:             * Access the id of the ResourceType this action relates to.
057:             *
058:             * @return
059:             */
060:            public String getTypeId() {
061:                return typeId;
062:            }
063:
064:            /**
065:             * Access the enumerated constant for this action.
066:             *
067:             * @return
068:             */
069:            public ActionType getActionType() {
070:                return actionType;
071:            }
072:
073:            /**
074:             * @return
075:             */
076:            public String getLabel() {
077:                // if a Localizer is defined, use it to get the localized label
078:                // otherwise return null to let the resources tool handle the label for standard actions
079:                String label = null;
080:                if (this .localizer != null) {
081:                    label = this .localizer.getLabel();
082:                }
083:                return label;
084:            }
085:
086:            /* (non-Javadoc)
087:             * @see org.sakaiproject.content.api.ResourceToolAction#available(java.lang.String)
088:             */
089:            public boolean available(ContentEntity entity) {
090:                return this .available;
091:            }
092:
093:            public void setLocalizer(Localizer localizer) {
094:                this .localizer = localizer;
095:            }
096:
097:            /**
098:             * Localizer provides a way for the registrant to take charge of localizing labels 
099:             * without extending BaseResourceAction.  In defining actions, a registrant can create
100:             * instances of BaseResourceAction, implement the Localizer interface with a method
101:             * that provides localized strings, and set the localizer.  Subsequent invocation of
102:             * BaseResourceAction.getLabel() will use the Localizer to supply labels.
103:             */
104:            public interface Localizer {
105:                /**
106:                 *
107:                 * @return
108:                 */
109:                public String getLabel();
110:            }
111:
112:            /**
113:             * @param available the available to set
114:             */
115:            public void setAvailable(boolean available) {
116:                this.available = available;
117:            }
118:
119:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.