rem: gotoDirectory(sfile); 
context: function filepickerLoad() {  gFilePickerBundle = document.getElementById("bundle_filepicker");  textInput = document.getElementById("textInput");  okButton = document.getElementById("ok");  outlinerView = new nsFileView();  outlinerView.selectionCallback = onSelect;  if (window.arguments) {    var o = window.arguments[0];    retvals = o.retvals; /* set this to a global var so we can set return values */    const title = o.title;    filePickerMode = o.mode;    if (o.displayDirectory) {      const directory = o.displayDirectory.unicodePath;    }    const initialText = o.defaultString;    const filterTitles = o.filters.titles;    const filterTypes = o.filters.types;    const numFilters = filterTitles.length;    window.title = title;    if (initialText) {      textInput.value = initialText;    }  }  if ((filePickerMode == nsIFilePicker.modeOpen) ||      (filePickerMode == nsIFilePicker.modeSave)) {    window.setCursor("wait");    outlinerView.setFilter(filterTypes[0]);    window.setCursor("auto");    /* build filter popup */    var filterPopup = document.createElement("menupopup");    for (var i = 0; i < numFilters; i++) {      var menuItem = document.createElement("menuitem");      menuItem.setAttribute("label", filterTitles[i] + " (" + filterTypes[i] + ")");      menuItem.setAttribute("filters", filterTypes[i]);      filterPopup.appendChild(menuItem);    }    var filterMenuList = document.getElementById("filterMenuList");    filterMenuList.appendChild(filterPopup);    if (numFilters > 0)      filterMenuList.selectedIndex = 0;    var filterBox = document.getElementById("filterBox");    filterBox.removeAttribute("hidden");  } else if (filePickerMode == nsIFilePicker.modeGetFolder) {    outlinerView.showOnlyDirectories = true;  }  // start out with a filename sort  handleColumnClick("FilenameColumn");  try {    var buttonLabel;    switch (filePickerMode) {      case nsIFilePicker.modeOpen:        buttonLabel = gFilePickerBundle.getString("openButtonLabel");        break;      case nsIFilePicker.modeSave:        buttonLabel = gFilePickerBundle.getString("saveButtonLabel");        break;      case nsIFilePicker.modeGetFolder:        buttonLabel = gFilePickerBundle.getString("selectFolderButtonLabel");        break;    }    if (buttonLabel) {      okButton.setAttribute("label", buttonLabel);    }  } catch (exception) {    // keep it set to "OK"  }  // setup the dialogOverlay.xul button handlers  doSetOKCancel(onOK, onCancel);  // get the home dir  var dirServiceProvider = Components.classes[nsIDirectoryServiceProvider_CONTRACTID]                                     .getService(nsIDirectoryServiceProvider);  var persistent = new Object();  homeDir = dirServiceProvider.getFile("Home", persistent);  if (directory) {    sfile.initWithUnicodePath(directory);  }  if (!directory || !(sfile.exists() && sfile.isDirectory())) {    // Start in the user's home directory    sfile.initWithUnicodePath(homeDir.unicodePath);  }  retvals.buttonStatus = nsIFilePicker.returnCancel;  gotoDirectory(sfile);  var outliner = document.getElementById("directoryOutliner");  outliner.outlinerBoxObject.view = outlinerView;  doEnabling();  textInput.focus();}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/1f019c83662dd50c887f012592bbbd08f8ba38e5/filepicker.js/buggy/xpfe/components/filepicker/res/content/filepicker.js