tree.putClientProperty("JTree.lineStyle", "Angled");
// Add the listeners to DOMDocumentTree
tree.addListener(new DOMDocumentTreeAdapter() {
public void dropCompleted(DOMDocumentTreeEvent event) {
DropCompletedInfo info = (DropCompletedInfo) event
.getSource();
addChangesToHistory();
AbstractCompoundCommand cmd = historyBrowserInterface
.createNodesDroppedCommand(info.getChildren());
int n = info.getChildren().size();
for (int i = 0; i < n; i++) {
Node node = (Node) info.getChildren().get(i);
// If the node has its ancestor in selected nodes,
// it should stay as it's child
if (!DOMUtilities.isAnyNodeAncestorOf(info
.getChildren(), node)) {
cmd.addCommand(historyBrowserInterface
.createInsertChildCommand(info.getParent(),
info.getSibling(), node));
}
}
historyBrowserInterface.performCompoundUpdateCommand(cmd);
}
});