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/09/03 18:44:29 UTC

svn commit: r811021 - in /myfaces/tobago/trunk: core/src/main/java/org/apache/myfaces/tobago/component/ core/src/main/java/org/apache/myfaces/tobago/layout/ example/test/ example/test/src/main/webapp/tc/gridLayout/ example/test/src/main/webapp/tc/tabGr...

Author: lofwyr
Date: Thu Sep  3 16:44:28 2009
New Revision: 811021

URL: http://svn.apache.org/viewvc?rev=811021&view=rev
Log:
TOBAGO-606: Layout-Manager
 - implementing a layout manager for tc:tabGroup
 - fix exception when trying rediplay a page

Added:
    myfaces/tobago/trunk/example/test/src/main/webapp/tc/gridLayout/tabGroup-auto.xhtml
    myfaces/tobago/trunk/example/test/src/main/webapp/tc/gridLayout/tabGroup-relative.xhtml
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/AbstractUITabGroup.java
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/AbstractUITabGroupLayout.java
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/Display.java
    myfaces/tobago/trunk/example/test/pom.xml
    myfaces/tobago/trunk/example/test/src/main/webapp/tc/tabGroup/simple.xhtml
    myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TabGroupLayoutRenderer.java
    myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TabGroupRenderer.java
    myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/property/tobago-theme-config.properties
    myfaces/tobago/trunk/theme/speyside/src/main/java/org/apache/myfaces/tobago/renderkit/html/speyside/standard/tag/TabGroupRenderer.java
    myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/property/tobago-theme-config.properties
    myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/property/tobago-theme-config.properties

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=811021&r1=811020&r2=811021&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 Thu Sep  3 16:44:28 2009
@@ -53,7 +53,6 @@
   private Grid grid;
 
   public void onComponentCreated(FacesContext context, UIComponent component) {
-    grid = new Grid(LayoutTokens.parse(getColumns()), LayoutTokens.parse(getRows()));
   }
 
   // /////////////////////////////////////////////////////////////////////////////////////////
