Top Description Fields Constructors Methods
javax.portlet

public Class PortletMode

extends Object
Class Inheritance
Imports
java.util.Locale

The PortletMode 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

Modifier and TypeField and Description
private String
public static final PortletMode
EDIT

Within the EDIT portlet mode, a portlet should provide content and logic that lets a user customize the behavior of the portlet.

public static final PortletMode
HELP

When in HELP portlet mode, a portlet should provide help information about the portlet.

public static final PortletMode
UNDEFINED

The portlet mode UNDEFINED is returned by the getPortletMode method when the portlet mode is not available.
public static final PortletMode
VIEW

The expected functionality for a portlet in VIEW portlet mode is to generate markup reflecting the current state of the portlet.

Constructor Summary

AccessConstructor and Description
public
PortletMode()

No-arg constructor to make object proxyable
public
PortletMode(String
The name of the portlet mode
name
)

Creates a new portlet mode with the given name.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true, if the specified object is equal with this portlet mode
equals
(Object
the portlet mode to compare this portlet mode with
object
)

Overrides java.lang.Object.equals.

Compares the specified object with this portlet mode for equality.
public int

Returns:

hash code value for this portlet mode
hashCode
()

Overrides java.lang.Object.hashCode.

Returns the hash code value for this portlet mode.
public String

Returns:

String representation of this portlet mode
toString
()

Overrides java.lang.Object.toString.

Returns a String representation of this portlet mode.
Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

_nameback to summary
private String _name
EDITback to summary
public static final PortletMode EDIT

Within the EDIT 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".

HELPback to summary
public static final PortletMode HELP

When in HELP 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".

UNDEFINEDback to summary
public static final PortletMode UNDEFINED

The portlet mode UNDEFINED is returned by the getPortletMode method when the portlet mode is not available.

This mode may not be used to set the portlet mode in the setPortletMode method.

The string value for this mode is "undefined".

Since
3.0
VIEWback to summary
public static final PortletMode VIEW

The expected functionality for a portlet in VIEW portlet mode is to generate markup reflecting the current state of the portlet. For example, the VIEW 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".

Constructor Detail

PortletModeback to summary
public PortletMode()

No-arg constructor to make object proxyable
Since
3.0
PortletModeback to summary
public PortletMode(String name)

Creates a new portlet mode with the given name.

Upper case letters in the name are converted to lower case letters.

Parameters
name:String

The name of the portlet mode

Method Detail

equalsback to summary
public boolean equals(Object object)

Overrides java.lang.Object.equals.

Compares the specified object with this portlet mode for equality. Returns true if the Strings equals method for the String representing the two portlet modes returns true.

Parameters
object:Object

the portlet mode to compare this portlet mode with

Returns:boolean

true, if the specified object is equal with this portlet mode

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.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.

Returns:int

hash code value for this portlet mode

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Returns a String representation of this portlet mode. Portlet mode names are always lower case names.

Returns:String

String representation of this portlet mode