From 512b541b3edb1dbc919dd1fa757965a766c603ad Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Tue, 20 Nov 2012 10:34:36 +0200 Subject: [PATCH] Updated Panel, Window to use Component in constructors (#10300) * Updated javadoc to be consistent with how Panel and Window behave (#10289) Change-Id: I682d202e27b14d9695a8a6cd9eaff8a53fc6ae82 --- server/src/com/vaadin/ui/Panel.java | 11 +++++------ server/src/com/vaadin/ui/Window.java | 14 ++++++-------- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/server/src/com/vaadin/ui/Panel.java b/server/src/com/vaadin/ui/Panel.java index b5cfe04407..472aefd5e0 100644 --- a/server/src/com/vaadin/ui/Panel.java +++ b/server/src/com/vaadin/ui/Panel.java @@ -56,20 +56,19 @@ public class Panel extends AbstractSingleComponentContainer implements }; /** - * Creates a new empty panel. A VerticalLayout is used as content. + * Creates a new empty panel. */ public Panel() { this((ComponentContainer) null); } /** - * Creates a new empty panel which contains the given content. The content - * cannot be null. + * Creates a new empty panel which contains the given content. * * @param content * the content for the panel. */ - public Panel(ComponentContainer content) { + public Panel(Component content) { registerRpc(rpc); setContent(content); setWidth(100, Unit.PERCENTAGE); @@ -77,7 +76,7 @@ public class Panel extends AbstractSingleComponentContainer implements } /** - * Creates a new empty panel with caption. Default layout is used. + * Creates a new empty panel with caption. * * @param caption * the caption used in the panel (HTML). @@ -94,7 +93,7 @@ public class Panel extends AbstractSingleComponentContainer implements * @param content * the content used in the panel. */ - public Panel(String caption, ComponentContainer content) { + public Panel(String caption, Component content) { this(content); setCaption(caption); } diff --git a/server/src/com/vaadin/ui/Window.java b/server/src/com/vaadin/ui/Window.java index 3f6091aa90..338c77239a 100644 --- a/server/src/com/vaadin/ui/Window.java +++ b/server/src/com/vaadin/ui/Window.java @@ -42,10 +42,8 @@ import com.vaadin.shared.ui.window.WindowState; * {@link UI}. A window is added to a {@code UI} using * {@link UI#addWindow(Window)}.

*

- * The contents of a window is set using {@link #setContent(ComponentContainer)} - * or by using the {@link #Window(String, ComponentContainer)} constructor. The - * contents can in turn contain other components. By default, a - * {@link VerticalLayout} is used as content. + * The contents of a window is set using {@link #setContent(Component)} or by + * using the {@link #Window(String, Component)} constructor. *

*

* A window can be positioned on the screen using absolute coordinates (pixels) @@ -75,14 +73,14 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, }; /** - * Creates a new unnamed window with a default layout. + * Creates a new, empty sub window */ public Window() { this("", null); } /** - * Creates a new unnamed window with a default layout and given title. + * Creates a new, empty sub window with a given title. * * @param caption * the title of the window. @@ -92,14 +90,14 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, } /** - * Creates a new unnamed window with the given content and title. + * Creates a new, empty sub window with the given content and title. * * @param caption * the title of the window. * @param content * the contents of the window */ - public Window(String caption, ComponentContainer content) { + public Window(String caption, Component content) { super(caption, content); registerRpc(rpc); setSizeUndefined(); -- 2.39.5