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 2008/10/24 15:15:49 UTC

svn commit: r707626 - in /myfaces/tobago/trunk: core/src/main/java/org/apache/myfaces/tobago/component/ core/src/main/java/org/apache/myfaces/tobago/layout/ core/src/main/java/org/apache/myfaces/tobago/layout/grid/ core/src/main/java/org/apache/myfaces...

Author: lofwyr
Date: Fri Oct 24 06:15:48 2008
New Revision: 707626

URL: http://svn.apache.org/viewvc?rev=707626&view=rev
Log:
TOBAGO-606: Layout
* begin to integrate the new layout into the component tree

Added:
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/AbstractUIGridConstraints.java   (contents, props changed)
      - copied, changed from r707566, myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/grid/GridConstraints.java
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/GridConstraintsTagDeclaration.java   (contents, props changed)
      - copied, changed from r707030, myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/GridLayoutTagDeclaration.java
    myfaces/tobago/trunk/example/demo/src/main/webapp/reference/layout-test.jsp   (contents, props changed)
      - copied, changed from r707030, myfaces/tobago/trunk/example/demo/src/main/webapp/reference/input.jsp
Removed:
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/grid/GridConstraints.java
Modified:
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/AbstractUIGridLayout.java
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/AbstractUIPage.java
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UIInputBase.java
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/Component.java
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/Container.java
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/LayoutContext.java
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/grid/GridLayoutManager.java
    myfaces/tobago/trunk/core/src/test/java/org/apache/myfaces/tobago/layout/MockComponent.java
    myfaces/tobago/trunk/core/src/test/java/org/apache/myfaces/tobago/layout/MockContainer.java
    myfaces/tobago/trunk/core/src/test/java/org/apache/myfaces/tobago/layout/grid/GridLayoutManagerUnitTest.java
    myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PageRenderer.java
    myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TextAreaRenderer.java

Copied: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/AbstractUIGridConstraints.java (from r707566, myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/grid/GridConstraints.java)
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/AbstractUIGridConstraints.java?p2=myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/AbstractUIGridConstraints.java&p1=myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/grid/GridConstraints.java&r1=707566&r2=707626&rev=707626&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/grid/GridConstraints.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/AbstractUIGridConstraints.java Fri Oct 24 06:15:48 2008
@@ -1,4 +1,4 @@
-package org.apache.myfaces.tobago.layout.grid;
+package org.apache.myfaces.tobago.component;
 
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -17,16 +17,18 @@
  * limitations under the License.
  */
 
-import org.apache.myfaces.tobago.layout.Component;
 import org.apache.myfaces.tobago.layout.Constraints;
 import org.apache.myfaces.tobago.layout.Dimension;
 import org.apache.myfaces.tobago.layout.Measure;
+import org.apache.myfaces.tobago.layout.PixelMeasure;
+
+import javax.faces.component.UIComponentBase;
 
 /*
  * User: lofwyr
  * Date: 13.02.2008 20:47:28
  */
