KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > portal > server > theme > strategy > PortletContext


1 /*
2  * JBoss, the OpenSource J2EE webOS
3  *
4  * Distributable under LGPL license.
5  * See terms of license at gnu.org.
6  */

7
8 package org.jboss.portal.server.theme.strategy;
9
10 import org.jboss.portal.server.plugins.windowstate.WindowState;
11
12 import java.util.Set JavaDoc;
13
14 /**
15  * This interface represents one portlet on a page (-region).
16  * <p>Based on the currently requested page, the portal determines the portlets that need to be rendered.
17  * Before calling the portlet container for each of them, the layout strategy has a chance to change some of the behavior.
18  * The PortletContext is the way for the portal to communicate the state of an individual portlet to the layout strategy.
19  *
20  * @author <a HREF="mailto:mholzner@novell.com">Martin Holzner</a>.
21  * @version <tt>$Revision: 1.3 $</tt>
22  * @see LayoutStrategy
23  * @see StrategyContext
24  */

25 public interface PortletContext
26 {
27    /**
28     * Get the name of th portlet this context represents.
29     *
30     * @return the name of this portlet
31     */

32    String JavaDoc getPortletName();
33
34    /**
35     * Get the current portlet window state of this portlet instance.
36     *
37     * @return the current portlet window state of this portlet instance
38     * @see WindowState
39     */

40    WindowState getWindowState();
41
42    /**
43     * Check if the provided WindowState is allowed for this portlet.
44     *
45     * @param windowState the window state to check against the allowed ones
46     * @return true if the windows state is allowed
47     * @throws IllegalArgumentException if the window state is null
48     */

49    boolean isSupportedWindowState(WindowState windowState);
50
51    /**
52     * Get the set of window states allowed by this portlet.
53     *
54     * @return the set of window states allowed by this portlet
55     */

56    Set JavaDoc getSupportedWindowStates();
57
58    /**
59     * Get name of the page region this portlet is assigned to.
60     *
61     * @return the name of the page region this portlet is assigned to.
62     */

63    String JavaDoc getRegionName();
64
65    /**
66     * Assign the portlet to a different region of the page.
67     * <p>In order to assign this portlet to another region, the region must be one of the available
68     * regions of the current page. The change will not be persisted outside the current request.</p>
69     *
70     * @param regionName the name of the region to re-assign the portlet to
71     * @see StrategyContext#getRegions
72     */

73    void setRegionName(String JavaDoc regionName);
74
75    /**
76     * Get the order of the portlet in its region.
77     *
78     * @return the order of the portlet in its region
79     */

80    int getOrder();
81
82    /**
83     * Set the sort order of this portlet in its region.
84     * <p>Note: this change is only valid for the current request, and will not be persisted</p>
85     *
86     * @param order the sort order to assign to this portlet
87     */

88    void setOrder(int order);
89 }
90
Popular Tags