Source Code Cross Referenced for PortletMode.java in  » Portal » gridsphere » javax » portlet » 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 » javax.portlet 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         * Copyright 2003 IBM Corporation and Sun Microsystems, Inc.
003:         * All rights reserved.
004:         * Use is subject to license terms.
005:         */package javax.portlet;
006:
007:        /**
008:         * The <CODE>PortletMode</CODE> class represents
009:         * the possible modes that a portlet can assume.
010:         * <P>
011:         * A portlet mode indicates the function a portlet is performing.
012:         * Normally, portlets perform different tasks and create different
013:         * content depending on the function they are currently performing.
014:         * When invoking a portlet, the portlet container provides the
015:         * current portlet mode to the portlet.
016:         * <p/>
017:         * Portlets can programmatically change their portlet
018:         * mode when processing an action request.
019:         * <P>
020:         * This class defines the default portlet modes <code>EDIT, HELP, VIEW</code>.
021:         * Additional portlet modes may be defined by calling the constructor
022:         * of this class. If a portal/portlet-container does not support a
023:         * custom portlet mode defined in the portlet application deployment descriptor,
024:         * the custom portlet mode will be ignored by the portal/portlet container.
025:         */
026:        public class PortletMode {
027:
028:            /**
029:             * The expected functionality for a portlet in <code>VIEW</code> portlet mode
030:             * is to generate markup reflecting the current state of the portlet.
031:             * For example, the <code>VIEW</code> portlet mode of a portlet may
032:             * include one or more screens that the user can navigate and interact
033:             * with, or it may consist of static content that does not require any
034:             * user interaction.
035:             * <P>
036:             * This mode must be supported by the portlet.
037:             * <p/>
038:             * The string value for this mode is <code>"view"</code>.
039:             */
040:            public final static PortletMode VIEW = new PortletMode("view");
041:
042:            /**
043:             * Within the <code>EDIT</code> portlet mode, a portlet should provide
044:             * content and logic that lets a user customize the behavior of the portlet.
045:             * The EDIT portlet mode may include one or more screens among which
046:             * users can navigate to enter their customization data.
047:             * <p/>
048:             * Typically, portlets in <code>EDIT</code> portlet mode will
049:             * set or update portlet preferences.
050:             * <P>
051:             * This mode is optional.
052:             * <p/>
053:             * The string value for this mode is <code>"edit"</code>.
054:             */
055:            public final static PortletMode EDIT = new PortletMode("edit");
056:
057:            /**
058:             * When in <code>HELP</code> portlet mode, a portlet should provide help
059:             * information about the portlet. This help information could be
060:             * a simple help screen explaining the entire portlet in
061:             * coherent text or it could be context-sensitive help.
062:             * <P>
063:             * This mode is optional.
064:             * <p/>
065:             * The string value for this mode is <code>"help"</code>.
066:             */
067:            public final static PortletMode HELP = new PortletMode("help");
068:
069:            private String _name;
070:
071:            /**
072:             * Creates a new portlet mode with the given name.
073:             * <p/>
074:             * Upper case letters in the name are converted to
075:             * lower case letters.
076:             *
077:             * @param name The name of the portlet mode
078:             */
079:            public PortletMode(String name) {
080:                if (name == null) {
081:                    throw new IllegalArgumentException(
082:                            "PortletMode name can not be NULL");
083:                }
084:                _name = name.toLowerCase();
085:            }
086:
087:            /**
088:             * Returns a String representation of this portlet mode.
089:             * Portlet mode names are always lower case names.
090:             *
091:             * @return String representation of this portlet mode
092:             */
093:            public String toString() {
094:                return _name;
095:            }
096:
097:            /**
098:             * Returns the hash code value for this portlet mode.
099:             * The hash code is constructed by producing the
100:             * hash value of the String value of this mode.
101:             *
102:             * @return hash code value for this portlet mode
103:             */
104:            public int hashCode() {
105:                return _name.hashCode();
106:            }
107:
108:            /**
109:             * Compares the specified object with this portlet mode
110:             * for equality. Returns <code>true</code> if the
111:             * Strings <code>equals</code> method for the String
112:             * representing the two portlet modes returns <code>true</code>.
113:             *
114:             * @param object the portlet mode to compare this portlet mode with
115:             * @return true, if the specified object is equal with this portlet mode
116:             */
117:            public boolean equals(Object object) {
118:                if (object instanceof  PortletMode)
119:                    return _name.equals(((PortletMode) object)._name);
120:                else
121:                    return false;
122:            }
123:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.