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/10/30 16:23:33 UTC

svn commit: r831328 - /myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/webapp/TobagoResponseWriterImpl.java

Author: lofwyr
Date: Fri Oct 30 15:23:30 2009
New Revision: 831328

URL: http://svn.apache.org/viewvc?rev=831328&view=rev
Log:
TOBAGO-812: Refactor Style Handling of components

Modified:
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/webapp/TobagoResponseWriterImpl.java

Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/webapp/TobagoResponseWriterImpl.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/webapp/TobagoResponseWriterImpl.java?rev=831328&r1=831327&r2=831328&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/webapp/TobagoResponseWriterImpl.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/webapp/TobagoResponseWriterImpl.java Fri Oct 30 15:23:30 2009
@@ -120,7 +120,6 @@
     return stack;
   }
 
-
   public final boolean isXml() {
     return xml;
   }
@@ -412,7 +411,7 @@
     styles = addLayout(styles);
 
     if (styles != null) {
-      writeAttribute(HtmlAttributes.STYLE, styles.toString(), false);
+      writeAttribute(HtmlAttributes.STYLE, styles.encode(), false);
     }
   }
 
@@ -429,7 +428,7 @@
         width = width.substractNotNegative(ThemeConfig.getMeasure(facesContext, component, "css.padding-right"));
         width = width.substractNotNegative(ThemeConfig.getMeasure(facesContext, component, "css.border-right-width"));
         styles = ensureHtmlStyleMap(component, styles);
-        styles.put(Attributes.WIDTH, width);
+        styles.setWidth(width);
       }
       Measure height = layoutComponent.getHeight();
       if (height != null) {
@@ -440,28 +439,28 @@
         height
             = height.substractNotNegative(ThemeConfig.getMeasure(facesContext, component, "css.border-bottom-width"));
         styles = ensureHtmlStyleMap(component, styles);
-        styles.put(Attributes.HEIGHT, height);
+        styles.setHeight(height);
       }
       Measure left = layoutComponent.getLeft();
       if (left != null) {
         styles = ensureHtmlStyleMap(component, styles);
-        styles.put(Attributes.LEFT, left);
+        styles.setLeft(left);
       }
       Measure top = layoutComponent.getTop();
       if (top != null) {
         styles = ensureHtmlStyleMap(component, styles);
-        styles.put(Attributes.TOP, top);
+        styles.setTop(top);
       }
       // if there are a position coordinates, activate absolute positioning
       // XXX String "Page" is not nice here
       if ((left != null || top != null) && !component.getRendererType().contains("Page")) {
         styles = ensureHtmlStyleMap(component, styles);
-        styles.put(CssProperties.POSITION, CssProperties.Position.ABSOLUTE);
+        styles.setPosition(CssProperties.Position.ABSOLUTE);
       }
       Display display = layoutComponent.getDisplay();
       if (display != null) {
         styles = ensureHtmlStyleMap(component, styles);
-        styles.put(CssProperties.DISPLAY, display.getValue());
+        styles.setDisplay(display);
       }
     }
     return styles;