rem: case "cmd_bm_expandfolder": 
context:   isCommandEnabled: function (aCommand, aSelection, aTarget)  {    var item0, type0, junk, parent0, ptype0;    var length = 0;    if (aSelection && aSelection.length != 0) {      length = aSelection.length;      item0 = aSelection.item[0].Value;      type0 = aSelection.type[0];      parent0 =  (aSelection.parent[0] != null) ? aSelection.parent[0] : BMSVC.getParent(aSelection.item[0]);      ptype0 = BookmarksUtils.resolveType(parent0);    }    var i;    switch(aCommand) {    case "cmd_undo":    case "cmd_bm_undo":      return BMSVC.transactionManager.numberOfUndoItems > 0;    case "cmd_redo":    case "cmd_bm_redo":      return BMSVC.transactionManager.numberOfRedoItems > 0;    case "cmd_paste":      if (ptype0 == "Livemark" || (aTarget && !BookmarksUtils.isValidTargetContainer(aTarget.parent)))        return false;      const kClipboardContractID = "@mozilla.org/widget/clipboard;1";      const kClipboardIID = Components.interfaces.nsIClipboard;      var clipboard = Components.classes[kClipboardContractID].getService(kClipboardIID);      const kSuppArrayContractID = "@mozilla.org/supports-array;1";      const kSuppArrayIID = Components.interfaces.nsISupportsArray;      var flavourArray = Components.classes[kSuppArrayContractID].createInstance(kSuppArrayIID);      const kSuppStringContractID = "@mozilla.org/supports-cstring;1";      const kSuppStringIID = Components.interfaces.nsISupportsCString;          var flavours = ["moz/bookmarkclipboarditem", "text/x-moz-url"];      for (i = 0; i < flavours.length; ++i) {        const kSuppString = Components.classes[kSuppStringContractID].createInstance(kSuppStringIID);        kSuppString.data = flavours[i];        flavourArray.AppendElement(kSuppString);      }      var hasFlavours = clipboard.hasDataMatchingFlavors(flavourArray, kClipboardIID.kGlobalClipboard);      return hasFlavours;    case "cmd_copy":      return length > 0;    case "cmd_cut":    case "cmd_delete":      return length > 0 && !aSelection.containsImmutable && ptype0 != "Livemark" && !aSelection.containsPTF;    case "cmd_selectAll":      return true;    case "cmd_bm_open":    case "cmd_bm_expandfolder":    case "cmd_bm_managefolder":      return length == 1;    case "cmd_bm_openinnewwindow":    case "cmd_bm_openinnewtab":      return true;    case "cmd_bm_openfolder":      for (i=0; i<length; ++i) {        if (aSelection.type[i] == "ImmutableBookmark" ||            aSelection.type[i] == "ImmutableFolder" ||            aSelection.type[i] == "Bookmark" ||            aSelection.type[i] == "BookmarkSeparator")          return false;        RDFC.Init(BMDS, aSelection.item[i]);        var children = RDFC.GetElements();        while (children.hasMoreElements()) {          var childType = BookmarksUtils.resolveType(children.getNext());          if (childType == "Bookmark" || childType == "LivemarkBookmark")            return true;        }      }      return false;    case "cmd_bm_import":    case "cmd_bm_export":      return true;    case "cmd_bm_newbookmark":    case "cmd_bm_newlivemark":    case "cmd_bm_newfolder":    case "cmd_bm_newseparator":      return (ptype0 != "Livemark" && ((type0 == "PersonalToolbarFolder") ||              (aTarget && BookmarksUtils.isValidTargetContainer(aTarget.parent))));    case "cmd_bm_properties":    case "cmd_bm_rename":      if (length != 1 ||          aSelection.item[0].Value == "NC:BookmarksRoot" ||          ptype0 == "Livemark")        return false;      return true;    case "cmd_bm_setpersonaltoolbarfolder":      if (length != 1 || type0 == "Livemark")        return false;      return item0 != BMSVC.getBookmarksToolbarFolder().Value &&              item0 != "NC:BookmarksRoot" && type0 == "Folder";    case "cmd_bm_movebookmark":      return length > 0 && !aSelection.containsImmutable && ptype0 != "Livemark";    case "cmd_bm_refreshlivemark":      for (i=0; i<length; ++i) {        if (aSelection.type[i] != "Livemark")          return false;      }      return length > 0;    case "cmd_bm_sortbyname":      if (length == 1 && (aSelection.type[0] == "Folder" ||                          aSelection.type[0] == "Bookmark" ||                          aSelection.type[0] == "PersonalToolbarFolder" ||                          aSelection.type[0] == "Livemark"))        return true;      return false;    default:      return false;    }  },
meta: 5872	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/5872/311b03921540640cab9afb78363bb614e7ea2e0b/bookmarks.js/clean/browser/components/bookmarks/content/bookmarks.js