diff options
-rw-r--r-- | WebContent/WEB-INF/portlet.xml | 6 | ||||
-rw-r--r-- | src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java | 13 | ||||
-rw-r--r-- | src/com/vaadin/terminal/gwt/server/ApplicationPortlet.java | 5 |
3 files changed, 18 insertions, 6 deletions
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 @@ </init-param> <init-param> <name>style</name> - <value>style=height:400px</value> + <value>height:400px</value> </init-param> <init-param> <name>widgetset</name> @@ -90,7 +90,7 @@ </init-param> <init-param> <name>style</name> - <value>style=height:650px</value> + <value>height:650px</value> </init-param> <init-param> <name>widgetset</name> @@ -311,7 +311,7 @@ </init-param> <init-param> <name>style</name> - <value>style=height:650px</value> + <value>height:650px</value> </init-param> <init-param> <name>widgetset</name> 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("<div id=\"" + request.getWindowID() + "\" class=\"" - + classNames + "\"></div>\n"); + + classNames + "\" " + divStyle + "></div>\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
|