code: public void addDialogClose(final Command cmd) {
  
          m_closeCommand = cmd;
          if (m_close == null) {
              m_close = new CloseButton();
              m_close.setTitle(Messages.get().key(Messages.GUI_CLOSE_0));
              m_close.addStyleName(I_CmsLayoutBundle.INSTANCE.dialogCss().closePopup());
              m_close.setImageClass(I_CmsLayoutBundle.INSTANCE.dialogCss().closePopupImage());
              m_close.setButtonStyle(ButtonStyle.TRANSPARENT, null);
              m_close.addClickHandler(new ClickHandler() {
  
                  /**
                   * @see com.google.gwt.event.dom.client.ClickHandler#onClick(com.google.gwt.event.dom.client.ClickEvent)
                   */
                  public void onClick(ClickEvent event) {
  
                      boolean cancelled = false;
                      try {
                          if (m_closeCommand != null) {
                              m_closeCommand.execute();
                          }
                      } catch (CmsCancelCloseException e) {
                          cancelled = true;
                      } finally {
                          if (!cancelled) {
                              hide();
                          }
                      }
                  }
              });
              DOM.appendChild(m_containerElement, m_close.getElement());
              adopt(m_close);
          }
  
      }
docs: Adds a close "button" to the top of the popup.<p>
  
  @param cmd the command that should be executed when the close button is clicked