You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2009/12/16 11:53:38 UTC

svn commit: r891182 - in /myfaces/tobago/trunk/example/test/src/main: java/org/apache/myfaces/tobago/example/test/MeasureBean.java webapp/type/measure.xhtml

Author: lofwyr
Date: Wed Dec 16 10:53:38 2009
New Revision: 891182

URL: http://svn.apache.org/viewvc?rev=891182&view=rev
Log:
TOBAGO-815: Type Measure doesn't work corretly with literals on JSPs.
 - test page

Modified:
    myfaces/tobago/trunk/example/test/src/main/java/org/apache/myfaces/tobago/example/test/MeasureBean.java
    myfaces/tobago/trunk/example/test/src/main/webapp/type/measure.xhtml

Modified: myfaces/tobago/trunk/example/test/src/main/java/org/apache/myfaces/tobago/example/test/MeasureBean.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/test/src/main/java/org/apache/myfaces/tobago/example/test/MeasureBean.java?rev=891182&r1=891181&r2=891182&view=diff
==============================================================================
--- myfaces/tobago/trunk/example/test/src/main/java/org/apache/myfaces/tobago/example/test/MeasureBean.java (original)
+++ myfaces/tobago/trunk/example/test/src/main/java/org/apache/myfaces/tobago/example/test/MeasureBean.java Wed Dec 16 10:53:38 2009
@@ -21,47 +21,74 @@
 import org.apache.myfaces.tobago.layout.PixelMeasure;
 
 public class MeasureBean {
-  
-  int intWidth = 200;
-  Integer integerWidth = new Integer(250);
-  Measure measureWidth = new PixelMeasure(300);
-  String stringWidth = "350";
-  String stringPxWidth = "400px";
-  long longWidth = 450L;
-  Any anyWidth = new Any();
 
   public int getIntWidth() {
-    return intWidth;
+    return 200;
+  }
+
+  public int getIntHeight() {
+    return 95;
   }
 
   public Integer getIntegerWidth() {
-    return integerWidth;
+    return 250;
+  }
+
+  public Integer getIntegerHeight() {
+    return 95;
   }
 
   public Measure getMeasureWidth() {
-    return measureWidth;
+    return new PixelMeasure(300);
+  }
+
+  public Measure getMeasureHeight() {
+    return new PixelMeasure(95);
   }
 
   public String getStringWidth() {
-    return stringWidth;
+    return "350";
+  }
+
+  public String getStringHeight() {
+    return "95";
   }
 
   public String getStringPxWidth() {
-    return stringPxWidth;
+    return "400px";
+  }
+
+  public String getStringPxHeight() {
+    return "95px";
   }
 
   public long getLongWidth() {
-    return longWidth;
+    return 450L;
+  }
+
+  public long getLongHeight() {
+    return 95L;
   }
 
   public Any getAnyWidth() {
-    return anyWidth;
+    return new Any("500");
+  }
+
+  public Any getAnyHeight() {
+    return new Any("95");
   }
 
   public static class Any {
+    
+    private String value;
+
+    public Any(String value) {
+      this.value = value;
+    }
+
     @Override
     public String toString() {
-      return "500";
+      return value;
     }
   }
 }

Modified: myfaces/tobago/trunk/example/test/src/main/webapp/type/measure.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/test/src/main/webapp/type/measure.xhtml?rev=891182&r1=891181&r2=891182&view=diff
==============================================================================
--- myfaces/tobago/trunk/example/test/src/main/webapp/type/measure.xhtml (original)
+++ myfaces/tobago/trunk/example/test/src/main/webapp/type/measure.xhtml Wed Dec 16 10:53:38 2009
@@ -9,52 +9,92 @@
 
   <tc:page id="page">
     <tc:gridLayoutConstraint width="600px" height="2000px"/>
-<f:facet name="layout">
-  <tc:gridLayout cellspacing="25px"/>
-</f:facet>
     <!--
-    Test of different ways to set the width of tc:gridLayoutConstraint.
+    Test of different ways to set the size of tc:gridLayoutConstraint and tc:image.
     There are literals like "100" or "100px" and 
     different types like: Measure, Integer, int, String (?)
     -->
