if (currentMap != null && clipboardLayer != null) {
Vector<MapLayer> layersBefore = currentMap.getLayerVector();
MapLayer ml = createLayerCopy(clipboardLayer);
ml.setName(Resources.getString("general.layer.layer") + " " + currentMap.getTotalLayers());
currentMap.addLayer(ml);
undoSupport.postEdit(new MapLayerStateEdit(currentMap, layersBefore, new Vector<MapLayer>(currentMap.getLayerVector()),
"Paste Selection"));
}
}