From 118e74b23b0d911303c2b03ebb0d9fcc656c3b30 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Leif=20=C3=85strand?= Date: Tue, 20 Mar 2012 15:15:07 +0200 Subject: [PATCH] Show a clear message to more easily discover layout loops (#8313) --- src/com/vaadin/terminal/gwt/client/LayoutManager.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/com/vaadin/terminal/gwt/client/LayoutManager.java b/src/com/vaadin/terminal/gwt/client/LayoutManager.java index 885199b6eb..891f145efb 100644 --- a/src/com/vaadin/terminal/gwt/client/LayoutManager.java +++ b/src/com/vaadin/terminal/gwt/client/LayoutManager.java @@ -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 nonPaintableElements = new HashSet(); 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; } } -- 2.39.5