docs: protected I_CmsContextMenuEntry createTemplateContextSelectionMenuEntry(CmsUUID structureId) {
  
          final CmsTemplateContextInfo info = m_controller.getData().getTemplateContextInfo();
          if ((info.getCookieName() != null) && info.shouldShowTemplateContextContextMenuEntry()) {
              CmsContextMenuEntry parentEntry = new CmsContextMenuEntry(this, structureId, new I_CmsContextMenuCommand() {
  
                  public void execute(
                      CmsUUID innerStructureId,
                      I_CmsContextMenuHandler handler,
                      CmsContextMenuEntryBean bean) {
  
                      // do nothing
                  }
  
                  public A_CmsContextMenuItem getItemWidget(
                      CmsUUID innerStructureId,
                      I_CmsContextMenuHandler handler,
                      CmsContextMenuEntryBean bean) {
  
                      return null;
                  }
  
                  public boolean hasItemWidget() {
  
                      return false;
                  }
  
              });
              CmsContextMenuEntryBean parentBean = new CmsContextMenuEntryBean();
  
              parentBean.setLabel(
                  org.opencms.gwt.client.Messages.get().key(
                      org.opencms.gwt.client.Messages.GUI_TEMPLATE_CONTEXT_PARENT_0));
              parentBean.setActive(true);
              parentBean.setVisible(true);
              parentEntry.setBean(parentBean);
  
              Map<String, String> contextNames = info.getContextLabels();
  
              List<I_CmsContextMenuEntry> templateContextEntries = new ArrayList<I_CmsContextMenuEntry>();
              for (Map.Entry<String, String> entry : contextNames.entrySet()) {
                  final String key = entry.getKey();
                  final String label = entry.getValue();
                  if (info.hasClientVariants(key)) {
                      CmsContextMenuEntry singleContextEntry = createRawMenuEntry(structureId, DO_NOTHING);
                      boolean showCheckbox = Objects.equal(info.getSelectedContext(), entry.getKey());
                      decorateMenuEntry(singleContextEntry, label, showCheckbox);
                      List<I_CmsContextMenuEntry> variantEntries = new ArrayList<I_CmsContextMenuEntry>();
                      CmsContextMenuEntry editVariantEntry = createMenuEntryForTemplateContext(
                          info.getCookieName(),
                          key,
                          org.opencms.ade.containerpage.client.Messages.get().key(
                              org.opencms.ade.containerpage.client.Messages.GUI_TEMPLATE_CONTEXT_NO_VARIANT_0),
                          false,
                          this,
                          structureId);
                      variantEntries.add(editVariantEntry);
                      Map<String, CmsClientVariantInfo> variants = info.getClientVariants(key);
                      for (CmsClientVariantInfo variant : variants.values()) {
                          CmsContextMenuEntry currentVariantEntry = createRawMenuEntry(
                              structureId,
                              new ClientVariantSelectAction(key, variant));
                          decorateMenuEntry(currentVariantEntry, variant.getNiceName(), false);
                          variantEntries.add(currentVariantEntry);
                      }
                      singleContextEntry.setSubMenu(variantEntries);
                      templateContextEntries.add(singleContextEntry);
  
                  } else {
  
                      CmsContextMenuEntry menuEntry = createMenuEntryForTemplateContext(
                          info.getCookieName(),
                          key,
                          label,
                          Objects.equal(key, info.getSelectedContext()),
                          this,
                          structureId);
                      templateContextEntries.add(menuEntry);
                  }
              }
              templateContextEntries.add(
                  createMenuEntryForTemplateContext(
                      info.getCookieName(),
                      null,
                      org.opencms.gwt.client.Messages.get().key(
                          org.opencms.gwt.client.Messages.GUI_TEMPLATE_CONTEXT_NONE_0),
                      Objects.equal(null, info.getSelectedContext()),
                      this,
                      structureId));
              parentEntry.setSubMenu(templateContextEntries);
  
              return parentEntry;
  
          } else {
              return null;
          }
      }