From c1cc0a1d9db4f1bc3e9f0ae6b4b634a7b5aae89d Mon Sep 17 00:00:00 2001 From: Henri Sara Date: Tue, 5 Jan 2010 07:02:44 +0000 Subject: [PATCH] #3918 Portlet 2.0 modes: minor cleanup and comments svn changeset:10618/svn branch:6.2 --- .../server/AbstractApplicationPortlet.java | 24 +++++++------------ 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java b/src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java index 2dfb22c197..eda9670ff7 100644 --- a/src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java +++ b/src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java @@ -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(); -- 2.39.5