ctxtMenu.add(RENAME, "icon-rename");
return ctxtMenu.getMenu();
}
private final void rename(final EditableTreeItem item) {
final Editor editor = item.getEditor();
Listener<EditorEvent> editorListener = new Listener<EditorEvent>() {
public void handleEvent(EditorEvent ev) {
editor.removeListener(Events.Complete, this);
if (!ev.startValue.equals(ev.value))
doRename(item);
}
};
editor.addListener(Events.Complete, editorListener);
item.startEdit();
}