]> source.dussan.org Git - vaadin-framework.git/commitdiff
#3835 support for "style" parameter in portlet.xml
authorHenri Sara <henri.sara@itmill.com>
Thu, 10 Dec 2009 10:54:35 +0000 (10:54 +0000)
committerHenri Sara <henri.sara@itmill.com>
Thu, 10 Dec 2009 10:54:35 +0000 (10:54 +0000)
svn changeset:10222/svn branch:6.2

WebContent/WEB-INF/portlet.xml
src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java
src/com/vaadin/terminal/gwt/server/ApplicationPortlet.java

index 54529685b1d96b0b9f31f65dc1cb630386ad64a6..2d58a61ae4d64813ca757b956640140b2ca64a28 100644 (file)
@@ -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>
                </init-param>
                <init-param>
                        <name>style</name>
-                       <value>style=height:650px</value>
+                       <value>height:650px</value>
                </init-param>
                <init-param>
                        <name>widgetset</name>
index 9a5f4f0fb0d8d97a6c21624e3be41156467a4d78..fd3133393083d1535a424f658c640f744e327d4a 100644 (file)
@@ -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();
     }
index e53d5d8d2555acd2ecb7ea9d304e5ea5a205a1d8..c865121a3c274420539082352f7801cbbd58496c 100644 (file)
@@ -20,9 +20,10 @@ import com.liferay.portal.kernel.util.PropsUtil;
 import com.vaadin.Application;\r
 \r
 /**\r
- * @deprecated Use Portlet 2.0 class {@link ApplicationPortlet2} instead.\r
+ * Portlet main class for Portlet 1.0 (JSR-168) portlets which consist of a\r
+ * portlet and a servlet. For Portlet 2.0 (JSR-286, no servlet required), use\r
+ * {@link ApplicationPortlet2} instead.\r
  */\r
-@Deprecated\r
 @SuppressWarnings("serial")\r
 public class ApplicationPortlet implements Portlet, Serializable {\r
     // portlet configuration parameters\r