From fe106e7afab311dcc42b26fe7849213c918ad9d0 Mon Sep 17 00:00:00 2001 From: Matti Tahvonen Date: Mon, 30 Nov 2009 10:19:44 +0000 Subject: [PATCH] fixes #3782, a better exception when trying to add Window via addComponent svn changeset:10104/svn branch:6.2 --- src/com/vaadin/ui/Window.java | 10 ++++++++++ 1 file changed, 10 insertions(+) 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. * -- 2.39.5