code: public CmsXmlContent handleChange(
          final CmsObject cms,
          final CmsXmlContent content,
          final Locale locale,
          final Collection<String> changedPaths) {
  
          if ((changedPaths.size() != 1)
              && content.getValue(changedPaths.iterator().next(), locale).getTypeName().equals(
                  CmsXmlBooleanValue.TYPE_NAME)) {
              LOG.error(
                  Messages.get().container(
                      Messages.ERROR_CONFIGURATION_EDITOR_CHANGE_HANDLER_FORMATTER_SELECTION_1,
                      content.getContentDefinition().getSchemaLocation()));
              return content;
          }
  
          String removeAllPath = changedPaths.iterator().next();
          String removeAllStringValue = content.getStringValue(cms, removeAllPath, locale);
          boolean removeAll = Boolean.valueOf(removeAllStringValue).booleanValue();
          if (removeAll && content.hasValue(REMOVE_PATH, locale)) {
              content.removeValue(REMOVE_PATH, locale, 0);
          } else if (content.hasValue(ADD_PATH, locale)) {
              String rootPath = content.getFile().getRootPath();
              List<String> optionValues = CmsAddFormatterWidget.getSelectOptionValues(cms, rootPath, false);
              CmsXmlContentValueSequence addSequence = content.getValueSequence(ADD_PATH_SINGLE_NODE, locale);
              List<I_CmsXmlContentValue> values = addSequence.getValues();
              boolean removeMainAddNode = true;
              for (int i = values.size() - 1; i >= 0; i--) {
                  if (optionValues.contains(values.get(i).getStringValue(cms))) {
                      removeMainAddNode = false;
                  } else {
                      content.removeValue(ADD_PATH_SINGLE_NODE, locale, i);
                  }
              }
              if (removeMainAddNode) {
                  content.removeValue(ADD_PATH, locale, 0);
              }
          }
          return content;
      }
docs: Adjusts the added/removed formatters if "Remove all formatters" is checked/unchecked.
  
  @see org.opencms.xml.content.I_CmsXmlContentEditorChangeHandler#handleChange(org.opencms.file.CmsObject, org.opencms.xml.content.CmsXmlContent, java.util.Locale, java.util.Collection)