]> source.dussan.org Git - vaadin-framework.git/commitdiff
Show a clear message to more easily discover layout loops (#8313)
authorLeif Åstrand <leif@vaadin.com>
Tue, 20 Mar 2012 13:15:07 +0000 (15:15 +0200)
committerLeif Åstrand <leif@vaadin.com>
Tue, 20 Mar 2012 13:15:07 +0000 (15:15 +0200)
src/com/vaadin/terminal/gwt/client/LayoutManager.java

index 885199b6eb9507008d543ca7bd6cabc440dd611c..891f145efbb4a7911a1f02d599a32f4019117e88 100644 (file)
@@ -12,8 +12,10 @@ import com.google.gwt.dom.client.Element;
 import com.vaadin.terminal.gwt.client.ui.ManagedLayout;
 import com.vaadin.terminal.gwt.client.ui.PostLayoutListener;
 import com.vaadin.terminal.gwt.client.ui.SimpleManagedLayout;
+import com.vaadin.terminal.gwt.client.ui.VNotification;
 
 public class LayoutManager {
+    private static final String LOOP_ABORT_MESSAGE = "Aborting layout after 100 passes. This would probably be an infinite loop.";
     private final ApplicationConnection connection;
     private final Set<Element> nonPaintableElements = new HashSet<Element>();
     private final MeasuredSize nullSize = new MeasuredSize();
@@ -221,7 +223,10 @@ public class LayoutManager {
             }
 
             if (passes > 100) {
-                VConsole.log("Aborting layout");
+                VConsole.log(LOOP_ABORT_MESSAGE);
+                VNotification.createNotification(VNotification.DELAY_FOREVER)
+                        .show(LOOP_ABORT_MESSAGE, VNotification.CENTERED,
+                                "error");
                 break;
             }
         }