]> source.dussan.org Git - vaadin-framework.git/commitdiff
#3918 Portlet 2.0 modes: minor cleanup and comments
authorHenri Sara <henri.sara@itmill.com>
Tue, 5 Jan 2010 07:02:44 +0000 (07:02 +0000)
committerHenri Sara <henri.sara@itmill.com>
Tue, 5 Jan 2010 07:02:44 +0000 (07:02 +0000)
svn changeset:10618/svn branch:6.2

src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java

index 2dfb22c19755658c69dd5fe5b2f2c8d12e920087..eda9670ff72657800dad8df6812fcd21a043b72a 100644 (file)
@@ -495,28 +495,22 @@ public abstract class AbstractApplicationPortlet extends GenericPortlet
     }
 
     /**
-     * Returns a window for a portlet mode. By default, the main window is
-     * returned. To use different portlet modes in a portlet, register windows
-     * named after the portlet modes in the application.
-     *
+     * Returns a window for a portlet mode. To define custom content for a
+     * portlet mode, add (in the application) a window whose name matches the
+     * portlet mode name. By default, the main window is returned.
+     * 
      * Alternatively, a PortletListener can change the main window content.
-     *
-     * The window name requested from the application
-     *
+     * 
      * @param request
      * @param application
-     * @return Window to show in the portlet
+     * @return Window to show in the portlet for the given portlet mode
      */
     protected Window getPortletWindow(PortletRequest request,
             Application application) {
         PortletMode mode = request.getPortletMode();
-        if (PortletMode.VIEW.equals(mode)) {
-            return application.getMainWindow();
-        } else {
-            Window window = application.getWindow(mode.toString());
-            if (window != null) {
-                return window;
-            }
+        Window window = application.getWindow(mode.toString());
+        if (window != null) {
+            return window;
         }
         // no specific window found
         return application.getMainWindow();