From: Henri Sara Date: Thu, 10 Dec 2009 10:54:35 +0000 (+0000) Subject: #3835 support for "style" parameter in portlet.xml X-Git-Tag: 6.7.0.beta1~2183 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=5b3984720263853aaf830cc326e851cbc0ad3764;p=vaadin-framework.git #3835 support for "style" parameter in portlet.xml svn changeset:10222/svn branch:6.2 --- diff --git a/WebContent/WEB-INF/portlet.xml b/WebContent/WEB-INF/portlet.xml index 54529685b1..2d58a61ae4 100644 --- a/WebContent/WEB-INF/portlet.xml +++ b/WebContent/WEB-INF/portlet.xml @@ -50,7 +50,7 @@ style - style=height:400px + height:400px widgetset @@ -90,7 +90,7 @@ style - style=height:650px + height:650px widgetset @@ -311,7 +311,7 @@ style - style=height:650px + height:650px widgetset diff --git a/src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java b/src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java index 9a5f4f0fb0..fd31333930 100644 --- a/src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java +++ b/src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java @@ -55,6 +55,12 @@ import com.vaadin.ui.Window; public abstract class AbstractApplicationPortlet extends GenericPortlet implements Constants { + /** + * This portlet parameter is used to add styles to the main element. E.g + * "height:500px" generates a style="height:500px" to the main element. + */ + public static final String PORTLET_PARAMETER_STYLE = "style"; + private static final String PORTAL_PARAMETER_VAADIN_THEME = "vaadin.theme"; // TODO some parts could be shared with AbstractApplicationServlet @@ -926,8 +932,13 @@ public abstract class AbstractApplicationPortlet extends GenericPortlet String classNames = "v-app v-app-loading " + themeClass + " " + appClass; + String style = getApplicationProperty(PORTLET_PARAMETER_STYLE); + String divStyle = ""; + if (style != null) { + divStyle = "style=\"" + style + "\""; + } page.write("
\n"); + + classNames + "\" " + divStyle + ">\n"); page.close(); } diff --git a/src/com/vaadin/terminal/gwt/server/ApplicationPortlet.java b/src/com/vaadin/terminal/gwt/server/ApplicationPortlet.java index e53d5d8d25..c865121a3c 100644 --- a/src/com/vaadin/terminal/gwt/server/ApplicationPortlet.java +++ b/src/com/vaadin/terminal/gwt/server/ApplicationPortlet.java @@ -20,9 +20,10 @@ import com.liferay.portal.kernel.util.PropsUtil; import com.vaadin.Application; /** - * @deprecated Use Portlet 2.0 class {@link ApplicationPortlet2} instead. + * Portlet main class for Portlet 1.0 (JSR-168) portlets which consist of a + * portlet and a servlet. For Portlet 2.0 (JSR-286, no servlet required), use + * {@link ApplicationPortlet2} instead. */ -@Deprecated @SuppressWarnings("serial") public class ApplicationPortlet implements Portlet, Serializable { // portlet configuration parameters