You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2009/10/29 17:30:35 UTC

svn commit: r831018 - /myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/AbstractUIGridLayout.java

Author: lofwyr
Date: Thu Oct 29 16:30:35 2009
New Revision: 831018

URL: http://svn.apache.org/viewvc?rev=831018&view=rev
Log:
+ cleanup
+ toString NPE aware

Modified:
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/AbstractUIGridLayout.java

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=831018&r1=831017&r2=831018&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 Oct 29 16:30:35 2009
@@ -19,7 +19,6 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.myfaces.tobago.OnComponentCreated;
 import org.apache.myfaces.tobago.layout.AutoLayoutToken;
 import org.apache.myfaces.tobago.layout.Display;
 import org.apache.myfaces.tobago.layout.FactorList;
@@ -41,24 +40,17 @@
 import org.apache.myfaces.tobago.layout.grid.OriginCell;
 import org.apache.myfaces.tobago.layout.math.EquationManager;
 
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
 import java.util.Arrays;
 import java.util.List;
 
-public abstract class AbstractUIGridLayout extends UILayout implements OnComponentCreated, LayoutManager {
+public abstract class AbstractUIGridLayout extends UILayout implements LayoutManager {
 
   private static final Log LOG = LogFactory.getLog(AbstractUIGridLayout.class);
 
   private Grid grid;
 
-  public void onComponentCreated(FacesContext context, UIComponent component) {
-  }
-
-  // /////////////////////////////////////////////////////////////////////////////////////////
-  // /////////////////////////////////////////////////////////////////////////////////////////
-  // /////////////////////////////////////////////////////////////////////////////////////////
   // /////////////////////////////////////////////////////////////////////////////////////////
+  // new layout mechanism
   // /////////////////////////////////////////////////////////////////////////////////////////
 
   public void init() {
@@ -272,9 +264,7 @@
   }
 
   // /////////////////////////////////////////////////////////////////////////////////////////
-  // /////////////////////////////////////////////////////////////////////////////////////////
-  // /////////////////////////////////////////////////////////////////////////////////////////
-  // /////////////////////////////////////////////////////////////////////////////////////////
+  // layout mechanism with equations
   // /////////////////////////////////////////////////////////////////////////////////////////
 
   /**
@@ -511,6 +501,8 @@
   @Override
   public String toString() {
     return getClass().getSimpleName()
-        + "(" + Arrays.toString(grid.getWidths()) + ", " + Arrays.toString(grid.getHeights()) + ")";
+        + (grid != null
+        ? "(" + Arrays.toString(grid.getWidths()) + ", " + Arrays.toString(grid.getHeights()) + ")" 
+        : "");
   }
 }