/**
   * The constants used in this Content Widget.
   */
  public static interface CwConstants extends Constants,
      ContentWidget.CwConstants {
    String cwBasicPopupClickOutsideInstructions();

    String cwBasicPopupDescription();

    String cwBasicPopupInstructions();

    String cwBasicPopupName();

    String cwBasicPopupShowButton();
  }

  /**
   * An instance of the constants.
   */
  private CwConstants constants;

  /**
   * Initialize this example.
   */
  @Override
  public Widget onInitialize() {
    // Create a basic popup widget
    final DecoratedPopupPanel simplePopup = new DecoratedPopupPanel(true);
    simplePopup.ensureDebugId("cwBasicPopup-simplePopup");
    simplePopup.setWidth("150px");
    simplePopup.setWidget(new HTML(
        constants.cwBasicPopupClickOutsideInstructions()));

    // Create a button to show the popup
    Button openButton = new Button(constants.cwBasicPopupShowButton(),
        new ClickListener() {
          public void onClick(Widget sender) {
            // Reposition the popup relative to the button
            int left = sender.getAbsoluteLeft() + 10;
            int top = sender.getAbsoluteTop() + 10;
            simplePopup.setPopupPosition(left, top);

            // Show the popup
            simplePopup.show();
          }
        });

    // Create a popup to show the full size image
    Image jimmyFull = Showcase.images.jimmy().createImage();
    final PopupPanel imagePopup = new PopupPanel(true);
    imagePopup.setAnimationEnabled(true);
    imagePopup.ensureDebugId("cwBasicPopup-imagePopup");
    imagePopup.setWidget(jimmyFull);
    jimmyFull.addClickListener(new ClickListener() {
      public void onClick(Widget sender) {
        imagePopup.hide();
      }
    });

    // Add an image thumbnail
    Image jimmyThumb = Showcase.images.jimmyThumb().createImage();
    jimmyThumb.ensureDebugId("cwBasicPopup-thumb");
    jimmyThumb.addStyleName("cw-BasicPopup-thumb");
    jimmyThumb.addClickListener(new ClickListener() {
      public void onClick(Widget sender) {
        imagePopup.center();
      }
    });

    // Add the widgets to a panel
    VerticalPanel vPanel = new VerticalPanel();
    vPanel.setSpacing(5);
    vPanel.add(openButton);
    vPanel.add(new HTML("<br><br><br>" + constants.cwBasicPopupInstructions()));
    vPanel.add(jimmyThumb);

    // Return the panel
    return vPanel;
  }