Remove the associated tree node when a tree pane is removed.
175532
@Override
    protected void afterRemoveChild(ElementBase child) {
        if (child == activePane) {
            setActivePane((ElementTreePane) getFirstChild());
        }
        super.afterRemoveChild(child);
    }
745157
function remove(node) {
    var next = node.nextSibling || node.parentNode;

    node.parentNode.removeChild(node);

    return next;
}
794626
private void delete(Node node) {
    if (handHot == node) {
      handHot = node.next;
    }
    if (handCold == node) {
      handCold = node.next;
    }
    if (handTest == node) {
      handTest = node.next;
    }
    node.remove();
  }
99297
private static void delDefault(Tree<Node> tree){
		if(!tree.isLeaf()){
			for(int i=0;i<tree.children.size();i++){
				if(isDefault(tree.getChild(i))){
					tree.removeChild(i); 
				}
			}
			for(int i=0;i<tree.children.size();i++){
				delDefault(tree.getChild(i));
			}
		}	
	}
179157
public void removeNode(Node n)
  {

    if (!m_mutable)
      throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!");

    this.removeElement(n);
  }
617942
def prune_node(self, node, remove_backrefs=False):
        
        if not remove_backrefs:
            for fro, connections in self.edges.items():
                if node in self.edges[fro]:
                    raise ValueError("""Attempting to remove a node with
                                     backrefs. You may consider setting
                                     `remove_backrefs` to true.""")

        # OK. Otherwise, let's do our removal.

        self.nodes.remove(node)
        if node in self.edges:
            # Remove add edges from this node if we're pruning it.
            self.edges.pop(node)

        for fro, connections in self.edges.items():
            # Remove any links to this node (if they exist)
            if node in self.edges[fro]:
                # If we should remove backrefs:
                self.edges[fro].remove(node)
492358
function _onChildNodeRemoved(event, res) {
        // res = {parentNodeId, nodeId}
        if (res.nodeId > 0) {
            var node = nodeWithId(res.nodeId);
            node.remove();
        }
    }
188199
def delete(self, destroy=True):
        
        removed_child = self.adapter.remove_node_child(
            self.adapter.get_node_parent(self.impl_node), self.impl_node,
            destroy_node=destroy)
        if removed_child is not None:
            return self.adapter.wrap_node(removed_child, None, self.adapter)
        else:
            return None
571587
protected static void removeChildAndPrevious( JComponent root , JComponent target ) {
		int N = root.getComponentCount();

		for (int i = 0; i < N; i++) {
			if( root.getComponent(i) == target ) {
				root.remove(i);
				root.remove(i-1);
				return;
			}
		}
		throw new RuntimeException("Can't find component");
	}
517555
function (node) {
        var children = this._children;
        var idx = children.indexOf(node);
        if (idx < 0) {
            return;
        }

        children.splice(idx, 1);
        node._parent = null;

        if (this._scene) {
            node.traverse(this._removeSelfFromScene, this);
        }
    }
365514
function(polygontreenodes, alsoRemovecoplanarFront) {
            var args = {'node': this, 'polygontreenodes': polygontreenodes }
            var node;
            var stack = [];

            do {
                node = args.node;
                polygontreenodes = args.polygontreenodes;

                // begin "function"
                if(node.plane) {
                    var backnodes = [];
                    var frontnodes = [];
                    var coplanarfrontnodes = alsoRemovecoplanarFront ? backnodes : frontnodes;
                    var plane = node.plane;
                    var numpolygontreenodes = polygontreenodes.length;
                    for(i = 0; i < numpolygontreenodes; i++) {
                        var node1 = polygontreenodes[i];
                        if(!node1.isRemoved()) {
                            node1.splitByPlane(plane, coplanarfrontnodes, backnodes, frontnodes, backnodes);
                        }
                    }

                    if(node.front && (frontnodes.length > 0)) {
                        stack.push({'node': node.front, 'polygontreenodes': frontnodes});
                    }
                    var numbacknodes = backnodes.length;
                    if (node.back && (numbacknodes > 0)) {
                        stack.push({'node': node.back, 'polygontreenodes': backnodes});
                    } else {
                        // there's nothing behind this plane. Delete the nodes behind this plane:
                        for (var i = 0; i < numbacknodes; i++) {
                            backnodes[i].remove();
                        }
                    }
                }
                args = stack.pop();
            } while (typeof(args) !== 'undefined');
        }
747573
def del_node(self, node):
        
        for each in list(self.neighbors(node)):
            if (each != node):
                self.del_edge((each, node))
        del(self.node_neighbors[node])
        del(self.node_attr[node])
