265: def change_node(item)
266: if current = selection.selected
267: parent = current.parent
268: old_type, old_content = current.type, current.content
269: if ALL_TYPES.include?(old_type)
270: @clipboard_data = Editor.model2data(current)
271: type, content = ask_for_element(parent, current.type,
272: current.content)
273: if type
274: current.type, current.content = type, content
275: current.remove_subtree(model)
276: toplevel.display_status("Changed a node in tree.")
277: window.change
278: end
279: else
280: toplevel.display_status(
281: "Cannot change node of type #{old_type} in tree!")
282: end
283: end
284: end