]> source.dussan.org Git - vaadin-framework.git/commitdiff
Handle removeAllComponents for Roots in legacy applications
authorLeif Åstrand <leif@vaadin.com>
Mon, 21 Nov 2011 11:38:46 +0000 (13:38 +0200)
committerLeif Åstrand <leif@vaadin.com>
Mon, 21 Nov 2011 11:38:46 +0000 (13:38 +0200)
src/com/vaadin/ui/Root.java

index 58de81c82e6f8e9d1565edba75f0648935bf08af..0be78803b7be77ac8b67fd4e11a0a35d6cb57660 100644 (file)
@@ -550,6 +550,17 @@ public class Root extends AbstractComponentContainer {
         }
     }
 
+    @Override
+    public void removeAllComponents() {
+        // Use the thread local as the instance field might not yet be inited
+        if (Application.getCurrentApplication() instanceof Application.LegacyApplication) {
+            getContent().removeAllComponents();
+        } else {
+            throw new UnsupportedOperationException(
+                    "Remove components from the Root's content instead");
+        }
+    }
+
     public void init(WrappedRequest request) {
 
     }