-    
+
     <tc:image id="i-0" value="pidgeon-point.jpg">
-      <tc:gridLayoutConstraint width="100px" height="95px"/>
+      <tc:gridLayoutConstraint
+          width="100px" height="95px"
+          minimumWidth="100px" minimumHeight="95px"
+          preferredWidth="100px" preferredHeight="95px"
+          maximumWidth="100px" maximumHeight="95px"/>
     </tc:image>
     <tc:image id="i-1" value="pidgeon-point.jpg">
-      <tc:gridLayoutConstraint width="150" height="95px"/>
+      <tc:gridLayoutConstraint
+          width="150" height="95"
+          minimumWidth="150" minimumHeight="95"
+          preferredWidth="150" preferredHeight="95"
+          maximumWidth="150" maximumHeight="95"/>
     </tc:image>
     <tc:image id="i-2" value="pidgeon-point.jpg">
-      <tc:gridLayoutConstraint width="#{measureBean.intWidth}" height="95px"/>
+      <tc:gridLayoutConstraint
+          width="#{measureBean.intWidth}" height="#{measureBean.intHeight}"
+          minimumWidth="#{measureBean.intWidth}" minimumHeight="#{measureBean.intHeight}"
+          preferredWidth="#{measureBean.intWidth}" preferredHeight="#{measureBean.intHeight}"
+          maximumWidth="#{measureBean.intWidth}" maximumHeight="#{measureBean.intHeight}"/>
     </tc:image>
     <tc:image id="i-3" value="pidgeon-point.jpg">
-      <tc:gridLayoutConstraint width="#{measureBean.integerWidth}" height="95px"/>
+      <tc:gridLayoutConstraint
+          width="#{measureBean.integerWidth}" height="#{measureBean.integerHeight}"
+          minimumWidth="#{measureBean.integerWidth}" minimumHeight="#{measureBean.integerHeight}"
+          preferredWidth="#{measureBean.integerWidth}" preferredHeight="#{measureBean.integerHeight}"
+          maximumWidth="#{measureBean.integerWidth}" maximumHeight="#{measureBean.integerHeight}"/>
     </tc:image>
     <tc:image id="i-4" value="pidgeon-point.jpg">
-      <tc:gridLayoutConstraint width="#{measureBean.measureWidth}" height="95px"/>
+      <tc:gridLayoutConstraint
+          width="#{measureBean.measureWidth}" height="#{measureBean.measureHeight}"
+          minimumWidth="#{measureBean.measureWidth}" minimumHeight="#{measureBean.measureHeight}"
+          preferredWidth="#{measureBean.measureWidth}" preferredHeight="#{measureBean.measureHeight}"
+          maximumWidth="#{measureBean.measureWidth}" maximumHeight="#{measureBean.measureHeight}"/>
     </tc:image>
     <tc:image id="i-5" value="pidgeon-point.jpg">
-      <tc:gridLayoutConstraint width="#{measureBean.stringWidth}" height="95px"/>
+      <tc:gridLayoutConstraint
+          width="#{measureBean.stringWidth}" height="#{measureBean.stringHeight}"
+          minimumWidth="#{measureBean.stringWidth}" minimumHeight="#{measureBean.stringHeight}"
+          preferredWidth="#{measureBean.stringWidth}" preferredHeight="#{measureBean.stringHeight}"
+          maximumWidth="#{measureBean.stringWidth}" maximumHeight="#{measureBean.stringHeight}"/>
     </tc:image>
     <tc:image id="i-6" value="pidgeon-point.jpg">
-      <tc:gridLayoutConstraint width="#{measureBean.stringPxWidth}" height="95px"/>
+      <tc:gridLayoutConstraint
+          width="#{measureBean.stringPxWidth}" height="#{measureBean.stringPxHeight}"
+          minimumWidth="#{measureBean.stringPxWidth}" minimumHeight="#{measureBean.stringPxHeight}"
+          preferredWidth="#{measureBean.stringPxWidth}" preferredHeight="#{measureBean.stringPxHeight}"
+          maximumWidth="#{measureBean.stringPxWidth}" maximumHeight="#{measureBean.stringPxHeight}"/>
     </tc:image>
     <tc:image id="i-7" value="pidgeon-point.jpg">
