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 2015/01/08 09:33:55 UTC

svn commit: r1650230 - in /myfaces/tobago/branches/tobago-3.0.x: tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/ tobago-core/src/main/java/org/apache/myfaces/tobago/internal/layout/ tobago-core/src/main/java/org/apache/myfaces/t...

Author: lofwyr
Date: Thu Jan  8 08:33:54 2015
New Revision: 1650230

URL: http://svn.apache.org/r1650230
Log:
TOBAGO-1434: Move Layout-Manager-Logic from Server to Client
- better logging

Modified:
    myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIColumnLayout.java
    myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIGridLayout.java
    myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/layout/LayoutContext.java
    myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/layout/ColumnPartition.java
    myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/ColumnLayoutRenderer.java

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIColumnLayout.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIColumnLayout.java?rev=1650230&r1=1650229&r2=1650230&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIColumnLayout.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIColumnLayout.java Thu Jan  8 08:33:54 2015
@@ -20,6 +20,7 @@
 package org.apache.myfaces.tobago.internal.component;
 
 import org.apache.myfaces.tobago.component.SupportsMarkup;
+import org.apache.myfaces.tobago.layout.ColumnPartition;
 import org.apache.myfaces.tobago.layout.LayoutComponent;
 import org.apache.myfaces.tobago.layout.LayoutContainer;
 import org.apache.myfaces.tobago.layout.LayoutManager;
@@ -52,4 +53,35 @@ public abstract class AbstractUIColumnLa
   public void postProcessing(final Orientation orientation) {
   }
 */
-}
+
+  @Override
+  public String toString() {
+    StringBuilder builder  =new StringBuilder(getClass().getSimpleName());
+    if (getExtraSmall() != null) {
+      builder.append("\n        extraSmall=");
+      builder.append(getExtraSmall());
+    }
+    if (getSmall() != null) {
+      builder.append("\n        small=");
+      builder.append(getSmall());
+    }
+    if (getMedium() != null) {
+      builder.append("\n        medium=");
+      builder.append(getMedium());
+    }
+    if (getLarge() != null) {
+      builder.append("\n        large=");
+      builder.append(getLarge());
+    }
+    return builder.toString();
+  }
+
+  public abstract ColumnPartition getExtraSmall();
+
+  public abstract ColumnPartition getSmall();
+
+  public abstract ColumnPartition getMedium();
+
+  public abstract ColumnPartition getLarge();
+
+  }

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIGridLayout.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIGridLayout.java?rev=1650230&r1=1650229&r2=1650230&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIGridLayout.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIGridLayout.java Thu Jan  8 08:33:54 2015
@@ -482,28 +482,28 @@ public abstract class AbstractUIGridLayo
     return false;
   }
 
-  public String toString(final int depth) {
+  public String toString() {
     final StringBuilder builder = new StringBuilder();
     builder.append(getClass().getSimpleName()).append("#");
     builder.append(getClientId(FacesContext.getCurrentInstance()));
     builder.append("\n");
     if (grid != null) {
-      builder.append(StringUtils.repeat("  ", depth + 4));
+      builder.append(StringUtils.repeat("  ", 4));
       builder.append("horiz.: ");
       BankHead[] heads = grid.getBankHeads(Orientation.HORIZONTAL);
       for (int i = 0; i < heads.length; i++) {
         if (i != 0) {
-          builder.append(StringUtils.repeat("  ", depth + 4 + 4));
+          builder.append(StringUtils.repeat("  ", 4 + 4));
         }
         builder.append(heads[i]);
         builder.append("\n");
       }
-      builder.append(StringUtils.repeat("  ", depth + 4));
+      builder.append(StringUtils.repeat("  ", 4));
       builder.append("verti.: ");
       heads = grid.getBankHeads(Orientation.VERTICAL);
       for (int i = 0; i < heads.length; i++) {
         if (i != 0) {
-          builder.append(StringUtils.repeat("  ", depth + 4 + 4));
+          builder.append(StringUtils.repeat("  ", 4 + 4));
         }
         builder.append(heads[i]);
         builder.append("\n");
@@ -513,8 +513,4 @@ public abstract class AbstractUIGridLayo
     return builder.toString();
   }
 
-  @Override
-  public String toString() {
-    return toString(0);
-  }
 }

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/layout/LayoutContext.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/layout/LayoutContext.java?rev=1650230&r1=1650229&r2=1650230&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/layout/LayoutContext.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/layout/LayoutContext.java Thu Jan  8 08:33:54 2015
@@ -19,7 +19,6 @@
 
 package org.apache.myfaces.tobago.internal.layout;
 
-import org.apache.myfaces.tobago.internal.component.AbstractUIGridLayout;
 import org.apache.myfaces.tobago.internal.util.StringUtils;
 import org.apache.myfaces.tobago.layout.LayoutBase;
 import org.apache.myfaces.tobago.layout.LayoutContainer;
@@ -145,12 +144,10 @@ public class LayoutContext {
     }
     if (component instanceof LayoutContainer) {
       final LayoutManager layoutManager = ((LayoutContainer) component).getLayoutManager();
-      if (layoutManager instanceof AbstractUIGridLayout) {
-        buffer.append("\n");
-        buffer.append(StringUtils.repeat("  ", depth + 4));
-        buffer.append("layout: ");
-        buffer.append(((AbstractUIGridLayout) layoutManager).toString(depth));
-      }
+      buffer.append("\n");
+      buffer.append(StringUtils.repeat("  ", depth + 4));
+      buffer.append("layout: ");
+      buffer.append(layoutManager.toString().replace("\n", "\n" + StringUtils.repeat("  ", depth)));
     }
     buffer.append("\n");
     for (final UIComponent child : component.getChildren()) {

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/layout/ColumnPartition.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/layout/ColumnPartition.java?rev=1650230&r1=1650229&r2=1650230&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/layout/ColumnPartition.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-core/src/main/java/org/apache/myfaces/tobago/layout/ColumnPartition.java Thu Jan  8 08:33:54 2015
@@ -113,4 +113,9 @@ public final class ColumnPartition {
   public int getPart(final int column) {
     return parts[column];
   }
+
+  @Override
+  public String toString() {
+    return Arrays.toString(parts);
+  }
 }

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/ColumnLayoutRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/ColumnLayoutRenderer.java?rev=1650230&r1=1650229&r2=1650230&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/ColumnLayoutRenderer.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/ColumnLayoutRenderer.java Thu Jan  8 08:33:54 2015
@@ -39,6 +39,9 @@ import javax.faces.context.FacesContext;
 import java.io.IOException;
 import java.util.List;
 
+/**
+ * Renders the 12 columns layout.
+ */
 public class ColumnLayoutRenderer extends RendererBase {
 
   private static final Logger LOG = LoggerFactory.getLogger(ColumnLayoutRenderer.class);