@@ -63,6 +62,8 @@
   // /////////////////////////////////////////////////////////////////////////////////////////
 
   public void init() {
+    grid = new Grid(LayoutTokens.parse(getColumns()), LayoutTokens.parse(getRows()));
+
     List<LayoutComponent> components = getLayoutContainer().getComponents();
     for (LayoutComponent component : components) {
       grid.add(new OriginCell(component), component.getColumnSpan(), component.getRowSpan());

Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/AbstractUITabGroup.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/AbstractUITabGroup.java?rev=811021&r1=811020&r2=811021&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/AbstractUITabGroup.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/AbstractUITabGroup.java Thu Sep  3 16:44:28 2009
@@ -68,7 +68,7 @@
   @Override
   public void encodeChildren(FacesContext facesContext) throws IOException {
 
-    ((UILayout) getLayoutManager()).encodeChildren(facesContext);
+//    ((UILayout) getLayoutManager()).encodeChildren(facesContext);
   }
 
   @Override

Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/AbstractUITabGroupLayout.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/AbstractUITabGroupLayout.java?rev=811021&r1=811020&r2=811021&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/AbstractUITabGroupLayout.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/AbstractUITabGroupLayout.java Thu Sep  3 16:44:28 2009
@@ -17,44 +17,149 @@
  * limitations under the License.
  */
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.myfaces.tobago.OnComponentCreated;
+import org.apache.myfaces.tobago.layout.Display;
+import org.apache.myfaces.tobago.layout.Interval;
+import org.apache.myfaces.tobago.layout.IntervalList;
+import org.apache.myfaces.tobago.layout.LayoutComponent;
 import org.apache.myfaces.tobago.layout.LayoutContainer;
 import org.apache.myfaces.tobago.layout.LayoutContext;
 import org.apache.myfaces.tobago.layout.LayoutManager;
+import org.apache.myfaces.tobago.layout.LayoutUtils;
+import org.apache.myfaces.tobago.layout.Measure;
 
 import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
 
-// XXX is this a good way?
-public abstract class AbstractUITabGroupLayout extends UILayout implements OnComponentCreated, LayoutManager {
+public abstract class AbstractUITabGroupLayout extends UILayout implements LayoutManager, OnComponentCreated {
 
-  public void onComponentCreated(FacesContext context, UIComponent component) {
-  }
+  private static final Log LOG = LogFactory.getLog(AbstractUIGridLayout.class);
 
-  public void collect(LayoutContext layoutContext, LayoutContainer container, int horizontalIndex, int verticalIndex) {
-  }
+  private boolean horizontalAuto;
+  private boolean verticalAuto;
 
-  public void distribute(LayoutContext layoutContext, LayoutContainer container) {
+  public void onComponentCreated(FacesContext context, UIComponent component) {
   }
 
   public void init() {
+    for (LayoutComponent component : getLayoutContainer().getComponents()) {
+      if (component instanceof LayoutContainer) {
+        ((LayoutContainer) component).getLayoutManager().init();
+      }
+    }
   }
 
   public void fixRelativeInsideAuto(boolean orientation, boolean auto) {
+
+    if (orientation) {
+      horizontalAuto = auto;
+    } else {
+      verticalAuto = auto;
+    }
+
+    for (LayoutComponent component : getLayoutContainer().getComponents()) {
+      if (component instanceof LayoutContainer) {
+        ((LayoutContainer) component).getLayoutManager().fixRelativeInsideAuto(orientation, auto);
+      }
+    }
   }
 
   public void preProcessing(boolean orientation) {
+
+    // process auto tokens
+    int i = 0;
+    IntervalList intervals = new IntervalList();
+    for (LayoutComponent component : getLayoutContainer().getComponents()) {
+
+      if (component instanceof LayoutContainer) {
+        ((LayoutContainer) component).getLayoutManager().preProcessing(orientation);
+      }
+
+      if (orientation && horizontalAuto || !orientation && verticalAuto) {
+        intervals.add(new Interval(component, orientation));
+      }
+    }
+
+    if (intervals.size() >= 1) {
+      Measure size = intervals.computeAuto();
+      size = size.add(LayoutUtils.getBeginOffset(orientation, getLayoutContainer()));
+      size = size.add(LayoutUtils.getEndOffset(orientation, getLayoutContainer()));
+      LayoutUtils.setSize(orientation, getLayoutContainer(), size);
+    }
   }
 
   public void mainProcessing(boolean orientation) {
+
+    // find *
+    {
+      if (orientation && !horizontalAuto || !orientation && !verticalAuto) {
+        // find rest
+        LayoutContainer container = getLayoutContainer();
+        Measure available = LayoutUtils.getSize(orientation, container);
+        if (available != null) {
+          available = available.substractNotNegative(LayoutUtils.getBeginOffset(orientation, container));
+          available = available.substractNotNegative(LayoutUtils.getEndOffset(orientation, container));
+
+          for (LayoutComponent component : getLayoutContainer().getComponents()) {
+
+            component.setDisplay(Display.BLOCK); // TODO: use CSS via classes and style.css
+            LayoutUtils.setSize(orientation, component, available);
+
+
+            // call sub layout manager
+            if (component instanceof LayoutContainer) {
+              ((LayoutContainer) component).getLayoutManager().mainProcessing(orientation);
+            }
+          }
+        } else {
+          LOG.warn("No width/height set but needed for *!");// todo: more information
+        }
+      }
+    }
   }
 
   public void postProcessing(boolean orientation) {
+
+    // set positions to all sub-layout-managers
+
+    for (LayoutComponent component : getLayoutContainer().getComponents()) {
+
+      component.setDisplay(Display.BLOCK); // TODO: use CSS via classes and style.css
+
+      // compute the position of the cell
+      Measure position = LayoutUtils.getBeginOffset(orientation, getLayoutContainer());
+      if (orientation) {
+        component.setLeft(position);
+      } else {
+        component.setTop(position);
+      }
+
+      // call sub layout manager
+      if (component instanceof LayoutContainer) {
+        ((LayoutContainer) component).getLayoutManager().postProcessing(orientation);
+      }
+
+      // todo: optimize: the AutoLayoutTokens with columnSpan=1 are already called
+    }
+  }
+
+  public void collect(LayoutContext layoutContext, LayoutContainer container, int horizontalIndex, int verticalIndex) {
+    //To change body of implemented methods use File | Settings | File Templates.
+  }
+
+  public void distribute(LayoutContext layoutContext, LayoutContainer container) {
+    //To change body of implemented methods use File | Settings | File Templates.
+  }
+
+  private LayoutContainer getLayoutContainer() {
+    // todo: check with instanceof and do something in the error case
+    return ((LayoutContainer) getParent());
   }
 
   @Override
   public boolean getRendersChildren() {
     return false;
   }
-
 }

Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/Display.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/Display.java?rev=811021&r1=811020&r2=811021&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/Display.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/layout/Display.java Thu Sep  3 16:44:28 2009
@@ -20,7 +20,8 @@
 public enum Display {
 
   BLOCK("block"),
-  INLINE("inline");
+  INLINE("inline"),
+  NONE("none");
 
   private String value;
 

Modified: myfaces/tobago/trunk/example/test/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/test/pom.xml?rev=811021&r1=811020&r2=811021&view=diff
==============================================================================
--- myfaces/tobago/trunk/example/test/pom.xml (original)
+++ myfaces/tobago/trunk/example/test/pom.xml Thu Sep  3 16:44:28 2009
@@ -477,6 +477,35 @@
       </repositories>
     </profile>
     <profile>
+      <id>sunjsf20</id>
+      <activation>
+        <property>
+          <name>jsf</name>
+          <value>ri12</value>
+        </property>
+      </activation>
+      <dependencies>
+        <dependency>
+          <groupId>javax.faces</groupId>
+          <artifactId>jsf-api</artifactId>
+          <version>2.0</version>
+        </dependency>
+        <dependency>
+          <groupId>javax.faces</groupId>
+          <artifactId>jsf-impl</artifactId>
+          <version>2.0</version>
+        </dependency>
+      </dependencies>
+      <repositories>
+        <repository>
+          <id>java.net</id>
+          <name>java.net Maven 1 Repository</name>
+          <url>https://maven-repository.dev.java.net/nonav/repository</url>
+          <layout>legacy</layout>
+        </repository>
+      </repositories>
+    </profile>
+    <profile>
       <!--
        mvn package cargo:start -Ptomcat5x
       -->

Added: myfaces/tobago/trunk/example/test/src/main/webapp/tc/gridLayout/tabGroup-auto.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/test/src/main/webapp/tc/gridLayout/tabGroup-auto.xhtml?rev=811021&view=auto
==============================================================================
--- myfaces/tobago/trunk/example/test/src/main/webapp/tc/gridLayout/tabGroup-auto.xhtml (added)
+++ myfaces/tobago/trunk/example/test/src/main/webapp/tc/gridLayout/tabGroup-auto.xhtml Thu Sep  3 16:44:28 2009
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<f:view
+    xmlns:jsp="http://java.sun.com/JSP/Page"
+    xmlns:tc="http://myfaces.apache.org/tobago/component"
+    xmlns:tx="http://myfaces.apache.org/tobago/extension"
+    xmlns:ui="http://java.sun.com/jsf/facelets"
+    xmlns:h="http://java.sun.com/jsf/html"
+    xmlns:f="http://java.sun.com/jsf/core">
+  <tc:page id="page">
+    <f:facet name="layout">
+      <tc:gridLayout rows="auto" columns="auto"/>
+    </f:facet>
+    <tc:gridLayoutConstraint width="600px" height="300px"/>
+
+    <tc:tabGroup id="tabGroup">
+      <tc:tab label="Rows" id="rows">
+        <f:facet name="layout">
+          <tc:gridLayout rows="*;*"/>
+        </f:facet>
+        <tc:textarea id="a-1">
+          <tc:gridLayoutConstraint width="100px" height="50px"/>
+        </tc:textarea>
+        <tc:textarea id="a-2">
+          <tc:gridLayoutConstraint width="100px" height="50px"/>
+        </tc:textarea>
+      </tc:tab>
+      <tc:tab label="Columns" id="columns">
+        <f:facet name="layout">
+          <tc:gridLayout columns="*;*"/>
+        </f:facet>
+        <tc:textarea id="a-3">
+          <tc:gridLayoutConstraint width="100px" height="50px"/>
+        </tc:textarea>
+        <tc:textarea id="a-4">
+          <tc:gridLayoutConstraint width="100px" height="50px"/>
+        </tc:textarea>
+
+      </tc:tab>
+    </tc:tabGroup>
+
+    <tc:script file="script/test-utils.js"/>
+
+    <tc:script onload="checkLayout('page:rows:a-1', 5, 24, 100, 50);"/>
+    <tc:script onload="checkLayout('page:rows:a-2', 5, 79, 100, 50);"/>
+
+    <!--click the tab to display the elements, they can only be measured if they are not hidden.-->
+    <tc:script onload="document.getElementById('page:tabGroup__1__1').onclick();"/>
+
+    <tc:script onload="checkLayout('page:columns:a-3', 5, 24, 100, 50);"/>
+    <tc:script onload="checkLayout('page:columns:a-4', 110, 24, 100, 50);"/>
+
+  </tc:page>
+</f:view>

Added: myfaces/tobago/trunk/example/test/src/main/webapp/tc/gridLayout/tabGroup-relative.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/test/src/main/webapp/tc/gridLayout/tabGroup-relative.xhtml?rev=811021&view=auto
==============================================================================
--- myfaces/tobago/trunk/example/test/src/main/webapp/tc/gridLayout/tabGroup-relative.xhtml (added)
+++ myfaces/tobago/trunk/example/test/src/main/webapp/tc/gridLayout/tabGroup-relative.xhtml Thu Sep  3 16:44:28 2009
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<f:view
+    xmlns:jsp="http://java.sun.com/JSP/Page"
+    xmlns:tc="http://myfaces.apache.org/tobago/component"
+    xmlns:tx="http://myfaces.apache.org/tobago/extension"
+    xmlns:ui="http://java.sun.com/jsf/facelets"
+    xmlns:h="http://java.sun.com/jsf/html"
+    xmlns:f="http://java.sun.com/jsf/core">
+  <tc:page id="page">
+    <f:facet name="layout">
+      <tc:gridLayout/>
+    </f:facet>
+    <tc:gridLayoutConstraint width="600px" height="300px"/>
+
+    <tc:tabGroup id="tabGroup">
+      <tc:tab label="Rows" id="rows">
+        <f:facet name="layout">
+          <tc:gridLayout rows="*;*"/>
+        </f:facet>
+        <tc:textarea id="a-1" />
+        <tc:textarea id="a-2" />
+      </tc:tab>
+      <tc:tab label="Columns" id="columns">
+        <f:facet name="layout">
+          <tc:gridLayout columns="*;*" />
+        </f:facet>
+        <tc:textarea id="a-3" />
+        <tc:textarea id="a-4" />
+      </tc:tab>
+    </tc:tabGroup>
+
+    <tc:script file="script/test-utils.js"/>
+
+    <tc:script onload="checkLayout('page:rows:a-1', 5, 24, 587, 132);"/>
+    <tc:script onload="checkLayout('page:rows:a-2', 5, 161, 587, 132);"/>
+
+    <!--click the tab to display the elements, they can only be measured if they are not hidden.-->
+    <tc:script onload="document.getElementById('page:tabGroup__1__1').onclick();"/>
+
+    <tc:script onload="checkLayout('page:columns:a-3', 5, 24, 291, 269);"/>
+    <tc:script onload="checkLayout('page:columns:a-4', 301, 24, 291, 269);"/>
+
+  </tc:page>
+</f:view>

Modified: myfaces/tobago/trunk/example/test/src/main/webapp/tc/tabGroup/simple.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/test/src/main/webapp/tc/tabGroup/simple.xhtml?rev=811021&r1=811020&r2=811021&view=diff
==============================================================================
--- myfaces/tobago/trunk/example/test/src/main/webapp/tc/tabGroup/simple.xhtml (original)
+++ myfaces/tobago/trunk/example/test/src/main/webapp/tc/tabGroup/simple.xhtml Thu Sep  3 16:44:28 2009
@@ -15,8 +15,15 @@
 
     <tc:tabGroup>
       <tc:tab label="Tab 0">
+        <tc:textarea />
       </tc:tab>
       <tc:tab label="Tab 1">
+        <f:facet name="layout">
+          <tc:gridLayout columns="*;*" rows="*;*"/>
+        </f:facet>
+        <tc:textarea />
+        <tc:textarea />
+        <tc:textarea />
       </tc:tab>
     </tc:tabGroup>
   </tc:page>

Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TabGroupLayoutRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TabGroupLayoutRenderer.java?rev=811021&r1=811020&r2=811021&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TabGroupLayoutRenderer.java (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TabGroupLayoutRenderer.java Thu Sep  3 16:44:28 2009
@@ -34,93 +34,6 @@
   public void encodeChildren(FacesContext facesContext, UIComponent component) throws IOException {
     UIComponent container = component.getParent();
     LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
-    LOG.info("TAB GROUP LAYOUT RENDERER");
     RenderUtil.encodeChildrenWithoutLayout(facesContext, container);
   }
 

Modified: myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TabGroupRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TabGroupRenderer.java?rev=811021&r1=811020&r2=811021&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TabGroupRenderer.java (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/java/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/tag/TabGroupRenderer.java Thu Sep  3 16:44:28 2009
@@ -41,6 +41,7 @@
 import org.apache.myfaces.tobago.context.ResourceManagerUtil;
 import org.apache.myfaces.tobago.context.TobagoFacesContext;
 import org.apache.myfaces.tobago.event.TabChangeEvent;
+import org.apache.myfaces.tobago.layout.Display;
 import org.apache.myfaces.tobago.renderkit.LabelWithAccessKey;
 import org.apache.myfaces.tobago.renderkit.LayoutableRendererBase;
 import org.apache.myfaces.tobago.renderkit.html.HtmlAttributes;
@@ -97,22 +98,17 @@
     if (facesContext instanceof TobagoFacesContext) {
       ((TobagoFacesContext) facesContext).getScriptFiles().addAll(Arrays.asList(SCRIPTS));
     }
-    HtmlRendererUtil.createHeaderAndBodyStyles(facesContext, component);
   }
 
   public void encodeEnd(FacesContext facesContext, UIComponent uiComponent) throws IOException {
 
-    UITabGroup component = (UITabGroup) uiComponent;
+    UITabGroup tabGroup = (UITabGroup) uiComponent;
 
-    HtmlRendererUtil.createHeaderAndBodyStyles(facesContext, component);
+    int activeIndex = ensureRenderedActiveIndex(facesContext, tabGroup);
 
-//    layoutTabs(facesContext, component);
-
-    int activeIndex = ensureRenderedActiveIndex(facesContext, component);
-
-    final String clientId = component.getClientId(facesContext);
+    final String clientId = tabGroup.getClientId(facesContext);
     final String hiddenId = clientId + TabGroupRenderer.ACTIVE_INDEX_POSTFIX;
-    final String switchType = component.getSwitchType();
+    final String switchType = tabGroup.getSwitchType();
 
     if (TobagoConfig.getInstance(facesContext).isAjaxEnabled()) {
       HtmlRendererUtil.writeScriptLoader(facesContext, SCRIPTS, new String[0]);
@@ -128,24 +124,24 @@
 
     String image1x1 = ResourceManagerUtil.getImageWithPath(facesContext, "image/1x1.gif");
 
-    TabList tabList = getTabList(facesContext, component);
+    TabList tabList = getTabList(facesContext, tabGroup);
 
-    // if a outer uiPage is presend, the virtual tab will go over all
+    // if a outer uiPage is present, the virtual tab will go over all
     // tabs and render it as they are selected, and it will
     // selected with stylesheet.
     int virtualTab = 0;
     int currentWidth = 0;
 
-    int navigationBarWidth = ThemeConfig.getValue(facesContext, component, "navigationBarWidth");
-    for (UIComponent tab : (List<UIComponent>) component.getChildren()) {
+    int navigationBarWidth = ThemeConfig.getValue(facesContext, tabGroup, "navigationBarWidth");
+    for (UIComponent tab : (List<UIComponent>) tabGroup.getChildren()) {
       if (tab instanceof UIPanelBase) {
         if (tab.isRendered()) {
           currentWidth += tabList.getWidthList().get(virtualTab);
           if (SWITCH_TYPE_CLIENT.equals(switchType) || virtualTab == activeIndex) {
             if (virtualTab != activeIndex) {
-              HtmlRendererUtil.replaceStyleAttribute(component, "display", "none");
+              tabGroup.setDisplay(Display.NONE);
             } else {
-              HtmlRendererUtil.removeStyleAttribute(component, "display");
+              tabGroup.setDisplay(null);
             }
 
             writer.startElement(HtmlConstants.DIV, null);
@@ -154,12 +150,11 @@
 
             writer.startElement(HtmlConstants.DIV, null);
             writer.writeIdAttribute(clientId);
-            HtmlRendererUtil.renderDojoDndItem(component, writer, false);
+            HtmlRendererUtil.renderDojoDndItem(tabGroup, writer, false);
             //TODO writer.writeClassAttribute("dojoDndItem");
-            StyleClasses classes = (StyleClasses) component.getAttributes().get(Attributes.STYLE_CLASS);
+            StyleClasses classes = (StyleClasses) tabGroup.getAttributes().get(Attributes.STYLE_CLASS);
             writer.writeClassAttribute(classes);
-            renderTabGroupView(facesContext, writer, component, virtualTab,
-                (HtmlStyleMap) component.getAttributes().get(Attributes.STYLE),
+            renderTabGroupView(facesContext, writer, tabGroup, virtualTab,
                 switchType, image1x1, navigationBarWidth, currentWidth, tabList);
             writer.endElement(HtmlConstants.DIV);
 
@@ -169,7 +164,7 @@
                   "new Tobago.TabGroup(",
                   "    '" + clientId + "', ",
                   "    '" + activeIndex + "', ",
-                  "    '" + component.getChildCount() + "');"
+                  "    '" + tabGroup.getChildCount() + "');"
               };
               HtmlRendererUtil.writeScriptLoader(facesContext, new String[0], cmds);
             }
@@ -255,31 +250,34 @@
     return closestRenderedTabIndex;
   }
 
-  private void renderTabGroupView(FacesContext facesContext, TobagoResponseWriter writer, UITabGroup component,
-      int virtualTab, HtmlStyleMap oStyle, String switchType, String image1x1, int toolbarWidth,
+  private void renderTabGroupView(
+      FacesContext facesContext, TobagoResponseWriter writer, UITabGroup tabGroup,
+      int virtualTab, String switchType, String image1x1, int toolbarWidth,
       int currentWidth, TabList tabList) throws IOException {
-    writer.startElement(HtmlConstants.TABLE, null);
+    writer.startElement(HtmlConstants.TABLE, tabGroup);
     writer.writeAttribute(HtmlAttributes.BORDER, 0);
     writer.writeAttribute(HtmlAttributes.CELLPADDING, 0);
     writer.writeAttribute(HtmlAttributes.CELLSPACING, 0);
     writer.writeAttribute(HtmlAttributes.SUMMARY, "", false);
-    final String clientId = component.getClientId(facesContext);
+    final String clientId = tabGroup.getClientId(facesContext);
     writer.writeIdAttribute(clientId + "__" + virtualTab);
-    writer.writeStyleAttribute(oStyle);
+    writer.writeStyleAttribute();
 
-    writer.startElement(HtmlConstants.TR, null);
+    writer.startElement(HtmlConstants.TR, tabGroup);
     writer.writeAttribute(HtmlAttributes.VALIGN, "bottom", false);
 
-    writer.startElement(HtmlConstants.TD, null);
-    HtmlStyleMap headerStyle = (HtmlStyleMap) component.getAttributes().get(Attributes.STYLE_HEADER);
-    headerStyle.put("position", "relative");
-    headerStyle.put("width", headerStyle.getInt("width"));
-    int width = headerStyle.getInt("width");
-    writer.writeStyleAttribute(headerStyle);
-    writer.startElement(HtmlConstants.DIV, null);
-    writer.writeStyleAttribute(headerStyle);
+    writer.startElement(HtmlConstants.TD, tabGroup);
+    int width = tabGroup.getWidth().getPixel();
+    int headerHeight = ThemeConfig.getMeasure(facesContext, tabGroup, "headerHeight").getPixel();
+    HtmlStyleMap header = new HtmlStyleMap();
+    header.put("position", "relative");
+    header.put("width", width);
+    header.put("height", headerHeight);
+    writer.writeStyleAttribute(header);
+    writer.startElement(HtmlConstants.DIV, tabGroup);
+    writer.writeStyleAttribute(header);
 
-    writer.startElement(HtmlConstants.DIV, null);
+    writer.startElement(HtmlConstants.DIV, tabGroup);
     HtmlStyleMap map = new HtmlStyleMap();
     if (currentWidth > width) {
       map.put("width", currentWidth);
@@ -289,24 +287,24 @@
     }
     map.put("overflow", "hidden");
     map.put("position", "absolute");
+    map.put("height", headerHeight);
     writer.writeStyleAttribute(map);
-    writer.startElement(HtmlConstants.TABLE, component);
+    writer.startElement(HtmlConstants.TABLE, tabGroup);
     writer.writeAttribute(HtmlAttributes.BORDER, 0);
     writer.writeAttribute(HtmlAttributes.CELLPADDING, 0);
     writer.writeAttribute(HtmlAttributes.CELLSPACING, 0);
     writer.writeAttribute(HtmlAttributes.SUMMARY, "", false);
-    headerStyle = (HtmlStyleMap) component.getAttributes().get(Attributes.STYLE_HEADER);
-    writer.writeStyleAttribute(headerStyle);
+    writer.writeStyleAttribute(header);
 
-    writer.startElement(HtmlConstants.COLGROUP, null);
+    writer.startElement(HtmlConstants.COLGROUP, tabGroup);
     for (Integer colWidth : tabList.getWidthList()) {
-      writer.startElement(HtmlConstants.COL, null);
+      writer.startElement(HtmlConstants.COL, tabGroup);
       writer.writeAttribute(HtmlAttributes.WIDTH, colWidth);
       writer.endElement(HtmlConstants.COL);
     }
     writer.endElement(HtmlConstants.COLGROUP);
 
-    writer.startElement(HtmlConstants.TR, null);
+    writer.startElement(HtmlConstants.TR, tabGroup);
     writer.writeAttribute(HtmlAttributes.VALIGN, "bottom", false);
 
     Application application = facesContext.getApplication();
@@ -314,7 +312,7 @@
     // tool bar
 
     UICommand scrollLeft = (UICommand) application.createComponent(UICommand.COMPONENT_TYPE);
-    scrollLeft.setId(component.getId() + "__" + virtualTab + "__" + "previous");
+    scrollLeft.setId(tabGroup.getId() + "__" + virtualTab + "__" + "previous");
     //scrollLeft.setId(facesContext.getViewRoot().createUniqueId());
     scrollLeft.setRendererType(null);
     scrollLeft.getAttributes().put(Attributes.IMAGE, "image/tabPrev.gif");
@@ -323,12 +321,12 @@
     }
     if (!(TobagoConfig.getInstance(facesContext).isAjaxEnabled() && SWITCH_TYPE_RELOAD_TAB.equals(switchType))) {
       scrollLeft.getAttributes().put(Attributes.ONCLICK, "tobago_previousTab('" + switchType + "','" + clientId + "',"
-          + component.getChildCount() + ')');
+          + tabGroup.getChildCount() + ')');
     } else {
       scrollLeft.getAttributes().put(Attributes.ONCLICK, "javascript:false");
     }
     UICommand scrollRight = (UICommand) application.createComponent(UICommand.COMPONENT_TYPE);
-    scrollRight.setId(component.getId() + "__" + virtualTab + "__" + "next");
+    scrollRight.setId(tabGroup.getId() + "__" + virtualTab + "__" + "next");
     scrollRight.setRendererType(null);
     scrollRight.getAttributes().put(Attributes.IMAGE, "image/tabNext.gif");
     if (tabList.isLast(virtualTab)) {
@@ -336,7 +334,7 @@
     }
     if (!(TobagoConfig.getInstance(facesContext).isAjaxEnabled() && SWITCH_TYPE_RELOAD_TAB.equals(switchType))) {
       scrollRight.getAttributes().put(Attributes.ONCLICK, "tobago_nextTab('" + switchType + "','" + clientId + "',"
-          + component.getChildCount() + ')');
+          + tabGroup.getChildCount() + ')');
     } else {
       scrollRight.getAttributes().put(Attributes.ONCLICK, "javascript:false");
     }
@@ -356,12 +354,12 @@
     toolBar.getChildren().add(scrollLeft);
     toolBar.getChildren().add(scrollRight);
     //toolBar.getChildren().add(commandList);
-    component.getFacets().put(Facets.TOOL_BAR, toolBar);
+    tabGroup.getFacets().put(Facets.TOOL_BAR, toolBar);
 
     UITab activeTab = null;
 
     int index = 0;
-    for (UIComponent child : (List<UIComponent>) component.getChildren()) {
+    for (UIComponent child : (List<UIComponent>) tabGroup.getChildren()) {
       if (child instanceof UITab) {
         UITab tab = (UITab) child;
         if (tab.isRendered()) {
@@ -371,7 +369,7 @@
             onclick = null;
           } else {
             onclick = "tobago_switchTab('"+ switchType + "','" + clientId + "'," + index + ','
-                + component.getChildCount() + ')';
+                + tabGroup.getChildCount() + ')';
           }
 
           LabelWithAccessKey label = new LabelWithAccessKey(tab);
@@ -380,7 +378,7 @@
           if (virtualTab == index) {
             outerClass.addClass("tab", "selected-outer");
             innerClass.addClass("tab", "selected-inner");
-            activeTab = (UITab) tab;
+            activeTab = tab;
           } else {
             outerClass.addClass("tab", "unselected-outer");
             innerClass.addClass("tab", "unselected-inner");
@@ -388,24 +386,24 @@
           outerClass.addMarkupClass(tab, "tab", "outer");
           innerClass.addMarkupClass(tab, "tab", "outer");
           writer.startElement(HtmlConstants.TD, tab);
-          map = new HtmlStyleMap();
-          map.put("width", tabList.getWidthList().get(index));
+          HtmlStyleMap labelStyle = new HtmlStyleMap();
+          labelStyle.put("width", tabList.getWidthList().get(index));
 
-          writer.writeStyleAttribute(map);
+          writer.writeStyleAttribute(labelStyle);
           writer.writeIdAttribute(tab.getClientId(facesContext));
 
           HtmlRendererUtil.renderTip(tab, writer);
 
-          writer.startElement(HtmlConstants.DIV, null);
-          writer.writeStyleAttribute(map);
-          writer.startElement(HtmlConstants.DIV, null);
+          writer.startElement(HtmlConstants.DIV, tab);
+          writer.writeStyleAttribute(labelStyle);
+          writer.startElement(HtmlConstants.DIV, tab);
           writer.writeClassAttribute(outerClass);
           //writer.writeStyleAttribute(map);
-          writer.startElement(HtmlConstants.DIV, null);
+          writer.startElement(HtmlConstants.DIV, tab);
           //writer.writeStyleAttribute(map);
           writer.writeClassAttribute(innerClass);
 
-          writer.startElement(HtmlConstants.SPAN, null);
+          writer.startElement(HtmlConstants.SPAN, tab);
           String tabId = clientId + "__" + virtualTab + "__" + index;
           writer.writeIdAttribute(tabId);
 
@@ -429,8 +427,7 @@
                 && !AccessKeyMap.addAccessKey(facesContext, label.getAccessKey())) {
               LOG.warn("dublicated accessKey : " + label.getAccessKey());
             }
-            HtmlRendererUtil.addClickAcceleratorKey(
-                facesContext, tabId, label.getAccessKey());
+            HtmlRendererUtil.addClickAcceleratorKey(facesContext, tabId, label.getAccessKey());
           }
           writer.endElement(HtmlConstants.DIV);
           writer.endElement(HtmlConstants.DIV);
@@ -439,7 +436,7 @@
 
           // tool bar
           /*UIMenuCommand menuItem = (UIMenuCommand) application.createComponent(UIMenuCommand.COMPONENT_TYPE);
-          menuItem.setId(component.getId() + "__" + virtualTab + "__" + index + "__" + "menu");
+          menuItem.setId(tabGroup.getId() + "__" + virtualTab + "__" + index + "__" + "menu");
           menuItem.setRendererType("MenuCommand");
           if (onclick != null) {
             menuItem.getAttributes().put(ONCLICK, onclick);
@@ -460,16 +457,16 @@
     //writer.startElement(HtmlConstants.TD, null);
     //writer.writeAttribute(HtmlAttributes.WIDTH, "100%", false);
 
-    writer.startElement(HtmlConstants.TD, null);
+    writer.startElement(HtmlConstants.TD, tabGroup);
     if (currentWidth > width) {
       writer.writeAttribute(HtmlAttributes.WIDTH, toolbarWidth);
     } else {
       writer.writeAttribute(HtmlAttributes.WIDTH, Integer.toString((width - currentWidth)) + "px", false);
     }
-    writer.startElement(HtmlConstants.DIV, null);
+    writer.startElement(HtmlConstants.DIV, tabGroup);
     writer.writeClassAttribute("tobago-tab-fulfill");
 
-    writer.startElement(HtmlConstants.IMG, null);
+    writer.startElement(HtmlConstants.IMG, tabGroup);
     writer.writeAttribute(HtmlAttributes.SRC, image1x1, false);
     writer.writeAttribute(HtmlAttributes.ALT, "", false);
     writer.endElement(HtmlConstants.IMG);
@@ -486,7 +483,11 @@
     writer.endElement(HtmlConstants.TD);
     writer.endElement(HtmlConstants.TR);
 
-    encodeContent(writer, facesContext, activeTab);
+    HtmlStyleMap body = new HtmlStyleMap();
+    body.put("position", "relative");
+    body.put("width", width);
+    body.put("height", tabGroup.getHeight().getPixel() - headerHeight);
+    encodeContent(writer, facesContext, activeTab, body);
 
     writer.endElement(HtmlConstants.TABLE);
   }
@@ -506,18 +507,17 @@
     writer.endElement(HtmlConstants.DIV);
   }
 
-  protected void encodeContent(TobagoResponseWriter writer, FacesContext facesContext, UITab activeTab)
+  protected void encodeContent(
+      TobagoResponseWriter writer, FacesContext facesContext, UITab activeTab, HtmlStyleMap body)
       throws IOException {
 
-    HtmlStyleMap bodyStyle = (HtmlStyleMap)
-        activeTab.getParent().getAttributes().get(Attributes.STYLE_BODY);
-    writer.startElement(HtmlConstants.TR, null);
-    writer.startElement(HtmlConstants.TD, null);
+    writer.startElement(HtmlConstants.TR, activeTab);
+    writer.startElement(HtmlConstants.TD, activeTab);
     StyleClasses classes = new StyleClasses();
     classes.addClass("tab", "content");
     classes.addMarkupClass(activeTab, "tab", "content");
     writer.writeClassAttribute(classes);
-    writer.writeStyleAttribute(bodyStyle);
+    writer.writeStyleAttribute(body);
     writer.flush();
     RenderUtil.encodeChildren(facesContext, activeTab);
     writer.endElement(HtmlConstants.TD);
@@ -530,8 +530,7 @@
     int index = ensureRenderedActiveIndex(context, (UITabGroup) component);
     int currentWidth = getCurrentWidth(tabList, index);
     renderTabGroupView(context, HtmlRendererUtil.getTobagoResponseWriter(context),
-        (UITabGroup) component, index,
-        (HtmlStyleMap) component.getAttributes().get(Attributes.STYLE), SWITCH_TYPE_RELOAD_TAB,
+        (UITabGroup) component, index, SWITCH_TYPE_RELOAD_TAB,
         ResourceManagerUtil.getImageWithPath(context, "image/1x1.gif"),
         ThemeConfig.getValue(context, component, "navigationBarWidth"), currentWidth, tabList);
   }

Modified: myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/property/tobago-theme-config.properties
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/property/tobago-theme-config.properties?rev=811021&r1=811020&r2=811021&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/property/tobago-theme-config.properties (original)
+++ myfaces/tobago/trunk/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/property/tobago-theme-config.properties Thu Sep  3 16:44:28 2009
@@ -131,16 +131,24 @@
 Sheet.selectorMenuWidth=20
 Sheet.cellPaddingWidth=4
 
+Tab.paddingWidth=0
+Tab.paddingHeight=0
+Tab.headerHeight=0
+Tab.leftOffset=10
+Tab.topOffset=34
+Tab.rightOffset=10
+Tab.bottomOffset=10
+
 TabGroup.fontWidth=8
 TabGroup.paddingWidth=24
 TabGroup.paddingHeight=25
 TabGroup.headerHeight=24
 TabGroup.tabLabelExtraWidth=20
 TabGroup.navigationBarWidth=60
-
-Tab.paddingWidth=0
-Tab.paddingHeight=0
-Tab.headerHeight=0
+TabGroup.leftOffset=1
+TabGroup.topOffset=0
+TabGroup.rightOffset=2
+TabGroup.bottomOffset=2
 
 TextArea.headerHeight=0
 

Modified: myfaces/tobago/trunk/theme/speyside/src/main/java/org/apache/myfaces/tobago/renderkit/html/speyside/standard/tag/TabGroupRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/speyside/src/main/java/org/apache/myfaces/tobago/renderkit/html/speyside/standard/tag/TabGroupRenderer.java?rev=811021&r1=811020&r2=811021&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/speyside/src/main/java/org/apache/myfaces/tobago/renderkit/html/speyside/standard/tag/TabGroupRenderer.java (original)
+++ myfaces/tobago/trunk/theme/speyside/src/main/java/org/apache/myfaces/tobago/renderkit/html/speyside/standard/tag/TabGroupRenderer.java Thu Sep  3 16:44:28 2009
@@ -17,46 +17,38 @@
  * limitations under the License.
  */
 
-/*
- * Created 07.02.2003 16:00:00.
- * $Id$
- */
-
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.myfaces.tobago.component.Attributes;
 import org.apache.myfaces.tobago.component.UITab;
 import org.apache.myfaces.tobago.renderkit.html.HtmlConstants;
 import org.apache.myfaces.tobago.renderkit.html.HtmlStyleMap;
 import org.apache.myfaces.tobago.renderkit.html.StyleClasses;
-import org.apache.myfaces.tobago.renderkit.html.util.HtmlRendererUtil;
 import org.apache.myfaces.tobago.renderkit.util.RenderUtil;
 import org.apache.myfaces.tobago.webapp.TobagoResponseWriter;
 
 import javax.faces.context.FacesContext;
 import java.io.IOException;
-import java.text.MessageFormat;
 
 public class TabGroupRenderer extends
     org.apache.myfaces.tobago.renderkit.html.scarborough.standard.tag.TabGroupRenderer{
 
   private static final Log LOG = LogFactory.getLog(TabGroupRenderer.class);
 
-  protected void encodeContent(TobagoResponseWriter writer,
-      FacesContext facesContext, UITab activeTab) throws IOException {
+  @Override
+  protected void encodeContent(
+      TobagoResponseWriter writer, FacesContext facesContext, UITab activeTab, HtmlStyleMap body)
+      throws IOException {
 
-    HtmlStyleMap bodyStyle = (HtmlStyleMap)
-        activeTab.getParent().getAttributes().get(Attributes.STYLE_BODY);
     writer.startElement(HtmlConstants.TR, null);
     writer.startElement(HtmlConstants.TD, null);
-    if (bodyStyle != null) {
-      writer.writeStyleAttribute(bodyStyle);
+    if (body != null) {
+      writer.writeStyleAttribute(body);
     }
 
     writer.startElement(HtmlConstants.DIV, null);
     writer.writeClassAttribute("tobago-tab-shadow");
-    if (bodyStyle != null) {
-      writer.writeStyleAttribute(bodyStyle);
+    if (body != null) {
+      writer.writeStyleAttribute(body);
     }
 
     writer.startElement(HtmlConstants.DIV, null);
@@ -65,10 +57,9 @@
     classes.addMarkupClass(activeTab, "tab", "content");
     writer.writeClassAttribute(classes);
 
-    Integer height = HtmlRendererUtil.getStyleAttributeIntValue(bodyStyle, "height");
-    if (height != null) {
-      writer.writeStyleAttribute(MessageFormat.format("height: {0}px; overflow: auto;", height - 1));
-    }
+    body.put("height", body.getInt("height") - 1);
+    body.put("overflow", "auto");
+    writer.writeStyleAttribute(body);
 
     writer.flush();
     RenderUtil.encodeChildren(facesContext, activeTab);

Modified: myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/property/tobago-theme-config.properties
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/property/tobago-theme-config.properties?rev=811021&r1=811020&r2=811021&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/property/tobago-theme-config.properties (original)
+++ myfaces/tobago/trunk/theme/speyside/src/main/resources/org/apache/myfaces/tobago/renderkit/html/speyside/standard/property/tobago-theme-config.properties Thu Sep  3 16:44:28 2009
@@ -81,14 +81,22 @@
 Sheet.selectorMenuWidth=16
 Sheet.cellPaddingWidth=4
 
+Tab.paddingWidth=0
+Tab.paddingHeight=0
+Tab.leftOffset=5
+Tab.topOffset=5
+Tab.rightOffset=5
+Tab.bottomOffset=5
+
 TabGroup.paddingHeight=22
 TabGroup.paddingWidth=23
 TabGroup.headerHeight=19
 TabGroup.tabLabelExtraWidth=20
 TabGroup.navigationBarWidth=60
-
-Tab.paddingWidth=0
-Tab.paddingHeight=0
+TabGroup.leftOffset=1
+TabGroup.topOffset=19
+TabGroup.rightOffset=2
+TabGroup.bottomOffset=2
 
 TextArea.css.border-left-width=1
 TextArea.css.border-top-width=1

Modified: myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/property/tobago-theme-config.properties
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/property/tobago-theme-config.properties?rev=811021&r1=811020&r2=811021&view=diff
==============================================================================
--- myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/property/tobago-theme-config.properties (original)
+++ myfaces/tobago/trunk/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/property/tobago-theme-config.properties Thu Sep  3 16:44:28 2009
@@ -58,4 +58,3 @@
 Separator.css.padding-top=0
 Separator.css.padding-right=0
 Separator.css.padding-bottom=0
-