code: public static VaadinConfirmDialog show(final UI ui,
              final String windowCaption, final String message,
              final String okCaption, final String cancelCaption, final Runnable r) {
          VaadinConfirmDialog d = getFactory().create(windowCaption, message,
                  okCaption, cancelCaption, null);
          d.show(ui, new Listener() {
              private static final long serialVersionUID = 1L;
  
              public void onClose(VaadinConfirmDialog dialog) {
                  if (dialog.isConfirmed()) {
                      r.run();
                  }
              }
          }, true);
          return d;
      }
docs: Shows a modal VaadinConfirmDialog in given window and executes Runnable if OK
  is chosen.
  
  @param ui
  Main level UI.
  @param windowCaption
  Caption for the confirmation dialog window.
  @param message
  Message to display as window content.
  @param okCaption
  Caption for the ok button.
  @param cancelCaption
  Caption for cancel button.
  @param r
  Runnable to be run if confirmed
  @return the VaadinConfirmDialog that was instantiated