1170099
private void removeNode(ItemState item, int indexItem)
   {

      items.remove(indexItem);
      index.remove(item.getData().getIdentifier());
      index.remove(item.getData().getQPath());
      index.remove(new ParentIDQPathBasedKey(item));
      index.remove(new IDStateBasedKey(item.getData().getIdentifier(), item.getState()));
      childNodesInfo.remove(item.getData().getIdentifier());
      lastChildNodeStates.remove(item.getData().getIdentifier());
      childNodeStates.remove(item.getData().getIdentifier());
      if (allPathsChanged != null && item.isPathChanged())
      {
         allPathsChanged.remove(item);
         if (allPathsChanged.isEmpty())
            allPathsChanged = null;
      }

      if (item.isPersisted())
      {

         int childInfo[] = childNodesInfo.get(item.getData().getParentIdentifier());

         if (childInfo != null)
         {
            if (item.isDeleted())
            {
               ++childInfo[CHILD_NODES_COUNT];
            }
            else if (item.isAdded())
            {
               --childInfo[CHILD_NODES_COUNT];
            }

            childNodesInfo.put(item.getData().getParentIdentifier(), childInfo);
         }
      }

      Map<String, ItemState> children = lastChildNodeStates.get(item.getData().getParentIdentifier());
      if (children != null)
      {
         children.remove(item.getData().getIdentifier());
         if (children.isEmpty())
         {
            lastChildNodeStates.remove(item.getData().getParentIdentifier());
         }
      }

      List<ItemState> listItemStates = childNodeStates.get(item.getData().getParentIdentifier());
      if (listItemStates != null)
      {
         listItemStates.remove(item);
         if (listItemStates.isEmpty())
         {
            childNodeStates.remove(item.getData().getParentIdentifier());
         }
      }
      if ((children == null || children.isEmpty()) && (listItemStates == null || listItemStates.isEmpty()))
      {
         childNodesInfo.remove(item.getData().getParentIdentifier());
      }
   }
813582
public boolean remove(Tree<T> node) {
    return getChild(node)
        .map(function(n -> n.parent = null))
        .map(children::remove)
        .orElse(false);
  }
830159
final void remove(AbstractCompiler compiler) {
    if (isDetached()) {
      return;
    }
    Node statement = getRemovableNode();
    NodeUtil.deleteNode(statement, compiler);
    statement.removeChildren();
  }
1276650
def removed_tree(self, dirname):
        """"""
        dirname = osp.abspath(to_text_string(dirname))
        for fname in self.get_filenames():
            if osp.abspath(fname).startswith(dirname):
                self.close_file_from_name(fname)
