]> source.dussan.org Git - vaadin-framework.git/commitdiff
fixes #3782, a better exception when trying to add Window via addComponent
authorMatti Tahvonen <matti.tahvonen@itmill.com>
Mon, 30 Nov 2009 10:19:44 +0000 (10:19 +0000)
committerMatti Tahvonen <matti.tahvonen@itmill.com>
Mon, 30 Nov 2009 10:19:44 +0000 (10:19 +0000)
svn changeset:10104/svn branch:6.2

src/com/vaadin/ui/Window.java

index d234f7aaaca731dc7d466a5963b8de2507bb7b43..989ea099036d545791792c340e00b80cd05f5dbc 100644 (file)
@@ -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.
      *