context: function appendFiltersForContentType(aFilePicker, aContentType, aFileExtension, aSaveMode){  var bundle = getStringBundle();  // The bundle name for saving only a specific content type.  var bundleName;  // The corresponding filter string for a specific content type.  var filterString;  // XXX all the cases that are handled explicitly here MUST be handled  // in GetSaveModeForContentType to return a non-fileonly filter.  switch (aContentType) {  case "text/html":    bundleName   = "WebPageHTMLOnlyFilter";    filterString = "*.htm; *.html";    break;  case "application/xhtml+xml":    bundleName   = "WebPageXHTMLOnlyFilter";    filterString = "*.xht; *.xhtml";    break;  case "text/xml":  case "application/xml":    bundleName   = "WebPageXMLOnlyFilter";    filterString = "*.xml";    break;  default:    if (aSaveMode != SAVEMODE_FILEONLY) {      throw "Invalid save mode for type '" + aContentType + "'";    }    var mimeInfo = getMIMEInfoForType(aContentType, aFileExtension);    if (mimeInfo) {            var extEnumerator = mimeInfo.getFileExtensions();      var extString = "";      while (extEnumerator.hasMore()) {        var extension = extEnumerator.getNext();        if (extString)          extString += "; ";    // If adding more than one extension,                                // separate by semi-colon        extString += "*." + extension;      }              if (extString) {        aFilePicker.appendFilter(mimeInfo.description, extString);      }    }    break;  }  if (aSaveMode & SAVEMODE_COMPLETE_DOM) {    aFilePicker.appendFilter(bundle.GetStringFromName("WebPageCompleteFilter"), filterString);    // We should always offer a choice to save document only if    // we allow saving as complete.    aFilePicker.appendFilter(bundle.GetStringFromName(bundleName), filterString);  }  if (aSaveMode & SAVEMODE_COMPLETE_TEXT) {    aFilePicker.appendFilters(Components.interfaces.nsIFilePicker.filterText);  }  // Always append the all files (*) filter  aFilePicker.appendFilters(Components.interfaces.nsIFilePicker.filterAll);} 
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/3fa118df400adb06b3dca6d0d4b5b4679bfc13f6/contentAreaUtils.js/buggy/suite/common/contentAreaUtils.js