]> source.dussan.org Git - vaadin-framework.git/commitdiff
Add exception handling for layout and element resize (#4203)
authorLeif Åstrand <leif@vaadin.com>
Mon, 16 Apr 2012 11:38:02 +0000 (14:38 +0300)
committerLeif Åstrand <leif@vaadin.com>
Mon, 16 Apr 2012 11:38:02 +0000 (14:38 +0300)
src/com/vaadin/terminal/gwt/client/LayoutManager.java

index 07b8debc79eb93475ec5ac40b5946520ffe0ff2a..b182429902af5dfc64fe8b5c8c7536ddb95e3abc 100644 (file)
@@ -224,7 +224,11 @@ public class LayoutManager {
                     ElementResizeEvent event = new ElementResizeEvent(this,
                             element);
                     for (ElementResizeListener listener : array) {
-                        listener.onElementResize(event);
+                        try {
+                            listener.onElementResize(event);
+                        } catch (RuntimeException e) {
+                            VConsole.error(e);
+                        }
                     }
                 }
                 int measureListenerTime = passDuration.elapsedMillis();
@@ -245,14 +249,22 @@ public class LayoutManager {
                         currentDependencyTree
                                 .markAsHorizontallyLayouted(layout);
                         DirectionalManagedLayout cl = (DirectionalManagedLayout) layout;
-                        cl.layoutHorizontally();
+                        try {
+                            cl.layoutHorizontally();
+                        } catch (RuntimeException e) {
+                            VConsole.log(e);
+                        }
                         countLayout(layoutCounts, cl);
                     } else {
                         currentDependencyTree
                                 .markAsHorizontallyLayouted(layout);
                         currentDependencyTree.markAsVerticallyLayouted(layout);
                         SimpleManagedLayout rr = (SimpleManagedLayout) layout;
-                        rr.layout();
+                        try {
+                            rr.layout();
+                        } catch (RuntimeException e) {
+                            VConsole.log(e);
+                        }
                         countLayout(layoutCounts, rr);
                     }
                     if (debugLogging) {
@@ -265,14 +277,22 @@ public class LayoutManager {
                     if (layout instanceof DirectionalManagedLayout) {
                         currentDependencyTree.markAsVerticallyLayouted(layout);
                         DirectionalManagedLayout cl = (DirectionalManagedLayout) layout;
-                        cl.layoutVertically();
+                        try {
+                            cl.layoutVertically();
+                        } catch (RuntimeException e) {
+                            VConsole.log(e);
+                        }
                         countLayout(layoutCounts, cl);
                     } else {
                         currentDependencyTree
                                 .markAsHorizontallyLayouted(layout);
                         currentDependencyTree.markAsVerticallyLayouted(layout);
                         SimpleManagedLayout rr = (SimpleManagedLayout) layout;
-                        rr.layout();
+                        try {
+                            rr.layout();
+                        } catch (RuntimeException e) {
+                            VConsole.log(e);
+                        }
                         countLayout(layoutCounts, rr);
                     }
                     if (debugLogging) {