docs: @UiHandler("m_selectButton")
      public void onSelectClick(ClickEvent event) {
  
          if (m_galleryMode == GalleryMode.editor) {
              // note: the select button isn't necessarily visible in editor mode (depending on the WYSIWYG editor), but
              // if it is, we want it to save the data and close the gallery dialog
              if (getHandler().setDataInEditor()) {
                  // do this after a delay, so we don't get ugly Javascript errors when the iframe is closed.
                  Timer timer = new Timer() {
  
                      @Override
                      public void run() {
  
                          CmsPreviewUtil.closeDialog();
                      }
  
                  };
                  timer.schedule(1);
              }
          } else {
              saveChanges(null);
              getHandler().selectResource();
          }
      }