]> source.dussan.org Git - vaadin-framework.git/commitdiff
Documented Layout interface
authorJoonas Lehtinen <joonas.lehtinen@itmill.com>
Thu, 14 Jun 2007 08:39:37 +0000 (08:39 +0000)
committerJoonas Lehtinen <joonas.lehtinen@itmill.com>
Thu, 14 Jun 2007 08:39:37 +0000 (08:39 +0000)
svn changeset:1713/svn branch:trunk

src/com/itmill/toolkit/terminal/gwt/client/Layout.java

index 850e6697a3f79952902a8e9461b0119b9789b044..f3053e29adbeaba484a51157ed31f8217aa52bd9 100644 (file)
@@ -4,8 +4,44 @@ import com.google.gwt.user.client.ui.Widget;
 
 public interface Layout extends Paintable {
 
+       /**
+        * Replace child of this layout with another component.
+        * 
+        * Each layout must be able to switch children. To to this, one must just
+        * give references to a current and new child. Note that the Layout is not
+        * responsible for registering paintable into client.
+        * 
+        * @param oldComponent
+        *            Child to be replaced
+        * @param newComponent
+        *            Child that replaces the oldComponent
+        */
        void replaceChildComponent(Widget oldComponent, Widget newComponent);
 
+       /**
+        * Is a given component child of this layout.
+        * 
+        * @param component
+        *            Component to test.
+        * @return true iff component is a child of this layout.
+        */
        boolean hasChildComponent(Widget component);
 
+       /**
+        * Update child components caption, description and error message.
+        * 
+        * <p>
+        * Each component is responsible for maintaining its caption, description
+        * and error message. In most cases components doesn't want to do that and
+        * those elements reside outside of the component. Because of this layouts
+        * should provide service for it's childen to show those elements for them.
+        * </p>
+        * 
+        * @param component
+        *            Child component that requests the service.
+        * @param uidl
+        *            UIDL of the child component.
+        * @return true iff this layout updated caption succesfully.
+        */
+       boolean updateCaption(Widget component, UIDL uidl);
 }