code: public static void insertEditEmpty(
          PageContext context,
          I_CmsXmlContentContainer container,
          CmsDirectEditMode mode,
          String id)
      throws CmsException, JspException {
  
          ServletRequest req = context.getRequest();
          if (isEditableRequest(req)
              && (container.getCollectorResult() != null)
              && (container.getCollectorResult().size() == 0)) {
              CmsFlexController controller = CmsFlexController.getController(req);
              CmsObject cms = controller.getCmsObject();
              // now collect the resources
              I_CmsResourceCollector collector = OpenCms.getResourceManager().getContentCollector(
                  container.getCollectorName());
              if (collector == null) {
                  throw new CmsException(
                      Messages.get().container(Messages.ERR_COLLECTOR_NOT_FOUND_1, container.getCollectorName()));
              }
              String createParam = collector.getCreateParam(
                  cms,
                  container.getCollectorName(),
                  container.getCollectorParam());
              String createLink = collector.getCreateLink(
                  cms,
                  container.getCollectorName(),
                  container.getCollectorParam());
              if ((createParam != null)
                  && (collector.getCreateTypeId(
                      cms,
                      container.getCollectorName(),
                      container.getCollectorParam()) != -1)) {
                  String createFolderName = CmsResource.getFolderPath(createLink);
                  createParam = CmsEncoder.encode(container.getCollectorName() + "|" + createParam);
                  CmsDirectEditParams params = new CmsDirectEditParams(
                      createFolderName,
                      CmsDirectEditButtonSelection.NEW,
                      mode,
                      createParam);
                  params.setId(id);
                  params.setCollectorName(container.getCollectorName());
                  params.setCollectorParams(container.getCollectorParam());
                  getDirectEditProvider(context).insertDirectEditEmptyList(context, params);
              }
          }
      }
docs: Inserts direct edit for empty collector lists.<p>
  
  @param context the current JSP page context
  @param container the parent content load container
  @param mode the direct edit mode to use (may be <code>null</code>, which means current use mode on page)
  @param id an id for the content info bean, if available
  
  @throws CmsException in case of invalid collector settings
  @throws JspException in case writing to page context fails