function paste(this,manager)

%% Paste context menu callback

%% Copy the view in the cliboard and give it a name which is unquie
%% to its parent

%% Only viewnodes can be pasted
if ~isa(manager.Root.Tsviewer.Clipboard,'tsguis.viewnode')
    return
end

%% Create a new view
newview = this.addplot(manager);

%% Name the new view
siblingnames = get(this.getChildren,{'Label'});
newviewname = sprintf('Copy_of_%s',manager.Root.Tsviewer.Clipboard.Label);
k = 1;
while any(strcmp(newviewname,siblingnames))
    newviewname = sprintf('Copy_of_%d_%s',k,manager.Root.Tsviewer.Clipboard.Label);
    k = k+1;
end   

%% Add the time series from the pasted view to the target view
if ~isempty(manager.Root.Tsviewer.Clipboard.Plot)
    ts = manager.Root.Tsviewer.Clipboard.Plot.getTimeSeries;
    for k=1:length(ts)
        newview.addTs(ts{k});
    end
end
manager.Tree.setSelectedNode(newview.getTreeNodeInterface)   

newview.Label = newviewname; % Must be changed after addTs so listeners can update fig title
