myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lof...@apache.org
Subject svn commit: r1568939 - /myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/SheetRenderer.java
Date Mon, 17 Feb 2014 10:57:29 GMT
Author: lofwyr
Date: Mon Feb 17 10:57:28 2014
New Revision: 1568939

URL: http://svn.apache.org/r1568939
Log:
prevent ClassCastException

Modified:
    myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/SheetRenderer.java

Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/SheetRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/SheetRenderer.java?rev=1568939&r1=1568938&r2=1568939&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/SheetRenderer.java
(original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/SheetRenderer.java
Mon Feb 17 10:57:28 2014
@@ -53,6 +53,7 @@ import org.apache.myfaces.tobago.interna
 import org.apache.myfaces.tobago.internal.util.StringUtils;
 import org.apache.myfaces.tobago.layout.Display;
 import org.apache.myfaces.tobago.layout.LayoutBase;
+import org.apache.myfaces.tobago.layout.LayoutManager;
 import org.apache.myfaces.tobago.layout.Measure;
 import org.apache.myfaces.tobago.layout.TextAlign;
 import org.apache.myfaces.tobago.model.ExpandedState;
@@ -907,7 +908,13 @@ public class SheetRenderer extends Layou
   }
 
   private boolean needVerticalScrollbar(final FacesContext facesContext, final UISheet sheet)
{
-    return ((AbstractUISheetLayout) sheet.getLayoutManager()).needVerticalScrollbar(facesContext,
sheet);
+    final LayoutManager layoutManager = sheet.getLayoutManager();
+    if (layoutManager instanceof AbstractUISheetLayout) {
+      return ((AbstractUISheetLayout) layoutManager).needVerticalScrollbar(facesContext,
sheet);
+    } else {
+      LOG.error("Sheet must use a sheet layout, but found: " + layoutManager.getClass().getName());
+      return true;
+    }
   }
 
   private void encodeResizing(final TobagoResponseWriter writer, final AbstractUISheet sheet,
final int columnIndex)



Mime
View raw message