code: public static I_CmsFormatterBean ensureValidFormatterSettings(
          CmsObject cms,
          CmsContainerElementBean element,
          CmsADEConfigData adeConfig,
          String containerName,
          String containerType,
          int containerWidth) {
  
          I_CmsFormatterBean formatterBean = getFormatterConfigurationForElement(
              cms,
              element,
              adeConfig,
              containerName,
              containerType,
              containerWidth);
          String settingsKey = CmsFormatterConfig.getSettingsKeyForContainer(containerName);
          if (formatterBean != null) {
              String formatterConfigId = formatterBean.getId();
              if (formatterConfigId == null) {
                  formatterConfigId = CmsFormatterConfig.SCHEMA_FORMATTER_ID
                      + formatterBean.getJspStructureId().toString();
              }
              element.getSettings().put(settingsKey, formatterConfigId);
              element.setFormatterId(formatterBean.getJspStructureId());
          }
          return formatterBean;
      }
docs: Ensures the appropriate formatter configuration ID is set in the element settings.<p>
  
  @param cms the cms context
  @param element the element bean
  @param adeConfig the ADE configuration data
  @param containerName the container name
  @param containerType the container type
  @param containerWidth the container width
  
  @return the formatter configuration bean, may be <code>null</code> if no formatter available or a schema formatter is used