From: Matti Tahvonen Date: Mon, 30 Nov 2009 10:19:44 +0000 (+0000) Subject: fixes #3782, a better exception when trying to add Window via addComponent X-Git-Tag: 6.7.0.beta1~2224 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=fe106e7afab311dcc42b26fe7849213c918ad9d0;p=vaadin-framework.git fixes #3782, a better exception when trying to add Window via addComponent svn changeset:10104/svn branch:6.2 --- diff --git a/src/com/vaadin/ui/Window.java b/src/com/vaadin/ui/Window.java index d234f7aaac..989ea09903 100644 --- a/src/com/vaadin/ui/Window.java +++ b/src/com/vaadin/ui/Window.java @@ -185,6 +185,16 @@ public class Window extends Panel implements URIHandler, ParameterHandler { setSizeUndefined(); } + @Override + public void addComponent(Component c) { + if (c instanceof Window) { + throw new IllegalArgumentException( + "Window cannot be added to another via addComponent. " + + "Use addWindow(Window) instead."); + } + super.addComponent(c); + } + /** * Gets the terminal type. *