michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: result->treeviewer cycle. michael@0: // Note: unsetting the result's viewer also unsets michael@0: // the viewer's reference to our treeBoxObject. michael@0: var result = this.result; michael@0: if (result) { michael@0: result.root.containerOpen = false; michael@0: } michael@0: michael@0: // Unregister the controllber before unlinking the view, otherwise it michael@0: // may still try to update commands on a view with a null result. michael@0: if (this._controller) { michael@0: this._controller.terminate(); michael@0: this.controllers.removeController(this._controller); michael@0: } michael@0: michael@0: this.view = null; michael@0: ]]> michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: 0) { michael@0: treeView.selection.select(0); michael@0: } michael@0: michael@0: this._cachedInsertionPoint = undefined; michael@0: ]]> michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: = 0; --i) { michael@0: var index = view.treeIndexForNode(parents[i]); michael@0: if (index != Ci.nsINavHistoryResultTreeViewer.INDEX_INVISIBLE && michael@0: view.isContainer(index) && !view.isContainerOpen(index)) michael@0: view.toggleOpenState(index); michael@0: } michael@0: // Select the specified node... michael@0: } michael@0: michael@0: var index = view.treeIndexForNode(node); michael@0: if (index == Ci.nsINavHistoryResultTreeViewer.INDEX_INVISIBLE) michael@0: return; michael@0: michael@0: view.selection.select(index); michael@0: // ... and ensure it's visible, not scrolled off somewhere. michael@0: this.treeBoxObject.ensureRowIsVisible(index); michael@0: ]]> michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: = 1; michael@0: ]]> michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: 0; michael@0: child++) { michael@0: var childNode = node.getChild(child); michael@0: var found = findNodes(childNode); michael@0: if (!foundOne) michael@0: foundOne = found; michael@0: } michael@0: michael@0: // If we didn't find any additional matches in this node's michael@0: // subtree, revert the node to its previous openness. michael@0: if (foundOne) michael@0: nodesToOpen.unshift(node); michael@0: node.containerOpen = previousOpenness; michael@0: return foundOne; michael@0: } michael@0: michael@0: // Disable notifications while looking for nodes. michael@0: let result = this.result; michael@0: let didSuppressNotifications = result.suppressNotifications; michael@0: if (!didSuppressNotifications) michael@0: result.suppressNotifications = true michael@0: try { michael@0: findNodes(this.result.root); michael@0: } michael@0: finally { michael@0: if (!didSuppressNotifications) michael@0: result.suppressNotifications = false; michael@0: } michael@0: michael@0: // For all the nodes we've found, highlight the corresponding michael@0: // index in the tree. michael@0: var resultview = this.view; michael@0: var selection = this.view.selection; michael@0: selection.selectEventsSuppressed = true; michael@0: selection.clearSelection(); michael@0: // Open nodes containing found items michael@0: for (var i = 0; i < nodesToOpen.length; i++) { michael@0: nodesToOpen[i].containerOpen = true; michael@0: } michael@0: for (var i = 0; i < nodes.length; i++) { michael@0: var index = resultview.treeIndexForNode(nodes[i]); michael@0: if (index == Ci.nsINavHistoryResultTreeViewer.INDEX_INVISIBLE) michael@0: continue; michael@0: selection.rangedSelect(index, index, true); michael@0: } michael@0: selection.selectEventsSuppressed = false; michael@0: ]]> michael@0: michael@0: michael@0: false michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: this._contextMenuShown = false; michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: true michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: rowHeight * 0.75) { michael@0: // If we are below the 75% of a container the treeview we try michael@0: // to drop after the node. michael@0: orientation = Ci.nsITreeView.DROP_AFTER; michael@0: } michael@0: else if (PlacesUtils.nodeIsContainer(node) && michael@0: eventY > rowHeight * 0.25) { michael@0: // If we are below the 25% of a container the treeview we try michael@0: // to drop inside the node. michael@0: orientation = Ci.nsITreeView.DROP_ON; michael@0: } michael@0: michael@0: if (!this.view.canDrop(row.value, orientation, event.dataTransfer)) michael@0: return; michael@0: michael@0: event.preventDefault(); michael@0: event.stopPropagation(); michael@0: ]]> michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: michael@0: