var controller = { supportsCommand : function(cmd) { switch (cmd) { case "cmd_delete": return true; default: return false; } }, isCommandEnabled : function(cmd){ switch (cmd) { case "cmd_delete": return self.selection.getRangeCount() > 0; default: return false; } }, doCommand : function(cmd) { switch (cmd) { case "cmd_delete": self.deleteSelected(); break; } }, onEvent : function(evt) {} }; tree.controllers.appendController(controller); 
        initialize: function(editor, tree) {            this.log = new Log("SuiteTreeView");            XulUtils.TreeViewHelper.prototype.initialize.call(this, tree);            this.editor = editor;            this.rowCount = 0;            this.currentTestCaseIndex = -1;            var self = this;            tree.addEventListener("dblclick", function(event) {                    var testCase = self.getSelectedTestCase();                    if (testCase) editor.app.showTestCaseFromSuite(testCase);                }, false);            editor.app.addObserver({                    _testCaseObserver: {                        modifiedStateUpdated: function() {                            self.treebox.invalidateRow(self.currentTestCaseIndex);                        }                    },                                        testCaseChanged: function(testCase) {                        testCase.addObserver(this._testCaseObserver);                        var tests = self.getTestSuite().tests;                        for (var i = 0; i < tests.length; i++) {                            if (tests[i].content == testCase) {                                self.currentTestCase = testCase;                                self.currentTestCaseIndex = i;                                self.rowUpdated(self.currentTestCaseIndex);                                self.log.debug("testCaseLoaded: i=" + i);                                break;                            }                        }                        //self.refresh();                    },                                            testCaseUnloaded: function(testCase) {                        testCase.removeObserver(this._testCaseObserver);                        var index = self.currentTestCaseIndex;                        self.currentTestCaseIndex = -1;                        if (index >= 0) {                            self.rowUpdated(index);                        }                    }                });        },
4983	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/4983/5908478fc709e7d8b99fa3bb296f1c514c2d3893/suiteTreeView.js/buggy/src/content/suiteTreeView.js