final NodeModel parentNode = selected.getParentNode();
final boolean isLeft = selected.isLeft();
final NodeModel newNode = addNewNode(parentNode, end+1, isLeft);
final SummaryNode summary = modeController.getExtension(SummaryNode.class);
summary.undoableActivateHook(newNode, summary);
final FirstGroupNode firstGroup = modeController.getExtension(FirstGroupNode.class);
final NodeModel firstNode = parentNode.getChildAt(start);
firstGroup.undoableActivateHook(firstNode, firstGroup);
int level = summaryLevel;
for(int i = start+1; i < end; i++){
NodeModel node = parentNode.getChildAt(i);
if(isLeft != node.isLeft())
continue;
if(SummaryNode.isSummaryNode(node))
level++;
else
level = 0;
if(level == summaryLevel && SummaryNode.isFirstGroupNode(node))
firstGroup.undoableActivateHook(node, firstGroup);
}
startEditingAfterSelect(newNode);
select(newNode);
}