docs: private CmsTreeItem buildItem(
          final CmsPublishResource resourceBean,
          CmsPublishItemStatus status,
          boolean isSubItem) {
  
          CmsListItemWidget itemWidget = createListItemWidget(resourceBean, DEFAULT_SLOT_MAPPING);
          if ((m_editorHandler != null) && resourceBean.getPermissionInfo().hasWritePermission()) {
              CmsPushButton editButton = new CmsPushButton();
              editButton.setImageClass(I_CmsButton.PEN_SMALL);
              editButton.setButtonStyle(ButtonStyle.FONT_ICON, null);
              editButton.setTitle(
                  org.opencms.gwt.client.Messages.get().key(org.opencms.gwt.client.Messages.GUI_BUTTON_ELEMENT_EDIT_0));
              editButton.addClickHandler(new ClickHandler() {
  
                  public void onClick(ClickEvent event) {
  
                      CmsPushButton button = (CmsPushButton)event.getSource();
                      button.clearHoverState();
                      CmsEditableData editableData = new CmsEditableData();
                      editableData.setStructureId(resourceBean.getId());
                      CmsContentEditorDialog.get().openEditDialog(
                          editableData,
                          false,
                          null,
                          new DialogOptions(),
                          m_editorHandler);
                  }
              });
              if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(resourceBean.getPermissionInfo().getNoEditReason())) {
                  editButton.disable(resourceBean.getPermissionInfo().getNoEditReason());
              }
              fillButtonSlot(itemWidget, SLOT_EDIT, editButton, DEFAULT_SLOT_MAPPING);
          }
          if (resourceBean.getPermissionInfo().hasViewPermission()) {
              CmsContextMenuButton button = new CmsContextMenuButton(
                  resourceBean.getId(),
                  m_contextMenuHandler,
                  AdeContext.publish);
              fillButtonSlot(itemWidget, SLOT_MENU, button, DEFAULT_SLOT_MAPPING);
          }
          resourceBean.getId();
          final CmsStyleVariable styleVar = new CmsStyleVariable(itemWidget);
          styleVar.setValue(CSS.itemToKeep());
  
          final CmsCheckBox checkbox = new CmsCheckBox();
          CmsTreeItem row;
          row = new CmsTreeItem(true, checkbox, itemWidget);
          if (isSubItem) {
              checkbox.getElement().getStyle().setVisibility(Visibility.HIDDEN);
          }
  
          row.setOpen(false);
          row.addStyleName(CSS.publishRow());
  
          // we do not need most of the interactive elements for the sub-items
          if (!isSubItem) {
              ClickHandler checkboxHandler = new ClickHandler() {
  
                  /**
                   * @see com.google.gwt.event.dom.client.ClickHandler#onClick(com.google.gwt.event.dom.client.ClickEvent)
                   */
                  public void onClick(ClickEvent event) {
  
                      boolean checked = checkbox.isChecked();
                      m_model.signal(checked ? Signal.publish : Signal.unpublish, resourceBean.getId());
                  }
              };
              checkbox.addClickHandler(checkboxHandler);
  
              final boolean hasProblem = CmsPublishDataModel.hasProblems(resourceBean);
              if (hasProblem) {
                  // can't select resource with problems
                  checkbox.setChecked(false);
                  checkbox.setEnabled(false);
              }
  
              final CmsCheckBox remover = new CmsCheckBox();
              final CmsPublishItemSelectionController controller = new CmsPublishItemSelectionController(
                  resourceBean.getId(),
                  checkbox,
                  remover,
                  styleVar,
                  hasProblem);
              m_controllersById.put(resourceBean.getId(), controller);
  
              remover.setTitle(Messages.get().key(Messages.GUI_PUBLISH_REMOVE_BUTTON_0));
              remover.addClickHandler(new ClickHandler() {
  
                  /**
                   * @see com.google.gwt.event.dom.client.ClickHandler#onClick(com.google.gwt.event.dom.client.ClickEvent)
                   */
                  public void onClick(ClickEvent e) {
  
                      boolean remove = remover.isChecked();
                      m_model.signal(remove ? Signal.remove : Signal.unremove, resourceBean.getId());
                  }
              });
              if (resourceBean.isRemovable()) {
                  fillButtonSlot(itemWidget, SLOT_REMOVE, remover, DEFAULT_SLOT_MAPPING);
              }
              controller.update(status);
          }
          return row;
      }