code: public static void showAlert(String title, String message, final Runnable callback) {
  
          final Window window = new Window();
          window.setModal(true);
          Panel panel = new Panel();
          panel.setCaption(title);
          panel.setWidth("500px");
          VerticalLayout layout = new VerticalLayout();
          layout.setMargin(true);
          panel.setContent(layout);
          layout.addComponent(new Label(message));
          Button okButton = new Button();
          okButton.addClickListener(new ClickListener() {
  
              /** The serial version id. */
              private static final long serialVersionUID = 1L;
  
              public void buttonClick(ClickEvent event) {
  
                  window.close();
                  if (callback != null) {
                      callback.run();
                  }
              }
          });
          layout.addComponent(okButton);
          layout.setComponentAlignment(okButton, Alignment.BOTTOM_RIGHT);
          okButton.setCaption(
              org.opencms.workplace.Messages.get().getBundle(A_CmsUI.get().getLocale()).key(
                  org.opencms.workplace.Messages.GUI_DIALOG_BUTTON_OK_0));
          window.setContent(panel);
          window.setClosable(false);
          window.setResizable(false);
          A_CmsUI.get().addWindow(window);
  
      }
docs: Shows an alert box to the user with the given information, which will perform the given action after the user clicks on OK.<p>
  
  @param title the title
  @param message the message
  
  @param callback the callback to execute after clicking OK