From: Leif Åstrand Date: Tue, 20 Mar 2012 13:15:07 +0000 (+0200) Subject: Show a clear message to more easily discover layout loops (#8313) X-Git-Tag: 7.0.0.alpha2~295 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=118e74b23b0d911303c2b03ebb0d9fcc656c3b30;p=vaadin-framework.git Show a clear message to more easily discover layout loops (#8313) --- 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; } }