站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBOSS Portal 2.2 API 英文版文档

PortletContextImpl - JBOSS Portal 2.2 API 英文版文档


org.jboss.portal.theme.impl.page
Class PortletContextImpl

java.lang.Object
  extended byorg.jboss.portal.theme.impl.page.PortletContextImpl
All Implemented Interfaces:
PortletContext

public class PortletContextImpl
extends java.lang.Object
implements PortletContext

An implementation of the portlet context.

A portlet context represents a portlet on a page with all of its current state. The portlet context can be used in the layout strategy to manipulate the rendering of the requested page. (See the layout strategy documentation for more details).

See Also:
PortletContext, LayoutStrategy

Method Summary
 boolean equals(java.lang.Object o)
           
 int getOrder()
          Get the order of the portlet in its region.
 Mode getPortletMode()
          Get the current portlet mode of this portlet instance.
 java.lang.String getRegionName()
          Get name of the page region this portlet is assigned to.
 java.util.Set getSupportedPortletModes(MediaType contentType)
          Get a set of modes that this portlet supports.
 java.util.Set getSupportedWindowStates()
          Get the set of window states allowed by this portlet.
 WindowContext getWindowContext()
          Get the window context of this portlet on the currently requested page.
 java.lang.String getWindowID()
          Get a handle to the portlet window for this portlet context.
 WindowState getWindowState()
          Get the current portlet window state of this portlet instance.
 int hashCode()
           
 boolean isModeSupported(Mode mode, MediaType mediaType)
          Check if the provided mode is valid for the media type (content type) presented.
 boolean isSupportedWindowState(WindowState windowState)
          Check if the provided WindowState is allowed for this portlet.
 void setOrder(int order)
          Set the sort order of this portlet in its region.
 void setRegionName(java.lang.String regionName)
          Assign the portlet to a different region of the page.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

getWindowState

public WindowState getWindowState()
                           throws ThemeException
Description copied from interface: PortletContext
Get the current portlet window state of this portlet instance.

Specified by:
getWindowState in interface PortletContext
Returns:
the current portlet window state of this portlet instance
Throws:
ThemeException - if the current navigational state is unknown
See Also:
PortletContext.getWindowState()

getPortletMode

public Mode getPortletMode()
                    throws ThemeException
Description copied from interface: PortletContext
Get the current portlet mode of this portlet instance.

Specified by:
getPortletMode in interface PortletContext
Returns:
the current portlet mode of this portlet
Throws:
ThemeException - if the current navigational state is unknown

isSupportedWindowState

public boolean isSupportedWindowState(WindowState windowState)
                               throws ThemeException
Description copied from interface: PortletContext
Check if the provided WindowState is allowed for this portlet.

Specified by:
isSupportedWindowState in interface PortletContext
Parameters:
windowState - the window state to check against the allowed ones
Returns:
true if the getWindows state is allowed
Throws:
java.lang.IllegalArgumentException - if the window state is null
ThemeException - if the state provider is unknown
See Also:
PortletContext.isSupportedWindowState(org.jboss.portal.WindowState)

getSupportedWindowStates

public java.util.Set getSupportedWindowStates()
                                       throws ThemeException
Description copied from interface: PortletContext
Get the set of window states allowed by this portlet.

Specified by:
getSupportedWindowStates in interface PortletContext
Returns:
the set of window states allowed by this portlet
Throws:
ThemeException - if the state provider is unknown
See Also:
PortletContext.getSupportedWindowStates()

getRegionName

public java.lang.String getRegionName()
Description copied from interface: PortletContext
Get name of the page region this portlet is assigned to.

Specified by:
getRegionName in interface PortletContext
Returns:
the name of the page region this portlet is assigned to.
See Also:
PortletContext.getRegionName()

setRegionName

public void setRegionName(java.lang.String regionName)
Description copied from interface: PortletContext
Assign the portlet to a different region of the page.

In order to assign this portlet to another region, the region must be one of the available regions of the current page. The change will not be persisted outside the current request.

Specified by:
setRegionName in interface PortletContext
Parameters:
regionName - the name of the region to re-assign the portlet to
See Also:
PortletContext.setRegionName(String)

getOrder

public int getOrder()
Description copied from interface: PortletContext
Get the order of the portlet in its region.

Specified by:
getOrder in interface PortletContext
Returns:
the order of the portlet in its region
See Also:
PortletContext.getOrder()

setOrder

public void setOrder(int order)
Description copied from interface: PortletContext
Set the sort order of this portlet in its region.

Note: this change is only valid for the current request, and will not be persisted

Specified by:
setOrder in interface PortletContext
Parameters:
order - the sort order to assign to this portlet
See Also:
PortletContext.setOrder(int)

getWindowID

public java.lang.String getWindowID()
Description copied from interface: PortletContext
Get a handle to the portlet window for this portlet context.

Specified by:
getWindowID in interface PortletContext
Returns:
the handle to the window of this portlet context
See Also:
PortletContext.getWindowID()

getSupportedPortletModes

public java.util.Set getSupportedPortletModes(MediaType contentType)
                                       throws ThemeException
Description copied from interface: PortletContext
Get a set of modes that this portlet supports.

Portlet modes are defined per content type.

Specified by:
getSupportedPortletModes in interface PortletContext
Parameters:
contentType - the content type for which to look for the supported modes.
Returns:
the set of supported modes of this portlet
Throws:
ThemeException - if the mode provider is unknown
See Also:
PortletContext.getSupportedPortletModes(org.jboss.portal.common.MediaType)

isModeSupported

public boolean isModeSupported(Mode mode,
                               MediaType mediaType)
                        throws ThemeException
Description copied from interface: PortletContext
Check if the provided mode is valid for the media type (content type) presented.

Note: you can also check if the portal supports this mode via the strategy context

Specified by:
isModeSupported in interface PortletContext
Parameters:
mode - the mode to check
mediaType - the content type to check the mode for
Returns:
true if the mode is supported for this content type by this portlet
Throws:
ThemeException - if the mode provider is unknown
See Also:
PortletContext.isModeSupported(org.jboss.portal.Mode, org.jboss.portal.common.MediaType)

getWindowContext

public WindowContext getWindowContext()
Description copied from interface: PortletContext
Get the window context of this portlet on the currently requested page.

The window context is a state holder to get access to the portlet's position on the page.

Specified by:
getWindowContext in interface PortletContext
Returns:
the window context for this portlet window
See Also:
PortletContext.getWindowContext()

equals

public boolean equals(java.lang.Object o)
See Also:
Object.equals(java.lang.Object)

hashCode

public int hashCode()
See Also:
Object.hashCode()

toString

public java.lang.String toString()
See Also:
Object.toString()