context: function updateButtons(tree,serverId) {  var canCreate = true;  var canDuplicate = true;  var canDelete = true;  var canSetDefault = true;  //dump("updateButtons\n");  //dump("serverId = " + serverId + "\n");  var account = getAccountFromServerId(serverId);  //dump("account = " + account + "\n");  if (account) {    var server = account.incomingServer;    var type = server.type;    if (account.identities.Count() < 1)      canSetDefault = false;    //dump("servertype = " + type + "\n");    var protocolinfo = Components.classes["@mozilla.org/messenger/protocol/info;1?type=" + type].getService(Components.interfaces.nsIMsgProtocolInfo);    canDuplicate = protocolinfo.canDuplicate;    canDelete = protocolinfo.canDelete;    if (!canDelete) {      canDelete = server.canDelete;    }  }  else {    // HACK    // if account is null, we have either selected a SMTP server, or there is a problem    // either way, we don't want the user to be able to delete it or duplicate it    canSetDefault = false;    canDelete = (serverId == "http://home.netscape.com/NC-rdf#PageTitleFakeAccount");    canDuplicate = false;  }  if (tree.treeBoxObject.selection.count < 1)    canDuplicate = canSetDefault = canDelete = false;  // check for disabled preferences on the account buttons.    //  Not currently handled by WSM or the main loop yet since these buttons aren't  //  under the IFRAME  if (nsPrefBranch.prefIsLocked(addAccountButton.getAttribute("prefstring")))    canCreate = false;  //if (nsPrefBranch.prefIsLocked(duplicateButton.getAttribute("prefstring")))  //  canDuplicate = false;  if (nsPrefBranch.prefIsLocked(setDefaultButton.getAttribute("prefstring")))    canSetDefault = false;  if (nsPrefBranch.prefIsLocked(removeButton.getAttribute("prefstring")))    canDelete = false;  setEnabled(addAccountButton, canCreate);  setEnabled(duplicateButton, canDuplicate);  setEnabled(setDefaultButton, canSetDefault);  setEnabled(removeButton, canDelete);}
meta: 5872	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/5872/5b9ab3f0a4933f47f37d7aef4a0fa88f976350aa/AccountManager.js/buggy/mailnews/base/prefs/resources/content/AccountManager.js