Updating Showcase to use LayoutPanels throughout the hierarchy, thus implementing ProvidesResize down to the examples.  This allows the examples to look better, especially examples that implement RequiresResize. Most of the example look the same, but TabLayoutPanel and SplitLayoutPanel now take up a larger area to illustrate how they would be used in most apps.

This change Also modifies ContentWidget to use SafeHtml instead of a String html for the example descriptions, and fixes some warnings in Showcase.

Review at http://gwt-code-reviews.appspot.com/1409801

Review by: pdr@google.com

git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@9960 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/samples/showcase/src/com/google/gwt/sample/showcase/client/ContentWidget.java b/samples/showcase/src/com/google/gwt/sample/showcase/client/ContentWidget.java
index 177619f..d224c0b 100644
--- a/samples/showcase/src/com/google/gwt/sample/showcase/client/ContentWidget.java
+++ b/samples/showcase/src/com/google/gwt/sample/showcase/client/ContentWidget.java
@@ -1,12 +1,12 @@
 /*
  * Copyright 2008 Google Inc.
- *
+ * 
  * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  * use this file except in compliance with the License. You may obtain a copy of
  * the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
@@ -26,9 +26,11 @@
 import com.google.gwt.http.client.RequestException;
 import com.google.gwt.http.client.Response;
 import com.google.gwt.i18n.client.LocaleInfo;
+import com.google.gwt.safehtml.shared.SafeHtml;
+import com.google.gwt.safehtml.shared.SafeHtmlUtils;
 import com.google.gwt.user.client.Window;
 import com.google.gwt.user.client.rpc.AsyncCallback;
-import com.google.gwt.user.client.ui.LazyPanel;
+import com.google.gwt.user.client.ui.SimpleLayoutPanel;
 import com.google.gwt.user.client.ui.Widget;
 
 import java.util.ArrayList;
@@ -48,12 +50,12 @@
  * and css tabs are loaded using an RPC call to the server.
  * </p>
  */
