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