myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bom...@apache.org
Subject svn commit: r813855 - /myfaces/tobago/trunk/extension/facelets/src/main/java/org/apache/myfaces/tobago/facelets/DeprecatedDimensionRule.java
Date Fri, 11 Sep 2009 14:31:17 GMT
Author: bommel
Date: Fri Sep 11 14:31:16 2009
New Revision: 813855

URL: http://svn.apache.org/viewvc?rev=813855&view=rev
Log:
TOBAGO-606: Layout-Manager
 - put the deprecated height/width attributes of tc:popup and tc:page into one interface

Modified:
    myfaces/tobago/trunk/extension/facelets/src/main/java/org/apache/myfaces/tobago/facelets/DeprecatedDimensionRule.java

Modified: myfaces/tobago/trunk/extension/facelets/src/main/java/org/apache/myfaces/tobago/facelets/DeprecatedDimensionRule.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/extension/facelets/src/main/java/org/apache/myfaces/tobago/facelets/DeprecatedDimensionRule.java?rev=813855&r1=813854&r2=813855&view=diff
==============================================================================
--- myfaces/tobago/trunk/extension/facelets/src/main/java/org/apache/myfaces/tobago/facelets/DeprecatedDimensionRule.java
(original)
+++ myfaces/tobago/trunk/extension/facelets/src/main/java/org/apache/myfaces/tobago/facelets/DeprecatedDimensionRule.java
Fri Sep 11 14:31:16 2009
@@ -24,6 +24,7 @@
 import com.sun.facelets.tag.TagAttribute;
 import org.apache.myfaces.tobago.component.Attributes;
 import org.apache.myfaces.tobago.component.UIPage;
+import org.apache.myfaces.tobago.component.DeprecatedDimension;
 import org.apache.myfaces.tobago.layout.Measure;
 
 public class DeprecatedDimensionRule extends MetaRule {
@@ -32,14 +33,12 @@
 
   public Metadata applyRule(String name, TagAttribute attribute,
       MetadataTarget metadataTarget) {
-    if (metadataTarget.isTargetInstanceOf(UIPage.class)) {
-      if (attribute.isLiteral()) {
-        if (Attributes.WIDTH.equals(name)) {
-          return new WidthMapper(attribute);
-        }
-        if (Attributes.HEIGHT.equals(name)) {
-          return new HeightMapper(attribute);
-        }
+    if (attribute.isLiteral()) {
+      if (Attributes.WIDTH.equals(name)) {
+        return new WidthMapper(attribute);
+      }
+      if (Attributes.HEIGHT.equals(name)) {
+        return new HeightMapper(attribute);
       }
     }
     return null;
@@ -71,8 +70,7 @@
     }
 
   public void applyMetadata(FaceletContext ctx, Object instance) {
-      UIPage page = (UIPage) instance;
-      page.setWidth(Measure.parse(attribute.getValue()));
+      ((DeprecatedDimension) instance).setWidth(Measure.parse(attribute.getValue()));
     }
   }
 
@@ -84,8 +82,7 @@
     }
 
     public void applyMetadata(FaceletContext ctx, Object instance) {
-      UIPage page = (UIPage) instance;
-      page.setHeight(Measure.parse(attribute.getValue()));
+      ((DeprecatedDimension) instance).setHeight(Measure.parse(attribute.getValue()));
     }
   }
 }



Mime
View raw message