def change_node(item)
if current = selection.selected
parent = current.parent
old_type, old_content = current.type, current.content
if ALL_TYPES.include?(old_type)
@clipboard_data = Editor.model2data(current)
type, content = ask_for_element(parent, current.type,
current.content)
if type
current.type, current.content = type, content
current.remove_subtree(model)
toplevel.display_status("Changed a node in tree.")
window.change
end
else
toplevel.display_status(
"Cannot change node of type #{old_type} in tree!")
end
end
end