74134
void inPlaceNodeRemove(int removeNodeCount) {
        // Prepare edge-update of nodes which are connected to deleted nodes
        int toMoveNodes = getNodes();
        int itemsToMove = 0;

        // sorted map when we access it via keyAt and valueAt - see below!
        final SparseIntIntArray oldToNewMap = new SparseIntIntArray(removeNodeCount);
        GHBitSet toRemoveSet = new GHBitSetImpl(removeNodeCount);
        removedNodes.copyTo(toRemoveSet);

        if (removeNodeCount > getNodes() / 2.0)
            LoggerFactory.getLogger(getClass()).warn("More than a half of the network should be removed!? "
                    + "Nodes:" + getNodes() + ", remove:" + removeNodeCount);

        EdgeExplorer delExplorer = createEdgeExplorer();
        // create map of old node ids pointing to new ids
        for (int removeNode = removedNodes.next(0);
             removeNode >= 0;
             removeNode = removedNodes.next(removeNode + 1)) {
            EdgeIterator delEdgesIter = delExplorer.setBaseNode(removeNode);
            while (delEdgesIter.next()) {
                toRemoveSet.add(delEdgesIter.getAdjNode());
            }

            toMoveNodes--;
            // move only nodes that are not removed
            for (; toMoveNodes >= 0; toMoveNodes--) {
                if (!removedNodes.contains(toMoveNodes))
                    break;
            }

            if (toMoveNodes >= removeNode)
                oldToNewMap.put(toMoveNodes, removeNode);

            itemsToMove++;
        }

        EdgeIterable adjNodesToDelIter = (EdgeIterable) createEdgeExplorer();
        // now similar process to disconnectEdges but only for specific nodes
        // all deleted nodes could be connected to existing. remove the connections
        for (int removeNode = toRemoveSet.next(0);
             removeNode >= 0;
             removeNode = toRemoveSet.next(removeNode + 1)) {
            // remove all edges connected to the deleted nodes
            adjNodesToDelIter.setBaseNode(removeNode);
            long prevPointer = EdgeIterator.NO_EDGE;
            while (adjNodesToDelIter.next()) {
                int nodeId = adjNodesToDelIter.getAdjNode();
                // already invalidated
                if (!EdgeAccess.isInvalidNodeB(nodeId) && removedNodes.contains(nodeId)) {
                    int edgeToRemove = adjNodesToDelIter.getEdge();
                    long edgeToRemovePointer = edgeAccess.toPointer(edgeToRemove);
                    edgeAccess.internalEdgeDisconnect(edgeToRemove, prevPointer, removeNode);
                    edgeAccess.invalidateEdge(edgeToRemovePointer);
                } else {
                    prevPointer = adjNodesToDelIter.edgePointer;
                }
            }
        }

        GHBitSet toMoveSet = new GHBitSetImpl(removeNodeCount * 3);
        EdgeExplorer movedEdgeExplorer = createEdgeExplorer();
        // marks connected nodes to rewrite the edges
        for (int i = 0; i < itemsToMove; i++) {
            int oldI = oldToNewMap.keyAt(i);
            EdgeIterator movedEdgeIter = movedEdgeExplorer.setBaseNode(oldI);
            while (movedEdgeIter.next()) {
                int nodeId = movedEdgeIter.getAdjNode();
                if (EdgeAccess.isInvalidNodeB(nodeId))
                    continue;

                if (removedNodes.contains(nodeId))
                    throw new IllegalStateException("shouldn't happen as the edge to the node "
                            + nodeId + " should be already deleted. " + oldI);

                toMoveSet.add(nodeId);
            }
        }

        // move nodes into deleted nodes
        for (int i = 0; i < itemsToMove; i++) {
            int oldI = oldToNewMap.keyAt(i);
            int newI = oldToNewMap.valueAt(i);
            long newOffset = (long) newI * nodeEntryBytes;
            long oldOffset = (long) oldI * nodeEntryBytes;
            for (long j = 0; j < nodeEntryBytes; j += 4) {
                nodes.setInt(newOffset + j, nodes.getInt(oldOffset + j));
            }
        }

        // *rewrites* all edges connected to moved nodes
        // go through all edges and pick the necessary <- this is easier to implement than
        // a more efficient (?) breadth-first search
        EdgeIterator iter = getAllEdges();
        while (iter.next()) {
            int nodeA = iter.getBaseNode();
            int nodeB = iter.getAdjNode();
            if (!toMoveSet.contains(nodeA) && !toMoveSet.contains(nodeB))
                continue;

            // now overwrite exiting edge with new node ids
            int updatedA = oldToNewMap.get(nodeA);
            if (updatedA < 0)
                updatedA = nodeA;

            int updatedB = oldToNewMap.get(nodeB);
            if (updatedB < 0)
                updatedB = nodeB;

            // no need to rewrite flags or other properties as they are independent of the node order unlike in <= 0.11
            int edgeId = iter.getEdge();
            long edgePointer = edgeAccess.toPointer(edgeId);
            int linkA = edgeAccess.getLinkA(edgePointer);
            int linkB = edgeAccess.getLinkB(edgePointer);
            edgeAccess.writeEdge(edgeId, updatedA, updatedB, linkA, linkB);
        }

        if (removeNodeCount >= nodeCount)
            throw new IllegalStateException("graph is empty after in-place removal but was " + removeNodeCount);

        // clear N_EDGE_REF
        initNodeRefs(((long) nodeCount - removeNodeCount) * nodeEntryBytes, (long) nodeCount * nodeEntryBytes);

        // we do not remove the invalid edges => edgeCount stays the same!
        nodeCount -= removeNodeCount;

        // health check
        if (isTestingEnabled()) {
            EdgeExplorer explorer = createEdgeExplorer();
            iter = getAllEdges();
            while (iter.next()) {
                int base = iter.getBaseNode();
                int adj = iter.getAdjNode();
                String str = iter.getEdge()
                        + ", r.contains(" + base + "):" + removedNodes.contains(base)
                        + ", r.contains(" + adj + "):" + removedNodes.contains(adj)
                        + ", tr.contains(" + base + "):" + toRemoveSet.contains(base)
                        + ", tr.contains(" + adj + "):" + toRemoveSet.contains(adj)
                        + ", base:" + base + ", adj:" + adj + ", nodeCount:" + nodeCount;
                if (adj >= nodeCount)
                    throw new RuntimeException("Adj.node problem with edge " + str);

                if (base >= nodeCount)
                    throw new RuntimeException("Base node problem with edge " + str);

                try {
                    explorer.setBaseNode(adj).toString();
                } catch (Exception ex) {
                    org.slf4j.LoggerFactory.getLogger(getClass()).error("adj:" + adj);
                }
                try {
                    explorer.setBaseNode(base).toString();
                } catch (Exception ex) {
                    org.slf4j.LoggerFactory.getLogger(getClass()).error("base:" + base);
                }
            }
            // access last node -> no error
            explorer.setBaseNode(nodeCount - 1).toString();
        }
        removedNodes = null;
    }