Method deprecated or moved
This method is deprecated or moved on the latest stable version.
The last existing version (v1_9_2_180) is shown here.
paste_node_appending(item)
public
Paste the data in the clipboard into the selected Array or Hash by appending
it.
Show source
def paste_node_appending(item)
if current = selection.selected
if @clipboard_data
case current.type
when 'Array'
Editor.data2model(@clipboard_data, model, current)
expand_collapse(current)
when 'Hash'
if @clipboard_data.is_a? Hash
parent = current.parent
hash = Editor.model2data(current)
model.remove(current)
hash.update(@clipboard_data)
Editor.data2model(hash, model, parent)
if parent
expand_collapse(parent)
elsif @expanded
expand_all
end
window.change
else
toplevel.display_status(
"Cannot paste non-#{current.type} data into '#{current.type}'!")
end
else
toplevel.display_status(
"Cannot paste node below '#{current.type}'!")
end
else
toplevel.display_status("Nothing to paste in clipboard!")
end
else
toplevel.display_status("Append a node into the root first!")
end
end