private void paste(final String text, final NodeModel target, final boolean asSibling, final boolean isLeft) {
final String[] textLines = text.split(ClipboardController.NODESEPARATOR);
final MMapController mapController = (MMapController) Controller.getCurrentModeController().getMapController();
final MapReader mapReader = mapController.getMapReader();
final NodeTreeCreator nodeTreeCreator = mapReader.nodeTreeCreator(target.getMap());
nodeTreeCreator.setHint(Hint.MODE, Mode.CLIPBOARD);
for (int i = 0; i < textLines.length; ++i) {
try {
final NodeModel newModel = nodeTreeCreator.create(new StringReader(textLines[i]));
newModel.removeExtension(FreeNode.class);
final boolean wasLeft = newModel.isLeft();
mapController.insertNode(newModel, target, asSibling, isLeft, wasLeft != isLeft);
}
catch (final XMLException e) {
LogUtils.severe("error on paste", e);
}
}
nodeTreeCreator.finish(target);
}