code: protected I_CmsFormatterBean getElementFormatter(CmsContainerElementBean element) {
  
          if (m_elementInstances == null) {
              initPageData();
          }
          I_CmsFormatterBean formatter = null;
          CmsContainerBean container = m_parentContainers.get(element.getInstanceId());
          if (container == null) {
              // use the current container
              container = getContainer();
          }
          if (container != null) {
              String containerName = container.getName();
              Map<String, String> settings = element.getSettings();
              if (settings != null) {
                  String formatterConfigId = settings.get(CmsFormatterConfig.getSettingsKeyForContainer(containerName));
                  if (CmsUUID.isValidUUID(formatterConfigId)) {
                      formatter = OpenCms.getADEManager().getCachedFormatters(false).getFormatters().get(
                          new CmsUUID(formatterConfigId));
                  }
              }
              if (formatter == null) {
                  try {
                      CmsResource resource = m_cms.readResource(m_cms.getRequestContext().getUri());
  
                      CmsADEConfigData config = OpenCms.getADEManager().lookupConfiguration(
                          m_cms,
                          resource.getRootPath());
                      CmsFormatterConfiguration formatters = config.getFormatters(m_cms, resource);
                      int width = -2;
                      try {
                          width = Integer.parseInt(container.getWidth());
                      } catch (Exception e) {
                          LOG.debug(e.getLocalizedMessage(), e);
                      }
                      formatter = formatters.getDefaultSchemaFormatter(container.getType(), width);
                  } catch (CmsException e1) {
                      if (LOG.isWarnEnabled()) {
                          LOG.warn(e1.getLocalizedMessage(), e1);
                      }
                  }
              }
          }
          return formatter;
      }
docs: Returns the formatter configuration to the given element.<p>
  
  @param element the element
  
  @return the formatter configuration