code: public void setContentToDialog(String caption, Component component) {
  
          setContent(new Label());
          Window window = CmsBasicDialog.prepareWindow(DialogWidth.narrow);
          CmsBasicDialog dialog = new CmsBasicDialog();
          VerticalLayout result = new VerticalLayout();
          dialog.setContent(result);
          window.setContent(dialog);
          window.setCaption(caption);
          window.setClosable(false);
          addWindow(window);
          window.center();
          if (component instanceof I_CmsHasButtons) {
              I_CmsHasButtons hasButtons = (I_CmsHasButtons)component;
              for (Button button : hasButtons.getButtons()) {
                  dialog.addButton(button);
              }
  
          }
          result.addComponent(component);
  
      }
docs: Replaces the ui content with a single dialog.<p>
  
  TODO: In the future this should only handle window creation, refactor dialog contents to CmsBasicDialog
  
  @param caption the caption
  @param component the dialog content