From: Leif Åstrand Date: Mon, 21 Nov 2011 11:38:46 +0000 (+0200) Subject: Handle removeAllComponents for Roots in legacy applications X-Git-Tag: 7.0.0.alpha1~276 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=08ea1143da06f6fefb5c4918f4ff3671ed8f81a2;p=vaadin-framework.git Handle removeAllComponents for Roots in legacy applications --- diff --git a/src/com/vaadin/ui/Root.java b/src/com/vaadin/ui/Root.java index 58de81c82e..0be78803b7 100644 --- a/src/com/vaadin/ui/Root.java +++ b/src/com/vaadin/ui/Root.java @@ -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) { }