docs: public String getSiteSelector(String htmlAttributes) {
  
          List<String> options = new ArrayList<String>();
          List<String> values = new ArrayList<String>();
          int selectedIndex = 0;
          String preSelection = getSettings().getTreeSite(getTreeType());
          if (preSelection == null) {
              if ("".equals(getCms().getRequestContext().getSiteRoot())) {
                  // we are in the root site, getCurrentSite(CmsObject) includes NOT the root site
                  preSelection = "";
              } else {
                  // get the site root of the current site
                  preSelection = OpenCms.getSiteManager().getCurrentSite(getCms()).getSiteRoot();
              }
              // set the tree site to avoid discrepancies between selector and tree
              getSettings().setTreeSite(getTreeType(), preSelection);
          }
  
          boolean includeRootSite = true;
          boolean showSiteUrls = false;
          if (TYPE_PAGELINK.equals(getTreeType())) {
              // in wysiwyg editor link dialog, don't show root site, but show site URLs
              includeRootSite = false;
              showSiteUrls = true;
          }
          List<CmsSite> sites = OpenCms.getSiteManager().getAvailableSites(
              getCms(),
              includeRootSite,
              true,
              getCms().getRequestContext().getOuFqn());
  
          Iterator<CmsSite> i = sites.iterator();
          int pos = 0;
          while (i.hasNext()) {
              CmsSite site = i.next();
              values.add(site.getSiteRoot());
              String curOption = substituteSiteTitle(site.getTitle());
              if (showSiteUrls && (site.getSiteMatcher() != null)) {
                  // show the site URL in editor link dialog tree
                  curOption = site.getUrl() + " (" + curOption + ")";
                  if (getCms().getRequestContext().getSiteRoot().equals(site.getSiteRoot())) {
                      // mark the current workplace site in selector
                      curOption = "*" + curOption;
                  }
              }
  
              if (site.getSiteRoot().equals(preSelection)) {
                  // this is the user's currently selected site
                  selectedIndex = pos;
              }
              options.add(curOption);
              pos++;
          }
  
          return buildSelect(htmlAttributes, options, values, selectedIndex);
      }