-public class GridConstraints implements Constraints {
+public abstract class AbstractUIGridConstraints extends UIComponentBase implements Constraints {
 
   private int columnSpan = 1;
 
@@ -42,18 +44,9 @@
 
   private Measure height;
 
-  /**
-   * Convenience method to get the correct layout constraints from the component.
-   * If the constraints object doesn't exists it will be created a default and set to the component.
-   */
-  public static GridConstraints getConstraints(Component component) {
-    GridConstraints constraints
-        = (GridConstraints) component.getConstraints();
-    if (constraints == null) {
-      constraints = new GridConstraints();
-      component.setConstraints(constraints);
-    }
-    return constraints;
+  // XXX
+  public String getFamily() {
+    return "TODO";
   }
 
   public int getColumnSpan() {
@@ -104,6 +97,12 @@
     this.width = width;
   }
 
+  // XXX remove
+  @Deprecated
+  public void setWidth(int width) {
+    this.width = new PixelMeasure(width);
+  }
+
   public Measure getHeight() {
     return height;
   }
@@ -111,4 +110,10 @@
   public void setHeight(Measure height) {
     this.height = height;
   }
+
+  // XXX remove
+  @Deprecated
+  public void setHeight(int height) {
+    this.height = new PixelMeasure(height);
+  }
 }

Propchange: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/AbstractUIGridConstraints.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/AbstractUIGridConstraints.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/AbstractUIGridLayout.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/AbstractUIGridLayout.java?rev=707626&r1=707625&r2=707626&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/AbstractUIGridLayout.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/AbstractUIGridLayout.java Fri Oct 24 06:15:48 2008
@@ -19,11 +19,14 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.myfaces.tobago.OnComponentCreated;
 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_SPAN_X;
 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_SPAN_Y;
-import org.apache.myfaces.tobago.util.LayoutUtil;
-import org.apache.myfaces.tobago.util.ComponentUtil;
+import org.apache.myfaces.tobago.layout.LayoutManager;
 import org.apache.myfaces.tobago.layout.LayoutTokens;
+import org.apache.myfaces.tobago.layout.grid.GridLayoutManager;
+import org.apache.myfaces.tobago.util.ComponentUtil;
+import org.apache.myfaces.tobago.util.LayoutUtil;
 
 import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
@@ -32,7 +35,10 @@
 import java.util.ArrayList;
 import java.util.List;
 
-public abstract class AbstractUIGridLayout extends UILayout {
+//public abstract class AbstractUIGridLayout extends UILayout {
+// LAYOUT Begin
+public abstract class AbstractUIGridLayout extends UILayout implements OnComponentCreated {
+// LAYOUT End
 
   private static final Log LOG = LogFactory.getLog(AbstractUIGridLayout.class);
 
@@ -45,6 +51,18 @@
 
   private List<Row> layoutRows;
 
+// LAYOUT Begin
+  private GridLayoutManager manager;
+
+  public void onComponentCreated(FacesContext context, UIComponent component) {
+    manager = new GridLayoutManager(getColumns(), getRows());
+  }
+
+  public LayoutManager getLayoutManager() {
+    return manager;
+  }
+// LAYOUT End
+
   public LayoutTokens getRowLayout() {
     if (rowLayout == null) {
       rowLayout = LayoutTokens.parse(getRows());

Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/AbstractUIPage.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/AbstractUIPage.java?rev=707626&r1=707625&r2=707626&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/AbstractUIPage.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/AbstractUIPage.java Fri Oct 24 06:15:48 2008
@@ -25,6 +25,10 @@
 import org.apache.myfaces.tobago.compat.FacesUtils;
 import org.apache.myfaces.tobago.compat.InvokeOnComponent;
 import org.apache.myfaces.tobago.layout.Box;
+import org.apache.myfaces.tobago.layout.Component;
+import org.apache.myfaces.tobago.layout.Constraints;
+import org.apache.myfaces.tobago.layout.Container;
+import org.apache.myfaces.tobago.layout.LayoutManager;
 import org.apache.myfaces.tobago.model.PageState;
 import org.apache.myfaces.tobago.model.PageStateImpl;
 import org.apache.myfaces.tobago.util.ComponentUtil;
@@ -44,7 +48,7 @@
 import java.util.List;
 import java.util.StringTokenizer;
 
-public abstract class AbstractUIPage extends AbstractUIForm implements InvokeOnComponent {
+public abstract class AbstractUIPage extends AbstractUIForm implements InvokeOnComponent, Container {
 
   private static final Log LOG = LogFactory.getLog(AbstractUIPage.class);
 
@@ -283,4 +287,26 @@
       throws FacesException {
     return FacesUtils.invokeOnComponent(context, this, clientId, callback);
   }
+
+// LAYOUT Begin
+  public List<Component> getComponents() {
+    List<Component> result = new ArrayList<Component>();
+    for (UIComponent uiComponent : (List<UIComponent>)getChildren()) {
+     if (uiComponent instanceof Component) {
+       result.add((Component) uiComponent);
+     }
+    }
+    return result;
+  }
+
+  public LayoutManager getLayoutManager() {
+    AbstractUIGridLayout uiGridLayout = (AbstractUIGridLayout) getFacet(FacetConstants.LAYOUT);
+    return uiGridLayout != null ? uiGridLayout.getLayoutManager() : null;
+  }
+
+  public Constraints getConstraints() {
+    return (AbstractUIGridConstraints) getFacet(FacetConstants.CONSTRAINTS);
+  }
+// LAYOUT End
+
 }

Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UIInputBase.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UIInputBase.java?rev=707626&r1=707625&r2=707626&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UIInputBase.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UIInputBase.java Fri Oct 24 06:15:48 2008
@@ -21,12 +21,14 @@
 import org.apache.commons.logging.LogFactory;
 import org.apache.myfaces.tobago.ajax.api.AjaxComponent;
 import org.apache.myfaces.tobago.ajax.api.AjaxUtils;
+import org.apache.myfaces.tobago.layout.Component;
+import org.apache.myfaces.tobago.layout.Constraints;
 import org.apache.myfaces.tobago.util.ComponentUtil;
 
 import javax.faces.context.FacesContext;
 import java.io.IOException;
 
-public abstract class UIInputBase extends javax.faces.component.UIInput implements AjaxComponent, SupportsMarkup {
+public abstract class UIInputBase extends javax.faces.component.UIInput implements AjaxComponent, SupportsMarkup, Component {
 
   private static final Log LOG = LogFactory.getLog(UIInputBase.class);
 
@@ -43,4 +45,16 @@
 
   public abstract Integer getTabIndex();
 
+// LAYOUT Begin
+  public Constraints getConstraints() {
+    AbstractUIGridConstraints constraints = (AbstractUIGridConstraints) getFacet(FacetConstants.CONSTRAINTS);
+
+    // fixme
+    if (constraints == null) {
+      constraints = new AbstractUIGridConstraints(){};
+      getFacets().put(FacetConstants.CONSTRAINTS, constraints);
+    }
+    return constraints;
+  }
+// LAYOUT End
 }

Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/Component.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/Component.java?rev=707626&r1=707625&r2=707626&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/Component.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/Component.java Fri Oct 24 06:15:48 2008
@@ -24,6 +24,4 @@
 public interface Component {
 
   Constraints getConstraints();
-
-  void setConstraints(Constraints constraints);
 }

Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/Container.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/Container.java?rev=707626&r1=707625&r2=707626&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/Container.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/Container.java Fri Oct 24 06:15:48 2008
@@ -28,6 +28,4 @@
   List<Component> getComponents();
 
   LayoutManager getLayoutManager();
-
-  void setLayoutManager(LayoutManager layoutManager);
 }

Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/LayoutContext.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/LayoutContext.java?rev=707626&r1=707625&r2=707626&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/LayoutContext.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/LayoutContext.java Fri Oct 24 06:15:48 2008
@@ -19,7 +19,7 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.myfaces.tobago.layout.grid.GridConstraints;
+import org.apache.myfaces.tobago.component.AbstractUIGridConstraints;
 import org.apache.myfaces.tobago.layout.math.EquationManager;
 
 public class LayoutContext {
@@ -46,8 +46,8 @@
 
   public void layout() {
 
-    horizontal.setFixedLength(0, ((GridConstraints)container.getConstraints()).getWidth().getPixel());
-    vertical.setFixedLength(0, ((GridConstraints)container.getConstraints()).getHeight().getPixel());
+    horizontal.setFixedLength(0, ((AbstractUIGridConstraints)container.getConstraints()).getWidth().getPixel());
+    vertical.setFixedLength(0, ((AbstractUIGridConstraints)container.getConstraints()).getHeight().getPixel());
 
     horizontal.descend(0, 1);
     vertical.descend(0, 1);

Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/grid/GridLayoutManager.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/grid/GridLayoutManager.java?rev=707626&r1=707625&r2=707626&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/grid/GridLayoutManager.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/grid/GridLayoutManager.java Fri Oct 24 06:15:48 2008
@@ -19,6 +19,7 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.myfaces.tobago.component.AbstractUIGridConstraints;
 import org.apache.myfaces.tobago.layout.Component;
 import org.apache.myfaces.tobago.layout.Container;
 import org.apache.myfaces.tobago.layout.LayoutContext;
@@ -39,6 +40,7 @@
   private Grid grid;
 
   private LayoutTokens columnTokens;
+
   private LayoutTokens rowTokens;
 
   public GridLayoutManager(String columnsString, String rowsString) {
@@ -48,34 +50,7 @@
 
     grid = new Grid(columnTokens.getSize(), rowTokens.getSize());
   }
-/*
-  public void layout() {
-
-    List<Component> components = container.getComponents();
-
-    distributeCells(components);
-
-    // fixme: 1000 -> container.get...
-    PixelMeasure horizontal = new PixelMeasure(1000);
 
-    distributePixel(horizontal, columnTokens, grid.getColumns(), components);
-// todo   distributeFixed(components);
-// todo   distributeAuto(components);
-    distributeAsterisk(horizontal, columnTokens, grid.getColumns(), components);
-
-    LOG.info("columns = " + Arrays.toString(grid.getColumns()));
-
-    // fixme: 1000 -> container.get...
-    PixelMeasure vertical = new PixelMeasure(1000);
-
-    distributePixel(vertical, rowTokens, grid.getRows(), components);
-// todo   distributeFixed(components);
-// todo   distributeAuto(components);
-    distributeAsterisk(vertical, rowTokens, grid.getRows(), components);
-
-    LOG.info("rows    = " + Arrays.toString(grid.getRows()));
-  }
-*/
   public void collect(LayoutContext layoutContext, Container container) {
 
     List<Component> components = container.getComponents();
@@ -122,8 +97,8 @@
           horizontal.descend(i, cell.getColumnSpan());
           vertial.descend(j, cell.getRowSpan());
 
-          ((GridConstraints) component.getConstraints()).setWidth(new PixelMeasure((int) horizontal.getValue()));
-          ((GridConstraints) component.getConstraints()).setHeight(new PixelMeasure((int) vertial.getValue()));
+          ((AbstractUIGridConstraints) component.getConstraints()).setWidth(new PixelMeasure((int) horizontal.getValue()));
+          ((AbstractUIGridConstraints) component.getConstraints()).setHeight(new PixelMeasure((int) vertial.getValue()));
 
           if (component instanceof Container) {
             Container subContainer = (Container) component;
@@ -167,7 +142,7 @@
     // horizontal
     Integer first = null;
     Integer firstIndex = null;
-    for (int i = 0; i <  columnTokens.getTokens().size(); i++) {
+    for (int i = 0; i < columnTokens.getTokens().size(); i++) {
       LayoutToken token = columnTokens.getTokens().get(i);
       if (token instanceof RelativeLayoutToken) {
         int factor = ((RelativeLayoutToken) token).getFactor();
@@ -182,7 +157,7 @@
     // vertial
     first = null;
     firstIndex = null;
-    for (int i = 0; i <  rowTokens.getTokens().size(); i++) {
+    for (int i = 0; i < rowTokens.getTokens().size(); i++) {
       LayoutToken token = rowTokens.getTokens().get(i);
       if (token instanceof RelativeLayoutToken) {
         int factor = ((RelativeLayoutToken) token).getFactor();
@@ -198,51 +173,12 @@
 
   private void distributeCells(List<Component> components) {
     for (Component component : components) {
-
-      GridConstraints constraints = GridConstraints.getConstraints(component);
+      AbstractUIGridConstraints constraints = (AbstractUIGridConstraints) component.getConstraints();
       grid.add(new RealCell(component), constraints.getColumnSpan(), constraints.getRowSpan());
-
       LOG.debug("\n" + grid);
     }
   }
 
-/*
-  // todo: may use not only pixel but also other measures
-  private void distributePixel(
-      PixelMeasure space, LayoutTokens tokens, PixelMeasure[] measures, List<Component> components) {
-
-    for (int i = 0; i < measures.length; i++) {
-      if (tokens.get(i) instanceof PixelLayoutToken) {
-        PixelLayoutToken token = (PixelLayoutToken) tokens.get(i);
-        measures[i] = new PixelMeasure(token.getPixel());
-        space = (PixelMeasure) space.substractNotNegative(measures[i]);
-      }
-    }
-  }
-
-  private void distributeAsterisk(
-      PixelMeasure space, LayoutTokens tokens, PixelMeasure[] measures, List<Component> components) {
-    int sum = 0;
-    int spreadingSpace = space.getPixel();
-    for (int i = 0; i < measures.length; i++) {
-      if (tokens.get(i) instanceof RelativeLayoutToken) {
-        RelativeLayoutToken token = (RelativeLayoutToken) tokens.get(i);
-        sum += token.getFactor();
-      }
-    }
-    for (int i = 0; i < measures.length; i++) {
-      if (tokens.get(i) instanceof RelativeLayoutToken) {
-        RelativeLayoutToken token = (RelativeLayoutToken) tokens.get(i);
-        int measure = spreadingSpace * token.getFactor() / sum;
-        space = (PixelMeasure) space.substractNotNegative(new PixelMeasure(measure));
-        measures[i] = new PixelMeasure(measure);
-      }
-    }
-    LOG.info("rest: " + space);
-    // todo: distribute the rest (might be some pixels because of rounding errors)
-  }
-   */
-
   protected Grid getGrid() {
     return grid;
   }

Copied: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/GridConstraintsTagDeclaration.java (from r707030, myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/GridLayoutTagDeclaration.java)
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/GridConstraintsTagDeclaration.java?p2=myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/GridConstraintsTagDeclaration.java&p1=myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/GridLayoutTagDeclaration.java&r1=707030&r2=707626&rev=707626&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/GridLayoutTagDeclaration.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/GridConstraintsTagDeclaration.java Fri Oct 24 06:15:48 2008
@@ -20,84 +20,15 @@
 import org.apache.myfaces.tobago.apt.annotation.BodyContent;
 import org.apache.myfaces.tobago.apt.annotation.Tag;
 import org.apache.myfaces.tobago.apt.annotation.UIComponentTag;
-import org.apache.myfaces.tobago.taglib.decl.HasBinding;
-import org.apache.myfaces.tobago.taglib.decl.HasBorder;
-import org.apache.myfaces.tobago.taglib.decl.HasCellspacing;
-import org.apache.myfaces.tobago.taglib.decl.HasColumnLayout;
+import org.apache.myfaces.tobago.taglib.decl.HasHeight;
 import org.apache.myfaces.tobago.taglib.decl.HasId;
-import org.apache.myfaces.tobago.taglib.decl.HasMargin;
-import org.apache.myfaces.tobago.taglib.decl.HasMargins;
-import org.apache.myfaces.tobago.taglib.decl.HasRowLayout;
+import org.apache.myfaces.tobago.taglib.decl.HasWidth;
 
-/*
- * Date: 14.03.2006
- * Time: 16:58:13
- */
-
-/**
- * Renders a GridLayout.
- * <pre>
- * columns/rows ::= LAYOUT
- * LAYOUT       ::= TOKEN [";" TOKEN]+
- * TOKEN        ::= FIXED | PIXEL | PROPORTIONAL
- * FIXED        ::= "fixed"
- * PIXEL        ::= NUMBER "px"
- * PROPORTIONAL ::= [NUMBER] "*"
- * </pre>
- * <p/>
- * <table border="1">
- * <tr>
- * <th>Parent</th>
- * <th>Child</th>
- * <th>Okay?</th>
- * <th>Remarks</th>
- * </tr>
- * <tr>
- * <td>FIXED</td>
- * <td>any combination of FIXED or PIXEL but no PROPORTIONAL</td>
- * <td>okay</td>
- * <td>-</td>
- * </tr>
- * <tr>
- * <td>FIXED</td>
- * <td>any combination with at least one PROPORTIONAL</td>
- * <td>wrong</td>
- * <td>LayoutManager cannot compute the fixed value.</td>
- * </tr>
- * <tr>
- * <td>PIXEL</td>
- * <td>any combination of FIXED or PIXEL but no PROPORTIONAL</td>
- * <td>potentially wrong</td>
- * <td>The values depend on each other, the programmer has to keep consistency manually.</td>
- * </tr>
- * <tr>
- * <td>PIXEL</td>
- * <td>any combination with at least one PROPORTIONAL</td>
- * <td>okay</td>
- * <td>-</td>
- * </tr>
- * <tr>
- * <td>PROPORTIONAL</td>
- * <td>any combination of FIXED or PIXEL but no PROPORTIONAL</td>
- * <td>potentially wrong</td>
- * <td>No automatical matching:<ul><li>too little space: scrollbar</li>
- * <li>too much space: elements will be spreaded.</li></ul></td>
- * </tr>
- * <tr>
- * <td>PROPORTIONAL</td>
- * <td>any combination with at least one PROPORTIONAL</td>
- * <td>okay</td>
- * <td>-</td>
- * </tr>
- * </table>
- */
-@Tag(name = "gridLayout", bodyContent = BodyContent.EMPTY)
+@Tag(name = "gridConstraints", bodyContent = BodyContent.EMPTY)
 @UIComponentTag(
-    uiComponent = "org.apache.myfaces.tobago.component.UIGridLayout",
-    uiComponentBaseClass = "org.apache.myfaces.tobago.component.AbstractUIGridLayout",
-    rendererType = "GridLayout",
-    componentFamily = "org.apache.myfaces.tobago.GridLayout",
+    uiComponent = "org.apache.myfaces.tobago.component.UIGridConstraints",
+    uiComponentBaseClass = "org.apache.myfaces.tobago.component.AbstractUIGridConstraints",
+    componentFamily = "org.apache.myfaces.tobago.GridConstraints",
     allowedChildComponenents = "NONE", isLayout = true)
-public interface GridLayoutTagDeclaration extends HasId, HasBorder, HasCellspacing, HasMargin,
-    HasMargins, HasColumnLayout, HasRowLayout, HasBinding {
-}
+public interface GridConstraintsTagDeclaration extends HasId, HasWidth, HasHeight {
+}
\ No newline at end of file

Propchange: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/GridConstraintsTagDeclaration.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/GridConstraintsTagDeclaration.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/GridConstraintsTagDeclaration.java
------------------------------------------------------------------------------
    svn:mergeinfo = 

Modified: myfaces/tobago/trunk/core/src/test/java/org/apache/myfaces/tobago/layout/MockComponent.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/test/java/org/apache/myfaces/tobago/layout/MockComponent.java?rev=707626&r1=707625&r2=707626&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/test/java/org/apache/myfaces/tobago/layout/MockComponent.java (original)
+++ myfaces/tobago/trunk/core/src/test/java/org/apache/myfaces/tobago/layout/MockComponent.java Fri Oct 24 06:15:48 2008
@@ -1,7 +1,5 @@
 package org.apache.myfaces.tobago.layout;
 
-import org.apache.myfaces.tobago.layout.grid.GridConstraints;
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -26,15 +24,12 @@
 
   private Constraints constraints;
 
-  public MockComponent() {
-    constraints = new GridConstraints();
+  public MockComponent(Constraints constraints) {
+    this.constraints = constraints;
   }
 
   public Constraints getConstraints() {
     return constraints;
   }
 
-  public void setConstraints(Constraints constraints) {
-    this.constraints = constraints;
-  }
 }

Modified: myfaces/tobago/trunk/core/src/test/java/org/apache/myfaces/tobago/layout/MockContainer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/test/java/org/apache/myfaces/tobago/layout/MockContainer.java?rev=707626&r1=707625&r2=707626&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/test/java/org/apache/myfaces/tobago/layout/MockContainer.java (original)
+++ myfaces/tobago/trunk/core/src/test/java/org/apache/myfaces/tobago/layout/MockContainer.java Fri Oct 24 06:15:48 2008
@@ -29,7 +29,8 @@
 
   private List<Component> components;
 
-  public MockContainer() {
+  public MockContainer(Constraints constraints) {
+    super(constraints);
     components = new ArrayList<Component>();
   }
 

Modified: myfaces/tobago/trunk/core/src/test/java/org/apache/myfaces/tobago/layout/grid/GridLayoutManagerUnitTest.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/test/java/org/apache/myfaces/tobago/layout/grid/GridLayoutManagerUnitTest.java?rev=707626&r1=707625&r2=707626&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/test/java/org/apache/myfaces/tobago/layout/grid/GridLayoutManagerUnitTest.java (original)
+++ myfaces/tobago/trunk/core/src/test/java/org/apache/myfaces/tobago/layout/grid/GridLayoutManagerUnitTest.java Fri Oct 24 06:15:48 2008
@@ -20,8 +20,8 @@
 import junit.framework.TestCase;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.myfaces.tobago.component.AbstractUIGridConstraints;
 import org.apache.myfaces.tobago.layout.Component;
-import org.apache.myfaces.tobago.layout.Container;
 import org.apache.myfaces.tobago.layout.LayoutContext;
 import org.apache.myfaces.tobago.layout.MockComponent;
 import org.apache.myfaces.tobago.layout.MockContainer;
@@ -45,17 +45,17 @@
    * </pre>
    */
   public void testSimple() {
-    Container container = new MockContainer();
-    MockComponent c1 = new MockComponent();
+    MockContainer container = newContainer();
+    MockComponent c1 = newComponent();
     container.getComponents().add(c1);
-    MockComponent c2 = new MockComponent();
+    MockComponent c2 = newComponent();
     container.getComponents().add(c2);
 
     GridLayoutManager manager = new GridLayoutManager("*;2*", "*");
     container.setLayoutManager(manager);
 
-    ((GridConstraints) container.getConstraints()).setWidth(new PixelMeasure(300));
-    ((GridConstraints) container.getConstraints()).setHeight(new PixelMeasure(20));
+    ((AbstractUIGridConstraints) container.getConstraints()).setWidth(new PixelMeasure(300));
+    ((AbstractUIGridConstraints) container.getConstraints()).setHeight(new PixelMeasure(20));
     LayoutContext layoutContext = new LayoutContext(container);
     layoutContext.layout();
 
@@ -67,9 +67,9 @@
     LOG.info("result: " + Arrays.toString(result));
     AssertUtils.assertEquals(new double[]{20, 20}, result, 0.000001);
 
-    assertEquals("width of container", 300, ((GridConstraints) container.getConstraints()).getWidth().getPixel());
-    assertEquals("width of component 1", 100, ((GridConstraints) c1.getConstraints()).getWidth().getPixel());
-    assertEquals("width of component 2", 200, ((GridConstraints) c2.getConstraints()).getWidth().getPixel());
+    assertEquals("width of container", 300, ((AbstractUIGridConstraints) container.getConstraints()).getWidth().getPixel());
+    assertEquals("width of component 1", 100, ((AbstractUIGridConstraints) c1.getConstraints()).getWidth().getPixel());
+    assertEquals("width of component 2", 200, ((AbstractUIGridConstraints) c2.getConstraints()).getWidth().getPixel());
   }
 
   /**
@@ -83,18 +83,18 @@
    * </pre>
    */
   public void testSpan() {
-    Container container = new MockContainer();
-    MockComponent c = new MockComponent();
+    MockContainer container = newContainer();
+    MockComponent c = newComponent();
     container.getComponents().add(c);
-    MockComponent span = new MockComponent();
+    MockComponent span = newComponent();
     container.getComponents().add(span);
-    ((GridConstraints) span.getConstraints()).setColumnSpan(2);
+    ((AbstractUIGridConstraints) span.getConstraints()).setColumnSpan(2);
 
     GridLayoutManager manager = new GridLayoutManager("*;*;*", "*");
     container.setLayoutManager(manager);
 
-    ((GridConstraints) container.getConstraints()).setWidth(new PixelMeasure(300));
-    ((GridConstraints) container.getConstraints()).setHeight(new PixelMeasure(20));
+    ((AbstractUIGridConstraints) container.getConstraints()).setWidth(new PixelMeasure(300));
+    ((AbstractUIGridConstraints) container.getConstraints()).setHeight(new PixelMeasure(20));
     LayoutContext layoutContext = new LayoutContext(container);
     layoutContext.layout();
 
@@ -106,9 +106,9 @@
     LOG.info("result: " + Arrays.toString(result));
     AssertUtils.assertEquals(new double[]{20, 20}, result, 0.000001);
 
-    assertEquals("width of container", 300, ((GridConstraints) container.getConstraints()).getWidth().getPixel());
-    assertEquals("width of component", 100, ((GridConstraints) c.getConstraints()).getWidth().getPixel());
-    assertEquals("width of span", 200, ((GridConstraints) span.getConstraints()).getWidth().getPixel());
+    assertEquals("width of container", 300, ((AbstractUIGridConstraints) container.getConstraints()).getWidth().getPixel());
+    assertEquals("width of component", 100, ((AbstractUIGridConstraints) c.getConstraints()).getWidth().getPixel());
+    assertEquals("width of span", 200, ((AbstractUIGridConstraints) span.getConstraints()).getWidth().getPixel());
   }
 
   /**
@@ -129,17 +129,17 @@
    * </pre>
    */
   public void testSpanAndSubLayout() {
-    Container container = new MockContainer();
-    Component span = new MockComponent();
-    GridConstraints bConstraint = GridConstraints.getConstraints(span);
+    MockContainer container = newContainer();
+    Component span = newComponent();
+    AbstractUIGridConstraints bConstraint = (AbstractUIGridConstraints) span.getConstraints();
     bConstraint.setColumnSpan(2);
 
-    container.getComponents().add(new MockComponent());
+    container.getComponents().add(newComponent());
     container.getComponents().add(span);
-    container.getComponents().add(new MockComponent());
-    container.getComponents().add(new MockComponent());
+    container.getComponents().add(newComponent());
+    container.getComponents().add(newComponent());
 
-    Container subContainer = new MockContainer();
+    MockContainer subContainer = newContainer();
 
     container.getComponents().add(subContainer);
     GridLayoutManager manager = new GridLayoutManager("*;2*;500px", "*;600px");
@@ -147,13 +147,13 @@
 
     GridLayoutManager subManager = new GridLayoutManager("7*;3*", "*;*");
     subContainer.setLayoutManager(subManager);
-    subContainer.getComponents().add(new MockComponent());
-    subContainer.getComponents().add(new MockComponent());
-    subContainer.getComponents().add(new MockComponent());
-    subContainer.getComponents().add(new MockComponent());
+    subContainer.getComponents().add(newComponent());
+    subContainer.getComponents().add(newComponent());
+    subContainer.getComponents().add(newComponent());
+    subContainer.getComponents().add(newComponent());
 
-    ((GridConstraints) container.getConstraints()).setWidth(new PixelMeasure(800));
-    ((GridConstraints) container.getConstraints()).setHeight(new PixelMeasure(800));
+    ((AbstractUIGridConstraints) container.getConstraints()).setWidth(new PixelMeasure(800));
+    ((AbstractUIGridConstraints) container.getConstraints()).setHeight(new PixelMeasure(800));
     LayoutContext layoutContext = new LayoutContext(container);
     layoutContext.layout();
 
@@ -166,8 +166,8 @@
     LOG.info("result: " + Arrays.toString(result));
     AssertUtils.assertEquals(new double[]{800, 200, 600, 300, 300}, result, 0.000001);
 
-    assertEquals("width of container", 800, ((GridConstraints) container.getConstraints()).getWidth().getPixel());
-    assertEquals("width of span", 700, ((GridConstraints) span.getConstraints()).getWidth().getPixel());
+    assertEquals("width of container", 800, ((AbstractUIGridConstraints) container.getConstraints()).getWidth().getPixel());
+    assertEquals("width of span", 700, ((AbstractUIGridConstraints) span.getConstraints()).getWidth().getPixel());
   }
 
   /**
@@ -179,27 +179,27 @@
    * </pre>
    */
   public void testSpanOverlapsSpan() {
-    Container container = new MockContainer();
+    MockContainer container = newContainer();
 
-    Container span1 = new MockContainer();
-    GridConstraints constraint1 = GridConstraints.getConstraints(span1);
+    MockContainer span1 = newContainer();
+    AbstractUIGridConstraints constraint1 = (AbstractUIGridConstraints) span1.getConstraints();
     constraint1.setColumnSpan(2);
 
-    Container span2 = new MockContainer();
-    GridConstraints constraint2 = GridConstraints.getConstraints(span2);
+    MockContainer span2 = newContainer();
+    AbstractUIGridConstraints constraint2 = (AbstractUIGridConstraints) span2.getConstraints();
     constraint2.setColumnSpan(2);
 
-    container.getComponents().add(new MockComponent());
+    container.getComponents().add(newComponent());
     container.getComponents().add(span1);
     container.getComponents().add(span2);
-    container.getComponents().add(new MockComponent());
+    container.getComponents().add(newComponent());
 
     container.setLayoutManager(new GridLayoutManager("*;*;*", "*;*"));
     span1.setLayoutManager(new GridLayoutManager("*;*;*", "*"));
     span2.setLayoutManager(new GridLayoutManager("*;*;*", "*"));
 
-    ((GridConstraints) container.getConstraints()).setWidth(new PixelMeasure(900));
-    ((GridConstraints) container.getConstraints()).setHeight(new PixelMeasure(200));
+    ((AbstractUIGridConstraints) container.getConstraints()).setWidth(new PixelMeasure(900));
+    ((AbstractUIGridConstraints) container.getConstraints()).setHeight(new PixelMeasure(200));
     LayoutContext layoutContext = new LayoutContext(container);
     layoutContext.layout();
 
@@ -214,8 +214,16 @@
     LOG.info("result: " + Arrays.toString(result));
     AssertUtils.assertEquals(new double[]{200, 100, 100, 100, 100}, result, 0.000001);
 
-    assertEquals("width of container", 900, ((GridConstraints) container.getConstraints()).getWidth().getPixel());
-    assertEquals("width of span 1", 600, ((GridConstraints) span1.getConstraints()).getWidth().getPixel());
-    assertEquals("width of span 2", 600, ((GridConstraints) span2.getConstraints()).getWidth().getPixel());
+    assertEquals("width of container", 900, ((AbstractUIGridConstraints) container.getConstraints()).getWidth().getPixel());
+    assertEquals("width of span 1", 600, ((AbstractUIGridConstraints) span1.getConstraints()).getWidth().getPixel());
+    assertEquals("width of span 2", 600, ((AbstractUIGridConstraints) span2.getConstraints()).getWidth().getPixel());
+  }
+
+  private MockContainer newContainer() {
+    return new MockContainer(new AbstractUIGridConstraints(){});
+  }
+
+  private MockComponent newComponent() {
+    return new MockComponent(new AbstractUIGridConstraints(){});
   }
 }

Copied: myfaces/tobago/trunk/example/demo/src/main/webapp/reference/layout-test.jsp (from r707030, myfaces/tobago/trunk/example/demo/src/main/webapp/reference/input.jsp)
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/demo/src/main/webapp/reference/layout-test.jsp?p2=myfaces/tobago/trunk/example/demo/src/main/webapp/reference/layout-test.jsp&p1=myfaces/tobago/trunk/example/demo/src/main/webapp/reference/input.jsp&r1=707030&r2=707626&rev=707626&view=diff
==============================================================================
--- myfaces/tobago/trunk/example/demo/src/main/webapp/reference/input.jsp (original)
+++ myfaces/tobago/trunk/example/demo/src/main/webapp/reference/layout-test.jsp Fri Oct 24 06:15:48 2008
@@ -19,59 +19,19 @@
 <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
 <%@ taglib tagdir="/WEB-INF/tags/layout" prefix="layout" %>
 
-<layout:overview>
-  <jsp:body>
-    <tc:box label="Input">
-      <f:facet name="layout">
-        <tc:gridLayout rows="fixed;fixed;fixed;fixed;fixed;fixed;fixed;2*;3*;2*;2*;2*;2*;2*"/>
-      </f:facet>
+<f:view>
+  <tc:page applicationIcon="icon/favicon.ico" label="title" id="page" width="1000px" height="750px">
+    <f:facet name="layout">
+      <tc:gridLayout rows="*" columns="*;2*"/>
+    </f:facet>
+    <f:facet name="constraints">
+      <tc:gridConstraints width="600px" height="50px"/>
+    </f:facet>
+    <tc:textarea
+        value="Some text without label, some text without label, some text without label, some text without label, some text without label, some text without label, some text without label, some text without label, some text without label, some text without label, ..."/>
 
-      <tc:in value="Some Text without Label"/>
+    <tc:textarea readonly="true"
+                 value="Some text, some text, some text, some text, some text, some text, some text, some text, some text, some text, ..."/>
 
-      <%-- code-sniplet-start id="in" --%>
-      <tx:in label="Input" value="Some Text"/>
-      <%-- code-sniplet-end id="in" --%>
-
-      <tx:in label="Read Only" readonly="true" value="Some Text"/>
-
-      <tx:in label="Disabled" disabled="true" value="Some Text"/>
-
-      <tc:panel>
-        <f:facet name="layout">
-          <tc:gridLayout columns="100px;*"/>
-        </f:facet>
-        <tc:label value="Short Label"/>
-        <tc:in value="Some Text"/>
-      </tc:panel>
-
-      <tx:in label="Input (focus)" focus="true" value="Some Text"/>
-
-      <tx:in label="Password" password="true" value="Asterics"/>
-
-      <tc:textarea value="Some text without label, some text without label, some text without label, some text without label, some text without label, some text without label, some text without label, some text without label, some text without label, some text without label, ..."/>
-
-      <%-- code-sniplet-start id="textarea" --%>
-      <tx:textarea label="Text Area"
-                   value="Some text, some text, some text, some text, some text, some text, some text, some text, some text, some text, ..."/>
-      <%-- code-sniplet-end id="textarea" --%>
-
-      <tx:textarea label="Read Only"
-                   readonly="true"
-                   value="Some text, some text, some text, some text, some text, some text, some text, some text, some text, some text, ..."/>
-
-      <tx:textarea label="Disabled"
-                   disabled="true"
-                   value="Some text, some text, some text, some text, some text, some text, some text, some text, some text, some text, ..."/>
-
-      <tx:textarea label="Area (focus)" focus="true"
-                   value="Some Text"/>
-
-      <tc:panel>
-        <tc:out value="An input field is "/>
-        <tc:in value="here" inline="true"/>
-        <tc:out value=" inside of a floating text."/>
-      </tc:panel>
-
-    </tc:box>
-  </jsp:body>
-</layout:overview>
\ No newline at end of file
+  </tc:page>
+</f:view>

Propchange: myfaces/tobago/trunk/example/demo/src/main/webapp/reference/layout-test.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/tobago/trunk/example/demo/src/main/webapp/reference/layout-test.jsp
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: myfaces/tobago/trunk/example/demo/src/main/webapp/reference/layout-test.jsp
------------------------------------------------------------------------------
    svn:mergeinfo = 

Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PageRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PageRenderer.java?rev=707626&r1=707625&r2=707626&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PageRenderer.java (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/PageRenderer.java Fri Oct 24 06:15:48 2008
@@ -41,6 +41,7 @@
 import org.apache.myfaces.tobago.context.ClientProperties;
 import org.apache.myfaces.tobago.context.ResourceManagerUtil;
 import org.apache.myfaces.tobago.context.TobagoFacesContext;
+import org.apache.myfaces.tobago.layout.LayoutContext;
 import org.apache.myfaces.tobago.renderkit.PageRendererBase;
 import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
 import org.apache.myfaces.tobago.renderkit.html.HtmlConstants;
@@ -115,21 +116,18 @@
     } else {
       facesContext = new TobagoFacesContext(facesContextOrg);
     }
-/*
-// LAYOUT
-    LayoutContext layoutContext = new LayoutContext();
 
-    EquationManager horizontal = layoutContext.getHorizontal();
-    horizontal.setFixedLength(0, 1000);
-    horizontal.descend(0, 1);
-
-    EquationManager vertial = layoutContext.getVertical();
-    vertial.setFixedLength(0, 1000);
-    vertial.descend(0, 1);
+// LAYOUT Begin
+
+    try {
+      LayoutContext layoutContext = new LayoutContext(page);
+      layoutContext.layout();
+    } catch (Exception e) {
+      LOG.error("", e);
+    }
 
-    page.getLayoutManager().layout(layoutContext, page);
+// LAYOUT End
 
-*/
     RenderUtil.prepareRendererAll(facesContext, page);
 
     TobagoResponseWriter writer = HtmlRendererUtil.getTobagoResponseWriter(facesContext);

Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TextAreaRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TextAreaRenderer.java?rev=707626&r1=707625&r2=707626&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TextAreaRenderer.java (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TextAreaRenderer.java Fri Oct 24 06:15:48 2008
@@ -27,14 +27,18 @@
 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_DISABLED;
 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_READONLY;
 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_ROWS;
-import org.apache.myfaces.tobago.util.ComponentUtil;
+import static org.apache.myfaces.tobago.TobagoConstants.ATTR_STYLE;
+import org.apache.myfaces.tobago.component.AbstractUIGridConstraints;
 import org.apache.myfaces.tobago.component.UITextarea;
+import org.apache.myfaces.tobago.layout.Measure;
 import org.apache.myfaces.tobago.renderkit.HtmlUtils;
 import org.apache.myfaces.tobago.renderkit.InputRendererBase;
-import org.apache.myfaces.tobago.renderkit.util.RenderUtil;
 import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
 import org.apache.myfaces.tobago.renderkit.html.HtmlConstants;
+import org.apache.myfaces.tobago.renderkit.html.HtmlStyleMap;
 import org.apache.myfaces.tobago.renderkit.html.util.HtmlRendererUtil;
+import org.apache.myfaces.tobago.renderkit.util.RenderUtil;
+import org.apache.myfaces.tobago.util.ComponentUtil;
 import org.apache.myfaces.tobago.webapp.TobagoResponseWriter;
 
 import javax.faces.component.UIComponent;
@@ -75,6 +79,19 @@
       writer.writeAttribute(HtmlAttributes.TABINDEX, tabIndex);
     }
     HtmlRendererUtil.renderDojoDndItem(component, writer, true);
+
+// LAYOUT Begin
+    HtmlStyleMap style = (HtmlStyleMap) input.getAttributes().get(ATTR_STYLE);
+    Measure width = ((AbstractUIGridConstraints) input.getConstraints()).getWidth();
+    if (width != null) {
+      style.put("width", width.toString());
+    }
+    Measure height = ((AbstractUIGridConstraints) input.getConstraints()).getHeight();
+    if (height !=null) {
+      style.put("height", height.toString());
+    }
+// LAYOUT End
+
     writer.writeStyleAttribute();
     writer.writeClassAttribute();
     if (onchange != null) {