-public abstract class ContentWidget extends LazyPanel
-    implements HasValueChangeHandlers<String> {
+public abstract class ContentWidget extends SimpleLayoutPanel implements
+    HasValueChangeHandlers<String> {
 
   /**
    * Generic callback used for asynchronously loaded data.
-   *
+   * 
    * @param <T> the data type
    */
   public static interface Callback<T> {
@@ -64,7 +66,7 @@
 
   /**
    * Get the simple filename of a class.
-   *
+   * 
    * @param c the class
    */
   protected static String getSimpleName(Class<?> c) {
@@ -75,7 +77,7 @@
   /**
    * A description of the example.
    */
-  private final String description;
+  private final SafeHtml description;
 
   /**
    * True if this example has associated styles, false if not.
@@ -125,13 +127,25 @@
 
   /**
    * Construct a {@link ContentWidget}.
-   *
-   * @param name the name of the example
-   * @param description a description of the example
+   * 
+   * @param name the text name of the example
+   * @param description a text description of the example
    * @param hasStyle true if the example has associated styles
    * @param rawSourceFiles the list of raw source files to include
    */
-  public ContentWidget(String name, String description, boolean hasStyle,
+  public ContentWidget(String name, String description, boolean hasStyle, String... rawSourceFiles) {
+    this(name, SafeHtmlUtils.fromString(description), hasStyle, rawSourceFiles);
+  }
+
+  /**
+   * Construct a {@link ContentWidget}.
+   * 
+   * @param name the text name of the example
+   * @param description a safe html description of the example
+   * @param hasStyle true if the example has associated styles
+   * @param rawSourceFiles the list of raw source files to include
+   */
+  public ContentWidget(String name, SafeHtml description, boolean hasStyle,
       String... rawSourceFiles) {
     this.name = name;
     this.description = description;
@@ -143,29 +157,22 @@
     }
   }
 
-  public HandlerRegistration addValueChangeHandler(
-      ValueChangeHandler<String> handler) {
+  public HandlerRegistration addValueChangeHandler(ValueChangeHandler<String> handler) {
     return addHandler(handler, ValueChangeEvent.getType());
   }
 
-  @Override
-  public void ensureWidget() {
-    super.ensureWidget();
-    ensureWidgetInitialized();
-  }
-
   /**
    * Get the description of this example.
-   *
+   * 
    * @return a description for this example
    */
-  public final String getDescription() {
+  public final SafeHtml getDescription() {
     return description;
   }
 
   /**
    * Get the name of this example to use as a title.
-   *
+   * 
    * @return a name for this example
    */
   public final String getName() {
@@ -174,12 +181,11 @@
 
   /**
    * Get the source code for a raw file.
-   *
+   * 
    * @param filename the filename to load
    * @param callback the callback to call when loaded
    */
-  public void getRawSource(
-      final String filename, final Callback<String> callback) {
+  public void getRawSource(final String filename, final Callback<String> callback) {
     if (rawSource.containsKey(filename)) {
       callback.onSuccess(rawSource.get(filename));
     } else {
@@ -197,14 +203,13 @@
 
       String className = this.getClass().getName();
       className = className.substring(className.lastIndexOf(".") + 1);
-      sendSourceRequest(
-          rc, ShowcaseConstants.DST_SOURCE_RAW + filename + ".html");
+      sendSourceRequest(rc, ShowcaseConstants.DST_SOURCE_RAW + filename + ".html");
     }
   }
 
   /**
    * Get the filenames of the raw source files.
-   *
+   * 
    * @return the raw source files.
    */
   public List<String> getRawSourceFilenames() {
@@ -213,7 +218,7 @@
 
   /**
    * Request the styles associated with the widget.
-   *
+   * 
    * @param callback the callback used when the styles become available
    */
   public void getStyle(final Callback<String> callback) {
@@ -243,7 +248,7 @@
 
   /**
    * Request the source code associated with the widget.
-   *
+   * 
    * @param callback the callback used when the source become available
    */
   public void getSource(final Callback<String> callback) {
@@ -263,8 +268,7 @@
 
       String className = this.getClass().getName();
       className = className.substring(className.lastIndexOf(".") + 1);
-      sendSourceRequest(
-          rc, ShowcaseConstants.DST_SOURCE_EXAMPLE + className + ".html");
+      sendSourceRequest(rc, ShowcaseConstants.DST_SOURCE_EXAMPLE + className + ".html");
     }
   }
 
@@ -278,8 +282,17 @@
   }
 
   /**
+   * Check if the widget should be wrapped in a scrollable div.
+   * 
+   * @return true to use add scrollbars, false not to
+   */
+  public boolean hasScrollableContent() {
+    return true;
+  }
+
+  /**
    * Returns true if this widget has a style section.
-   *
+   * 
    * @return true if style tab available
    */
   public final boolean hasStyle() {
@@ -290,7 +303,7 @@
    * When the widget is first initialized, this method is called. If it returns
    * a Widget, the widget will be added as the first tab. Return null to disable
    * the first tab.
-   *
+   * 
    * @return the widget to add to the first tab
    */
   public abstract Widget onInitialize();
@@ -302,38 +315,32 @@
   public void onInitializeComplete() {
   }
 
-  protected abstract void asyncOnInitialize(
-      final AsyncCallback<Widget> callback);
-
-  /**
-   * Initialize this widget by creating the elements that should be added to the
-   * page.
-   */
-  @Override
-  protected final Widget createWidget() {
-    view = new ContentWidgetView(hasMargins());
-    view.setName(getName());
-    view.setDescription(getDescription());
-    return view;
-  }
+  protected abstract void asyncOnInitialize(final AsyncCallback<Widget> callback);
 
   /**
    * Fire a {@link ValueChangeEvent} indicating that the user wishes to see the
    * specified source file.
-   *
+   * 
    * @param filename the filename that the user wishes to see
    */
   protected void fireRawSourceRequest(String filename) {
     if (!rawSourceFilenames.contains(filename)) {
-      throw new IllegalArgumentException(
-          "Filename is not registered with this example: " + filename);
+      throw new IllegalArgumentException("Filename is not registered with this example: "
+          + filename);
     }
     ValueChangeEvent.fire(this, filename);
   }
 
   @Override
   protected void onLoad() {
-    ensureWidget();
+    if (view == null) {
+      view = new ContentWidgetView(hasMargins(), hasScrollableContent());
+      view.setName(getName());
+      view.setDescription(getDescription());
+      setWidget(view);
+    }
+    ensureWidgetInitialized();
+    super.onLoad();
   }
 
   /**
@@ -350,8 +357,7 @@
     asyncOnInitialize(new AsyncCallback<Widget>() {
       public void onFailure(Throwable reason) {
         widgetInitializing = false;
-        Window.alert(
-            "Failed to download code for this widget (" + reason + ")");
+        Window.alert("Failed to download code for this widget (" + reason + ")");
       }
 
       public void onSuccess(Widget result) {
@@ -369,13 +375,12 @@
 
   /**
    * Send a request for source code.
-   *
+   * 
    * @param callback the {@link RequestCallback} to send
    * @param url the URL to target
    */
   private void sendSourceRequest(RequestCallback callback, String url) {
-    RequestBuilder builder = new RequestBuilder(
-        RequestBuilder.GET, GWT.getModuleBaseURL() + url);
+    RequestBuilder builder = new RequestBuilder(RequestBuilder.GET, GWT.getModuleBaseURL() + url);
     builder.setCallback(callback);
     try {
       builder.send();
diff --git a/samples/showcase/src/com/google/gwt/sample/showcase/client/ContentWidgetView.java b/samples/showcase/src/com/google/gwt/sample/showcase/client/ContentWidgetView.java
index d97a092..4797b6b 100644
--- a/samples/showcase/src/com/google/gwt/sample/showcase/client/ContentWidgetView.java
+++ b/samples/showcase/src/com/google/gwt/sample/showcase/client/ContentWidgetView.java
@@ -1,12 +1,12 @@
 /*
  * Copyright 2010 Google Inc.
- *
+ * 
  * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  * use this file except in compliance with the License. You may obtain a copy of
  * the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
@@ -18,47 +18,53 @@
 import com.google.gwt.core.client.GWT;
 import com.google.gwt.dom.client.Element;
 import com.google.gwt.dom.client.Style.Unit;
+import com.google.gwt.safehtml.shared.SafeHtml;
 import com.google.gwt.uibinder.client.UiBinder;
 import com.google.gwt.uibinder.client.UiField;
-import com.google.gwt.user.client.ui.Composite;
+import com.google.gwt.user.client.ui.ResizeComposite;
+import com.google.gwt.user.client.ui.ScrollPanel;
+import com.google.gwt.user.client.ui.SimpleLayoutPanel;
 import com.google.gwt.user.client.ui.SimplePanel;
 import com.google.gwt.user.client.ui.Widget;
 
 /**
  * A view of a {@link ContentWidget}.
  */
-public class ContentWidgetView extends Composite {
+public class ContentWidgetView extends ResizeComposite {
 
-  interface ContentWidgetViewUiBinder extends UiBinder<
-      Widget, ContentWidgetView> {
+  interface ContentWidgetViewUiBinder extends UiBinder<Widget, ContentWidgetView> {
   }
 
-  private static ContentWidgetViewUiBinder uiBinder = GWT.create(
-      ContentWidgetViewUiBinder.class);
+  private static ContentWidgetViewUiBinder uiBinder = GWT.create(ContentWidgetViewUiBinder.class);
 
   @UiField
   Element descElem;
 
-  @UiField
+  @UiField(provided = true)
   SimplePanel examplePanel;
 
   @UiField
   Element nameElem;
 
-  public ContentWidgetView(boolean hasMargins) {
+  private final boolean hasMargins;
+
+  public ContentWidgetView(boolean hasMargins, boolean scrollable) {
+    this.hasMargins = hasMargins;
+    examplePanel = scrollable ? new ScrollPanel() : new SimpleLayoutPanel();
+    examplePanel.setSize("100%", "100%");
     initWidget(uiBinder.createAndBindUi(this));
-    if (hasMargins) {
-      examplePanel.getElement().getStyle().setMarginLeft(10.0, Unit.PX);
-      examplePanel.getElement().getStyle().setMarginRight(10.0, Unit.PX);
-    }
   }
 
-  public void setDescription(String html) {
-    descElem.setInnerHTML(html);
+  public void setDescription(SafeHtml html) {
+    descElem.setInnerHTML(html.asString());
   }
 
   public void setExample(Widget widget) {
     examplePanel.setWidget(widget);
+    if (hasMargins) {
+      widget.getElement().getStyle().setMarginLeft(10.0, Unit.PX);
+      widget.getElement().getStyle().setMarginRight(10.0, Unit.PX);
+    }
   }
 
   public void setName(String text) {
diff --git a/samples/showcase/src/com/google/gwt/sample/showcase/client/ContentWidgetView.ui.xml b/samples/showcase/src/com/google/gwt/sample/showcase/client/ContentWidgetView.ui.xml
index 50c0594..23065c1 100644
--- a/samples/showcase/src/com/google/gwt/sample/showcase/client/ContentWidgetView.ui.xml
+++ b/samples/showcase/src/com/google/gwt/sample/showcase/client/ContentWidgetView.ui.xml
@@ -8,7 +8,7 @@
       color: #4B4A4A;
       font-size: 17pt;
       font-weight: bold;
-      margin: 0px 10px;
+      margin: 10px 10px 0px;
     }
     
     .description {
@@ -19,15 +19,20 @@
     }
   </ui:style>
 
-  <g:HTMLPanel>
-    <div
-      class='{style.name}'
-      ui:field='nameElem'>Name</div>
-    <div
-      class='{style.description}'
-      ui:field='descElem'>Description</div>
+  <g:HeaderPanel>
+    <!-- Header. -->
+    <g:HTMLPanel>
+      <div
+        class='{style.name}'
+        ui:field='nameElem'>Name</div>
+      <div
+        class='{style.description}'
+        ui:field='descElem'>Description</div>
+    </g:HTMLPanel>
+
+    <!-- Content. -->
     <g:SimplePanel
       ui:field='examplePanel' />
-  </g:HTMLPanel>
+  </g:HeaderPanel>
 
 </ui:UiBinder> 
\ No newline at end of file
diff --git a/samples/showcase/src/com/google/gwt/sample/showcase/client/ShowcaseShell.java b/samples/showcase/src/com/google/gwt/sample/showcase/client/ShowcaseShell.java
index b4cbed5..b1673b9 100644
--- a/samples/showcase/src/com/google/gwt/sample/showcase/client/ShowcaseShell.java
+++ b/samples/showcase/src/com/google/gwt/sample/showcase/client/ShowcaseShell.java
@@ -39,10 +39,11 @@
 import com.google.gwt.user.client.Window.Location;
 import com.google.gwt.user.client.ui.AbstractImagePrototype;
 import com.google.gwt.user.client.ui.Anchor;
-import com.google.gwt.user.client.ui.Composite;
 import com.google.gwt.user.client.ui.HTML;
 import com.google.gwt.user.client.ui.ListBox;
-import com.google.gwt.user.client.ui.SimplePanel;
+import com.google.gwt.user.client.ui.ResizeComposite;
+import com.google.gwt.user.client.ui.ScrollPanel;
+import com.google.gwt.user.client.ui.SimpleLayoutPanel;
 import com.google.gwt.user.client.ui.Widget;
 import com.google.gwt.view.client.TreeViewModel;
 
@@ -52,7 +53,7 @@
 /**
  * Application shell for Showcase sample.
  */
-public class ShowcaseShell extends Composite {
+public class ShowcaseShell extends ResizeComposite {
 
   interface ShowcaseShellUiBinder extends UiBinder<Widget, ShowcaseShell> {
   }
@@ -98,7 +99,7 @@
    * The panel that holds the content.
    */
   @UiField
-  SimplePanel contentPanel;
+  SimpleLayoutPanel contentPanel;
 
   /**
    * The container around the links at the top of the app.
@@ -188,8 +189,7 @@
     initWidget(uiBinder.createAndBindUi(this));
     initializeLocaleBox();
     contentSource.getElement().getStyle().setBackgroundColor("#eee");
-    contentSource.getElement().getStyle().setMarginLeft(10.0, Unit.PX);
-    contentSource.getElement().getStyle().setMarginRight(10.0, Unit.PX);
+    contentSource.getElement().getStyle().setMargin(10.0, Unit.PX);
     contentSource.getElement().getStyle().setProperty(
         "border", "1px solid #c3c3c3");
     contentSource.getElement().getStyle().setProperty("padding", "10px 2px");
@@ -393,7 +393,7 @@
     tabSource.getElement().getStyle().setColor(SELECTED_TAB_COLOR);
 
     contentSource.setHTML(loadingHtml, Direction.LTR);
-    contentPanel.setWidget(contentSource);
+    contentPanel.setWidget(new ScrollPanel(contentSource));
     if (!tabSourceList.isVisible() || tabSourceList.getSelectedIndex() == 0) {
       // If the source list isn't visible or the first item is selected, load
       // the source for the example.
@@ -420,7 +420,7 @@
     tabSource.getElement().getStyle().clearColor();
 
     contentSource.setHTML(loadingHtml, Direction.LTR);
-    contentPanel.setWidget(contentSource);
+    contentPanel.setWidget(new ScrollPanel(contentSource));
     content.getStyle(new CustomCallback());
   }
 }
diff --git a/samples/showcase/src/com/google/gwt/sample/showcase/client/ShowcaseShell.ui.xml b/samples/showcase/src/com/google/gwt/sample/showcase/client/ShowcaseShell.ui.xml
index 5cdc5ac..caf299f 100644
--- a/samples/showcase/src/com/google/gwt/sample/showcase/client/ShowcaseShell.ui.xml
+++ b/samples/showcase/src/com/google/gwt/sample/showcase/client/ShowcaseShell.ui.xml
@@ -107,10 +107,6 @@
       color: #4B4A4A;
       direction: ltr;
     }
-    
-    .contentPanel {
-      padding: 10px 0px;
-    }
   </ui:style>
 
   <g:DockLayoutPanel
@@ -264,8 +260,7 @@
             </g:north>
 
             <g:center>
-              <g:ScrollPanel
-                addStyleNames='{style.contentPanel}'
+              <g:SimpleLayoutPanel
                 ui:field='contentPanel' />
             </g:center>
           </g:DockLayoutPanel>
diff --git a/samples/showcase/src/com/google/gwt/sample/showcase/client/content/cell/ContactDatabase.java b/samples/showcase/src/com/google/gwt/sample/showcase/client/content/cell/ContactDatabase.java
index 0c06c4c..f375b9e 100644
--- a/samples/showcase/src/com/google/gwt/sample/showcase/client/content/cell/ContactDatabase.java
+++ b/samples/showcase/src/com/google/gwt/sample/showcase/client/content/cell/ContactDatabase.java
@@ -97,6 +97,20 @@
     }
 
     /**
+     * @return the contact's age
+     */
+    @SuppressWarnings("deprecation")
+    public int getAge() {
+      Date today = new Date();
+      int age = today.getYear() - birthday.getYear();
+      if (today.getMonth() > birthday.getMonth()
+          || (today.getMonth() == birthday.getMonth() && today.getDate() > birthday.getDate())) {
+        age--;
+      }
+      return age;
+    }
+
+    /**
      * @return the contact's birthday
      */
     public Date getBirthday() {
diff --git a/samples/showcase/src/com/google/gwt/sample/showcase/client/content/cell/CwCellSampler.java b/samples/showcase/src/com/google/gwt/sample/showcase/client/content/cell/CwCellSampler.java
index 3e37407..146ceae 100644
--- a/samples/showcase/src/com/google/gwt/sample/showcase/client/content/cell/CwCellSampler.java
+++ b/samples/showcase/src/com/google/gwt/sample/showcase/client/content/cell/CwCellSampler.java
@@ -228,8 +228,7 @@
    * The list of pending changes.
    */
   @ShowcaseData
-  private List<PendingChange<?>> pendingChanges = new ArrayList<
-      PendingChange<?>>();
+  private List<PendingChange<?>> pendingChanges = new ArrayList<PendingChange<?>>();
 
   /**
    * Constructor.
@@ -237,8 +236,8 @@
    * @param constants the constants
    */
   public CwCellSampler(CwConstants constants) {
-    super(constants.cwCellSamplerName(), constants.cwCellSamplerDescription(),
-        false, "ContactDatabase.java", "CwCellSampler.ui.xml");
+    super(constants.cwCellSamplerName(), constants.cwCellSamplerDescription(), false,
+        "ContactDatabase.java", "CwCellSampler.ui.xml");
   }
 
   /**
@@ -269,8 +268,7 @@
           pendingChanges.add(new CategoryChange(object, categories[0]));
         } else {
           // If not a relative, use the Contacts Category.
-          pendingChanges.add(new CategoryChange(object,
-              categories[categories.length - 1]));
+          pendingChanges.add(new CategoryChange(object, categories[categories.length - 1]));
         }
       }
     });
@@ -316,12 +314,11 @@
     });
 
     // ActionCell.
-    addColumn(new ActionCell<ContactInfo>("Click Me",
-        new ActionCell.Delegate<ContactInfo>() {
-          public void execute(ContactInfo contact) {
-            Window.alert("You clicked " + contact.getFullName());
-          }
-        }), "Action", new GetValue<ContactInfo>() {
+    addColumn(new ActionCell<ContactInfo>("Click Me", new ActionCell.Delegate<ContactInfo>() {
+      public void execute(ContactInfo contact) {
+        Window.alert("You clicked " + contact.getFullName());
+      }
+    }), "Action", new GetValue<ContactInfo>() {
       public ContactInfo getValue(ContactInfo contact) {
         return contact;
       }
@@ -347,41 +344,32 @@
     }, null);
 
     // DatePickerCell.
-    addColumn(new DatePickerCell(dateFormat), "DatePicker",
-        new GetValue<Date>() {
-          public Date getValue(ContactInfo contact) {
-            return contact.getBirthday();
-          }
-        }, new FieldUpdater<ContactInfo, Date>() {
-          public void update(int index, ContactInfo object, Date value) {
-            pendingChanges.add(new BirthdayChange(object, value));
-          }
-        });
+    addColumn(new DatePickerCell(dateFormat), "DatePicker", new GetValue<Date>() {
+      public Date getValue(ContactInfo contact) {
+        return contact.getBirthday();
+      }
+    }, new FieldUpdater<ContactInfo, Date>() {
+      public void update(int index, ContactInfo object, Date value) {
+        pendingChanges.add(new BirthdayChange(object, value));
+      }
+    });
 
     // NumberCell.
-    Column<ContactInfo, Number> numberColumn = addColumn(new NumberCell(),
-        "Number", new GetValue<Number>() {
-          @SuppressWarnings("deprecation")
+    Column<ContactInfo, Number> numberColumn =
+        addColumn(new NumberCell(), "Number", new GetValue<Number>() {
           public Number getValue(ContactInfo contact) {
-            Date today = new Date();
-            Date birthday = contact.getBirthday();
-            int age = today.getYear() - birthday.getYear();
-            if (today.getMonth() > birthday.getMonth()
-                || (today.getMonth() == birthday.getMonth() && today.getDate() > birthday.getDate())) {
-              age--;
-            }
-            return age;
+            return contact.getAge();
           }
         }, null);
     numberColumn.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LOCALE_END);
 
     // IconCellDecorator.
-    addColumn(new IconCellDecorator<String>(images.contactsGroup(),
-        new TextCell()), "Icon", new GetValue<String>() {
-      public String getValue(ContactInfo contact) {
-        return contact.getCategory().getDisplayName();
-      }
-    }, null);
+    addColumn(new IconCellDecorator<String>(images.contactsGroup(), new TextCell()), "Icon",
+        new GetValue<String>() {
+          public String getValue(ContactInfo contact) {
+            return contact.getCategory().getDisplayName();
+          }
+        }, null);
 
     // ImageCell.
     addColumn(new ImageCell(), "Image", new GetValue<String>() {
diff --git a/samples/showcase/src/com/google/gwt/sample/showcase/client/content/cell/ShowMorePagerPanel.java b/samples/showcase/src/com/google/gwt/sample/showcase/client/content/cell/ShowMorePagerPanel.java
index dedeed3..f147662 100644
--- a/samples/showcase/src/com/google/gwt/sample/showcase/client/content/cell/ShowMorePagerPanel.java
+++ b/samples/showcase/src/com/google/gwt/sample/showcase/client/content/cell/ShowMorePagerPanel.java
@@ -62,7 +62,7 @@
       public void onScroll(ScrollEvent event) {
         // If scrolling up, ignore the event.
         int oldScrollPos = lastScrollPos;
-        lastScrollPos = scrollable.getScrollPosition();
+        lastScrollPos = scrollable.getVerticalScrollPosition();
         if (oldScrollPos >= lastScrollPos) {
           return;
         }
diff --git a/samples/showcase/src/com/google/gwt/sample/showcase/client/content/other/CwCookies.java b/samples/showcase/src/com/google/gwt/sample/showcase/client/content/other/CwCookies.java
index c8af546..c432c6a 100644
--- a/samples/showcase/src/com/google/gwt/sample/showcase/client/content/other/CwCookies.java
+++ b/samples/showcase/src/com/google/gwt/sample/showcase/client/content/other/CwCookies.java
@@ -17,6 +17,8 @@
 
 import com.google.gwt.core.client.GWT;
 import com.google.gwt.core.client.RunAsyncCallback;
+import com.google.gwt.core.client.Scheduler;
+import com.google.gwt.core.client.Scheduler.ScheduledCommand;
 import com.google.gwt.event.dom.client.ChangeEvent;
 import com.google.gwt.event.dom.client.ChangeHandler;
 import com.google.gwt.event.dom.client.ClickEvent;
@@ -25,9 +27,7 @@
 import com.google.gwt.sample.showcase.client.ContentWidget;
 import com.google.gwt.sample.showcase.client.ShowcaseAnnotations.ShowcaseData;
 import com.google.gwt.sample.showcase.client.ShowcaseAnnotations.ShowcaseSource;
-import com.google.gwt.user.client.Command;
 import com.google.gwt.user.client.Cookies;
-import com.google.gwt.user.client.DeferredCommand;
 import com.google.gwt.user.client.Window;
 import com.google.gwt.user.client.rpc.AsyncCallback;
 import com.google.gwt.user.client.ui.Button;
@@ -215,10 +215,10 @@
       }
     }
 
-    // Select the index of the selectedCookie. Use a DeferredCommand to give
+    // Select the index of the selectedCookie. Use a ScheduledCommand to give
     // the options time to register in Opera.
     final int selectedIndexFinal = selectedIndex;
-    DeferredCommand.addCommand(new Command() {
+    Scheduler.get().scheduleDeferred(new ScheduledCommand() {
       public void execute() {
         // Select the default cookie
         if (selectedIndexFinal < existingCookiesBox.getItemCount()) {
diff --git a/samples/showcase/src/com/google/gwt/sample/showcase/client/content/panels/CwAbsolutePanel.java b/samples/showcase/src/com/google/gwt/sample/showcase/client/content/panels/CwAbsolutePanel.java
index 7167060..7de10ec 100644
--- a/samples/showcase/src/com/google/gwt/sample/showcase/client/content/panels/CwAbsolutePanel.java
+++ b/samples/showcase/src/com/google/gwt/sample/showcase/client/content/panels/CwAbsolutePanel.java
@@ -17,6 +17,8 @@
 
 import com.google.gwt.core.client.GWT;
 import com.google.gwt.core.client.RunAsyncCallback;
+import com.google.gwt.core.client.Scheduler;
+import com.google.gwt.core.client.Scheduler.ScheduledCommand;
 import com.google.gwt.event.dom.client.ChangeEvent;
 import com.google.gwt.event.dom.client.ChangeHandler;
 import com.google.gwt.event.dom.client.KeyUpEvent;
@@ -26,8 +28,6 @@
 import com.google.gwt.sample.showcase.client.Showcase;
 import com.google.gwt.sample.showcase.client.ShowcaseAnnotations.ShowcaseData;
 import com.google.gwt.sample.showcase.client.ShowcaseAnnotations.ShowcaseSource;
-import com.google.gwt.user.client.Command;
-import com.google.gwt.user.client.DeferredCommand;
 import com.google.gwt.user.client.rpc.AsyncCallback;
 import com.google.gwt.user.client.ui.AbsolutePanel;
 import com.google.gwt.user.client.ui.Button;
@@ -174,7 +174,7 @@
   @ShowcaseSource
   @Override
   public void onInitializeComplete() {
-    DeferredCommand.addCommand(new Command() {
+    Scheduler.get().scheduleDeferred(new ScheduledCommand() {
       public void execute() {
         updateSelectedItem();
       }
diff --git a/samples/showcase/src/com/google/gwt/sample/showcase/client/content/panels/CwDockPanel.java b/samples/showcase/src/com/google/gwt/sample/showcase/client/content/panels/CwDockPanel.java
index c8de116..7a04c18 100644
--- a/samples/showcase/src/com/google/gwt/sample/showcase/client/content/panels/CwDockPanel.java
+++ b/samples/showcase/src/com/google/gwt/sample/showcase/client/content/panels/CwDockPanel.java
@@ -31,7 +31,6 @@
 /**
  * Example file.
  */
-@SuppressWarnings("deprecation")
 @ShowcaseStyle(".cw-DockPanel")
 public class CwDockPanel extends ContentWidget {
   /**
diff --git a/samples/showcase/src/com/google/gwt/sample/showcase/client/content/panels/CwSplitLayoutPanel.java b/samples/showcase/src/com/google/gwt/sample/showcase/client/content/panels/CwSplitLayoutPanel.java
index f987740..c612e65 100644
--- a/samples/showcase/src/com/google/gwt/sample/showcase/client/content/panels/CwSplitLayoutPanel.java
+++ b/samples/showcase/src/com/google/gwt/sample/showcase/client/content/panels/CwSplitLayoutPanel.java
@@ -74,6 +74,16 @@
     this.constants = constants;
   }
 
+  @Override
+  public boolean hasMargins() {
+    return false;
+  }
+
+  @Override
+  public boolean hasScrollableContent() {
+    return false;
+  }
+
   /**
    * Initialize this example.
    */
@@ -83,7 +93,6 @@
     // Create a Split Panel
     SplitLayoutPanel splitPanel = new SplitLayoutPanel(5);
     splitPanel.ensureDebugId("cwSplitLayoutPanel");
-    splitPanel.setPixelSize(500, 400);
     splitPanel.getElement().getStyle()
         .setProperty("border", "3px solid #e7e7e7");
 
diff --git a/samples/showcase/src/com/google/gwt/sample/showcase/client/content/panels/CwTabLayoutPanel.java b/samples/showcase/src/com/google/gwt/sample/showcase/client/content/panels/CwTabLayoutPanel.java
index 00b44cb..b1bb707 100644
--- a/samples/showcase/src/com/google/gwt/sample/showcase/client/content/panels/CwTabLayoutPanel.java
+++ b/samples/showcase/src/com/google/gwt/sample/showcase/client/content/panels/CwTabLayoutPanel.java
@@ -27,7 +27,6 @@
 import com.google.gwt.user.client.rpc.AsyncCallback;
 import com.google.gwt.user.client.ui.HTML;
 import com.google.gwt.user.client.ui.Image;
-import com.google.gwt.user.client.ui.ResizeLayoutPanel;
 import com.google.gwt.user.client.ui.SimplePanel;
 import com.google.gwt.user.client.ui.TabLayoutPanel;
 import com.google.gwt.user.client.ui.Widget;
@@ -36,8 +35,8 @@
  * Example file.
  */
 @ShowcaseStyle({
-    ".gwt-DecoratedTabBar", "html>body .gwt-DecoratedTabBar",
-    "* html .gwt-DecoratedTabBar", ".gwt-TabPanel"})
+    ".gwt-DecoratedTabBar", "html>body .gwt-DecoratedTabBar", "* html .gwt-DecoratedTabBar",
+    ".gwt-TabPanel"})
 public class CwTabLayoutPanel extends ContentWidget {
   /**
    * The constants used in this Content Widget.
@@ -71,6 +70,11 @@
     this.constants = constants;
   }
 
+  @Override
+  public boolean hasScrollableContent() {
+    return false;
+  }
+
   /**
    * Initialize this example.
    */
@@ -80,6 +84,7 @@
     // Create a tab panel
     TabLayoutPanel tabPanel = new TabLayoutPanel(2.5, Unit.EM);
     tabPanel.setAnimationDuration(1000);
+    tabPanel.getElement().getStyle().setMarginBottom(10.0, Unit.PX);
 
     // Add a home tab
     String[] tabTitles = constants.cwTabPanelTabs();
@@ -98,11 +103,8 @@
     // Return the content
     tabPanel.selectTab(0);
     tabPanel.ensureDebugId("cwTabPanel");
-    
-    ResizeLayoutPanel resizePanel = new ResizeLayoutPanel();
-    resizePanel.setPixelSize(600, 400);
-    resizePanel.setWidget(tabPanel);
-    return resizePanel;
+
+    return tabPanel;
   }
 
   @Override