From 99571617b239c33c6ea085323b88ddf32b8a3827 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Thu, 21 Jun 2012 10:36:09 +0300 Subject: [PATCH] Root javadoc --- src/com/vaadin/ui/Component.java | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/src/com/vaadin/ui/Component.java b/src/com/vaadin/ui/Component.java index ce6df9854f..2394d0f307 100644 --- a/src/com/vaadin/ui/Component.java +++ b/src/com/vaadin/ui/Component.java @@ -497,21 +497,15 @@ public interface Component extends ClientConnector, Sizeable, Serializable { public void setIcon(Resource icon); /** - * Gets the parent window of the component. + * Gets the Root the component is attached to. * *

- * If the component is not attached to a window through a component + * If the component is not attached to a Root through a component * containment hierarchy, null is returned. *

* - *

- * The window can be either an application-level window or a sub-window. If - * the component is itself a window, it returns a reference to itself, not - * to its containing window (of a sub-window). - *

- * - * @return the parent window of the component or null if it is - * not attached to a window or is itself a window + * @return the Root of the component or null if it is not + * attached to a Root */ public Root getRoot(); @@ -520,11 +514,16 @@ public interface Component extends ClientConnector, Sizeable, Serializable { * *

* The method will return {@code null} if the component is not currently - * attached to an application. This is often a problem in constructors of - * regular components and in the initializers of custom composite - * components. A standard workaround is to move the problematic - * initialization to {@link #attach()}, as described in the documentation of - * the method. + * attached to an application. + *

+ * + *

+ * Getting a null value is often a problem in constructors of regular + * components and in the initializers of custom composite components. A + * standard workaround is to use {@link Application#getCurrentApplication()} + * to retrieve the application instance that the current request relates to. + * Another way is to move the problematic initialization to + * {@link #attach()}, as described in the documentation of the method. *

* * @return the parent application of the component or null. -- 2.39.5