-      <tc:gridLayoutConstraint width="#{measureBean.longWidth}" height="95px"/>
+      <tc:gridLayoutConstraint
+          width="#{measureBean.longWidth}" height="#{measureBean.longHeight}"
+          minimumWidth="#{measureBean.longWidth}" minimumHeight="#{measureBean.longHeight}"
+          preferredWidth="#{measureBean.longWidth}" preferredHeight="#{measureBean.longHeight}"
+          maximumWidth="#{measureBean.longWidth}" maximumHeight="#{measureBean.longHeight}"/>
     </tc:image>
     <tc:image id="i-8" value="pidgeon-point.jpg">
-      <tc:gridLayoutConstraint width="#{measureBean.anyWidth}" height="95px"/>
+      <tc:gridLayoutConstraint
+          width="#{measureBean.anyWidth}" height="#{measureBean.anyHeight}"
+          minimumWidth="#{measureBean.anyWidth}" minimumHeight="#{measureBean.anyHeight}"
+          preferredWidth="#{measureBean.anyWidth}" preferredHeight="#{measureBean.anyHeight}"
+          maximumWidth="#{measureBean.anyWidth}" maximumHeight="#{measureBean.anyHeight}"/>
     </tc:image>
 
     <tc:image id="j-0" value="pidgeon-point.jpg" width="100px" height="95px"/>
-    <tc:image id="j-1" value="pidgeon-point.jpg" width="150" height="95px"/>
-    <tc:image id="j-2" value="pidgeon-point.jpg" width="#{measureBean.intWidth}" height="95px"/>
-    <tc:image id="j-3" value="pidgeon-point.jpg" width="#{measureBean.integerWidth}" height="95px"/>
-    <tc:image id="j-4" value="pidgeon-point.jpg" width="#{measureBean.measureWidth}" height="95px"/>
-    <tc:image id="j-5" value="pidgeon-point.jpg" width="#{measureBean.stringWidth}" height="95px"/>
-    <tc:image id="j-6" value="pidgeon-point.jpg" width="#{measureBean.stringPxWidth}" height="95px"/>
-    <tc:image id="j-7" value="pidgeon-point.jpg" width="#{measureBean.longWidth}" height="95px"/>
-    <tc:image id="j-8" value="pidgeon-point.jpg" width="#{measureBean.anyWidth}" height="95px"/>
+    <tc:image id="j-1" value="pidgeon-point.jpg" width="150" height="95"/>
+    <tc:image id="j-2" value="pidgeon-point.jpg"
+              width="#{measureBean.intWidth}" height="#{measureBean.intHeight}"/>
+    <tc:image id="j-3" value="pidgeon-point.jpg"
+              width="#{measureBean.integerWidth}" height="#{measureBean.integerHeight}"/>
+    <tc:image id="j-4" value="pidgeon-point.jpg"
+              width="#{measureBean.measureWidth}" height="#{measureBean.measureHeight}"/>
+    <tc:image id="j-5" value="pidgeon-point.jpg"
+              width="#{measureBean.stringWidth}" height="#{measureBean.stringHeight}"/>
+    <tc:image id="j-6" value="pidgeon-point.jpg"
+              width="#{measureBean.stringPxWidth}" height="#{measureBean.stringPxHeight}"/>
+    <tc:image id="j-7" value="pidgeon-point.jpg"
+              width="#{measureBean.longWidth}" height="#{measureBean.longHeight}"/>
+    <tc:image id="j-8" value="pidgeon-point.jpg"
+              width="#{measureBean.anyWidth}" height="#{measureBean.anyHeight}"/>
 
     <!-- fixme: this filler is not nice, should work automatically -->
     <tc:cell>
@@ -62,7 +102,7 @@
     </tc:cell>
 
     <!-- checks below here -->
-    
+
     <tc:script file="script/test-utils.js"/>
 
     <tc:script onload="checkLayout('page:i-0', 0, 0, 100, 95);"/>