docs: protected void openFileSelector() {
  
          try {
  
              final Window window = CmsBasicDialog.prepareWindow(DialogWidth.max);
              window.setCaption(m_fileSelectCaption != null ? m_fileSelectCaption : getWindowCaption());
              A_CmsUI.get().addWindow(window);
              CmsResourceSelectDialog fileSelect;
  
              //Switch if cms object was set.
              if (m_cms == null) {
                  fileSelect = new CmsResourceSelectDialog(m_filter, A_CmsUI.getCmsObject(), getOptions());
              } else {
                  fileSelect = new CmsResourceSelectDialog(m_filter, m_cms, getOptions());
              }
              if (m_diableSiteSwitch) {
                  fileSelect.disableSiteSwitch();
              }
              fileSelect.showSitemapView(m_startWithSitemapView);
  
              T value = getValue();
              if (value instanceof CmsResource) {
                  fileSelect.showStartResource((CmsResource)value);
              } else if (value instanceof String) {
                  if (CmsStringUtil.isEmptyOrWhitespaceOnly((String)value)) {
                      fileSelect.openPath(m_defaultPath);
                  } else {
                      fileSelect.openPath((String)value);
                  }
              }
  
              window.setContent(fileSelect);
              fileSelect.addSelectionHandler(new I_CmsSelectionHandler<CmsResource>() {
  
                  public void onSelection(CmsResource selected) {
  
                      if (!resourceIsValid(selected)) {
                          return;
                      }
                      setResourceValue(selected);
                      window.close();
  
                  }
              });
          } catch (CmsException e) {
              LOG.error(e.getLocalizedMessage(), e);
              CmsErrorDialog.showErrorDialog(e);
          }
      }