org.jboss.portal.server.theme.strategy
Interface PortletContext

All Known Implementing Classes:
PortletContextImpl

public interface PortletContext

This interface represents one portlet on a page (-region).

Based on the currently requested page, the portal determines the portlets that need to be rendered. Before calling the portlet container for each of them, the layout strategy has a chance to change some of the behavior. The PortletContext is the way for the portal to communicate the state of an individual portlet to the layout strategy.

See Also:
LayoutStrategy, StrategyContext

Method Summary
 int getOrder()
          Get the order of the portlet in its region.
 java.lang.String getPortletName()
          Get the name of th portlet this context represents.
 java.lang.String getRegionName()
          Get name of the page region this portlet is assigned to.
 java.util.Set getSupportedWindowStates()
          Get the set of window states allowed by this portlet.
 WindowState getWindowState()
          Get the current portlet window state of this portlet instance.
 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.
 

Method Detail

getPortletName

java.lang.String getPortletName()
Get the name of th portlet this context represents.

Returns:
the name of this portlet

getWindowState

WindowState getWindowState()
Get the current portlet window state of this portlet instance.

Returns:
the current portlet window state of this portlet instance
See Also:
WindowState

isSupportedWindowState

boolean isSupportedWindowState(WindowState windowState)
Check if the provided WindowState is allowed for this portlet.

Parameters:
windowState - the window state to check against the allowed ones
Returns:
true if the windows state is allowed
Throws:
java.lang.IllegalArgumentException - if the window state is null

getSupportedWindowStates

java.util.Set getSupportedWindowStates()
Get the set of window states allowed by this portlet.

Returns:
the set of window states allowed by this portlet

getRegionName

java.lang.String getRegionName()
Get name of the page region this portlet is assigned to.

Returns:
the name of the page region this portlet is assigned to.

setRegionName

void setRegionName(java.lang.String regionName)
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.

Parameters:
regionName - the name of the region to re-assign the portlet to
See Also:
StrategyContext.getRegions()

getOrder

int getOrder()
Get the order of the portlet in its region.

Returns:
the order of the portlet in its region

setOrder

void setOrder(int order)
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

Parameters:
order - the sort order to assign to this portlet