Class PortletMode
- java.lang.Object
-
- javax.portlet.PortletMode
-
public class PortletMode extends java.lang.Object
ThePortletMode
class represents the possible modes that a portlet can assume.A portlet mode indicates the function a portlet is performing. Normally, portlets perform different tasks and create different content depending on the function they are currently performing. When invoking a portlet, the portlet container provides the current portlet mode to the portlet.
Portlets can programmatically change their portlet mode when processing an action request.
This class defines the default portlet modes
EDIT, HELP, VIEW
. Additional portlet modes may be defined by calling the constructor of this class. If a portal/portlet-container does not support a custom portlet mode defined in the portlet application deployment descriptor, the custom portlet mode will be ignored by the portal/portlet container.
-
-
Field Summary
Fields Modifier and Type Field Description static PortletMode
EDIT
Within theEDIT
portlet mode, a portlet should provide content and logic that lets a user customize the behavior of the portlet.static PortletMode
HELP
When inHELP
portlet mode, a portlet should provide help information about the portlet.static PortletMode
VIEW
The expected functionality for a portlet inVIEW
portlet mode is to generate markup reflecting the current state of the portlet.
-
Constructor Summary
Constructors Constructor Description PortletMode(java.lang.String name)
Creates a new portlet mode with the given name.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object object)
Compares the specified object with this portlet mode for equality.int
hashCode()
Returns the hash code value for this portlet mode.java.lang.String
toString()
Returns a String representation of this portlet mode.
-
-
-
Field Detail
-
VIEW
public static final PortletMode VIEW
The expected functionality for a portlet inVIEW
portlet mode is to generate markup reflecting the current state of the portlet. For example, theVIEW
portlet mode of a portlet may include one or more screens that the user can navigate and interact with, or it may consist of static content that does not require any user interaction.This mode must be supported by the portlet.
The string value for this mode is
"view"
.
-
EDIT
public static final PortletMode EDIT
Within theEDIT
portlet mode, a portlet should provide content and logic that lets a user customize the behavior of the portlet. The EDIT portlet mode may include one or more screens among which users can navigate to enter their customization data.Typically, portlets in
EDIT
portlet mode will set or update portlet preferences.This mode is optional.
The string value for this mode is
"edit"
.
-
HELP
public static final PortletMode HELP
When inHELP
portlet mode, a portlet should provide help information about the portlet. This help information could be a simple help screen explaining the entire portlet in coherent text or it could be context-sensitive help.This mode is optional.
The string value for this mode is
"help"
.
-
-
Method Detail
-
toString
public java.lang.String toString()
Returns a String representation of this portlet mode. Portlet mode names are always lower case names.- Overrides:
toString
in classjava.lang.Object
- Returns:
- String representation of this portlet mode
-
hashCode
public int hashCode()
Returns the hash code value for this portlet mode. The hash code is constructed by producing the hash value of the String value of this mode.- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- hash code value for this portlet mode
-
equals
public boolean equals(java.lang.Object object)
Compares the specified object with this portlet mode for equality. Returnstrue
if the Stringsequals
method for the String representing the two portlet modes returnstrue
.- Overrides:
equals
in classjava.lang.Object
- Parameters:
object
- the portlet mode to compare this portlet mode with- Returns:
- true, if the specified object is equal with this portlet mode
-
-