add: case "cmd_selectAll": self.selectAll(); break; 
context: function TreeView(editor, document, tree) {	this.log = new Log("TreeView");	this.editor = editor;	tree.view = this;	this.tree = tree;	this.document = document;	this.rowCount = 0;	this.recordIndex = 0;	this.undoStack = [];	this.redoStack = [];	var self = this;	var controller = {		supportsCommand : function(cmd) {			switch (cmd) {			case "cmd_delete":			case "cmd_copy":			case "cmd_cut":			case "cmd_paste":			case "cmd_selectAll":			case "cmd_undo":			case "cmd_redo":			case "cmd_selenium_startpoint":			case "cmd_selenium_breakpoint":			case "cmd_selenium_exec_command":				return true;			default:				return false;			}		},		isCommandEnabled : function(cmd){			switch (cmd) {			case "cmd_delete":			case "cmd_copy":			case "cmd_cut":			    return self.selection.getRangeCount() > 0;			case "cmd_paste":			    return self.clipboard != null;			case "cmd_undo":			    return self.undoStack.length > 0;			case "cmd_redo":			    return self.redoStack.length > 0;			case "cmd_selenium_startpoint":			    return self.selection.getRangeCount() > 0;			case "cmd_selenium_breakpoint":			    return self.selection.getRangeCount() > 0;			case "cmd_selenium_exec_command":			    return self.selection.getRangeCount() > 0;			default:				return false;			}		},		doCommand : function(cmd) {			switch (cmd) {			case "cmd_delete": self.deleteSelected(); break;			case "cmd_copy": self.copy(); break;			case "cmd_cut": self.cut(); break;			case "cmd_paste": self.paste(); break;			case "cmd_undo": self.undo(); break;			case "cmd_redo": self.redo(); break;			case "cmd_selenium_breakpoint": self.setBreakpoint(); break;			case "cmd_selenium_startpoint": self.setStartPoint(); break;			case "cmd_selenium_exec_command": self.executeCurrentCommand(); break;			}		},		onEvent : function(evt) {}	};	this.tree.controllers.appendController(controller);	this.atomService = Components.classes["@mozilla.org/atom-service;1"].		getService(Components.interfaces.nsIAtomService);	var clipboard = Components.classes["@mozilla.org/widget/clipboard;1"].		getService(Components.interfaces.nsIClipboard);	function createTransferable() {		return Components.classes["@mozilla.org/widget/transferable;1"].			createInstance(Components.interfaces.nsITransferable);	}	function createClipboardString() {		return Components.classes["@mozilla.org/supports-string;1"].            createInstance(Components.interfaces.nsISupportsString);	}	this.putCommandsToClipboard = function(commands) {		var trans = createTransferable();		var str = createClipboardString();		trans.addDataFlavor("text/unicode");		var text = this.editor.clipboardFormat.getSourceForCommands(commands);		str.data = text;		trans.setTransferData("text/unicode", str, text.length * 2);		clipboard.setData(trans, null, Components.interfaces.nsIClipboard.kGlobalClipboard);		this.clipboard = commands;		window.updateCommands('clipboard');	};	this.getCommandsFromClipboard = function() {		// not reading from a real clipboard...		return this.clipboard;	};	this.setTextBox = function(id,value,disabled) {		this.document.getElementById(id).value = value;		this.document.getElementById(id).disabled = disabled;	};	this.getCommand = function(row) {		if (row < this.testCase.commands.length) {			return this.testCase.commands[row];		} else {			return this.newCommand;		}	};	function loadSeleniumCommands() {		var commands = [];				var nonWaitActions = ['open', 'selectWindow', 'chooseCancelOnNextConfirmation', 'answerOnNextPrompt', 'close', 'setContext', 'setTimeout', 'selectFrame'];				for (func in this.editor.seleniumAPI.Selenium.prototype) {			//this.log.debug("func=" + func);			var r;			if (func.match(/^do[A-Z]/)) {				var action = func.substr(2,1).toLowerCase() + func.substr(3);				commands.push(action);				if (!action.match(/^waitFor/) && nonWaitActions.indexOf(action) < 0) {					commands.push(action + "AndWait");				}			} else if (func.match(/^assert.+/)) {				commands.push(func);				commands.push("verify" + func.substr(6));			} else if ((r = func.match(/^(get|is)(.+)$/))) {				var base = r[2];				commands.push("assert" + base);				commands.push("verify" + base);				commands.push("store" + base);				commands.push("waitFor" + base);				var r2;				if ((r = func.match(/^is(.*)Present$/))) {					base = r[1];					commands.push("assert" + base + "NotPresent");					commands.push("verify" + base + "NotPresent");					commands.push("waitFor" + base + "NotPresent");				} else {					commands.push("assertNot" + base);					commands.push("verifyNot" + base);					commands.push("waitForNot" + base);				}			}		}		commands.push("pause");		commands.sort();		var array = Components.classes["@mozilla.org/supports-array;1"].createInstance(Components.interfaces.nsISupportsArray);		for (var i = 0; i < commands.length; i++) {			var string = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);			string.data = commands[i];			array.AppendElement(string);		}		var autocomplete = Components.classes["@mozilla.org/autocomplete/search;1?name=selenium-commands"].getService(Components.interfaces.nsISeleniumAutoCompleteSearch);		autocomplete.setSeleniumCommands(array);	}		loadSeleniumCommands();}
meta: 3428	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/3428/1ee8a00342be957ca46f219537d0eadcdf5cc26e/treeView.js/clean/src/content/treeView.js