rem: var commonDialogs = Components.classes["@mozilla.org/appshell/commonDialogs;1"] .getService(Components.interfaces.nsICommonDialogs); commonDialogs.Alert(window, errorTitle, errorMessage); 
add: var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(Components.interfaces.nsIPromptService); promptService.Alert(window, errorTitle, errorMessage); 
context: function onOK(){  var ret = nsIFilePicker.returnCancel;  var isDir = false;  var isFile = false;  var input = textInput.value;  if (input[0] == '~') // XXX XP?    input  = homeDir.unicodePath + input.substring(1);  var file = sfile.clone().QueryInterface(nsILocalFile);  if (!file)    return false;  /* XXX we need an XP way to test for an absolute path! */  if (input[0] == '/')   /* an absolute path was entered */    file.initWithUnicodePath(input);  else {    try {      file.appendRelativeUnicodePath(input);    } catch (e) {      dump("Can't append relative path '"+input+"':\n");      return false;    }  }  if (!file.exists() && (filePickerMode != nsIFilePicker.modeSave)) {    return false;  }  if (file.exists()) {    isDir = file.isDirectory();    isFile = file.isFile();  }  switch(filePickerMode) {  case nsIFilePicker.modeOpen:    if (isFile) {      retvals.directory = file.parent.unicodePath;      ret = nsIFilePicker.returnOK;    } else if (isDir) {      if (!sfile.equals(file)) {        gotoDirectory(file);      }      textInput.value = "";      doEnabling();      ret = nsIFilePicker.returnCancel;    }    break;  case nsIFilePicker.modeSave:    if (isFile) { // can only be true if file.exists()      // we need to pop up a dialog asking if you want to save      var message = gFilePickerBundle.getFormattedString("confirmFileReplacing",                                                         [file.unicodePath]);      var rv = window.confirm(message);      if (rv) {        ret = nsIFilePicker.returnReplace;        retvals.directory = file.parent.unicodePath;      } else {        ret = nsIFilePicker.returnCancel;      }    } else if (isDir) {      if (!sfile.equals(file)) {        gotoDirectory(file);      }      textInput.value = "";      doEnabling();      ret = nsIFilePicker.returnCancel;    } else {      var parent = file.parent;      if (parent.exists() && parent.isDirectory()) {        ret = nsIFilePicker.returnOK;        retvals.directory = parent.unicodePath;      } else {        var oldParent = parent;        while (!parent.exists()) {          oldParent = parent;          parent = parent.parent;        }        var errorTitle = gFilePickerBundle.getFormattedString("errorSavingFileTitle",                                                              [file.unicodePath]);        var errorMessage;        if (parent.isFile()) {          errorMessage = gFilePickerBundle.getFormattedString("saveParentIsFileMessage",                                                              [parent.unicodePath, file.unicodePath]);        } else {          errorMessage = gFilePickerBundle.getFormattedString("saveParentDoesntExistMessage",                                                              [oldParent.unicodePath, file.unicodePath]);        }        var commonDialogs = Components.classes["@mozilla.org/appshell/commonDialogs;1"]                                      .getService(Components.interfaces.nsICommonDialogs);        commonDialogs.Alert(window, errorTitle, errorMessage);        ret = nsIFilePicker.returnCancel;      }    }    break;  case nsIFilePicker.modeGetFolder:    if (isDir) {      retvals.directory = file.parent.unicodePath;    } else { // if nothing selected, the current directory will be fine      retvals.directory = sfile.unicodePath;    }    ret = nsIFilePicker.returnOK;    break;  }  retvals.file = file;  retvals.buttonStatus = ret;  if (ret == nsIFilePicker.returnCancel)    return false;  else    return true;}
meta: 8395	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/8395/d3733a74488d23b1c54ca4e48f0b8d8f459ca2e7/filepicker.js/clean/xpfe/components/filepicker/res/content/filepicker.js