// Get the data being edited
List<?> treeData = treeView.getTreeData();
TreeNode nodeData = (TreeNode)Sequence.Tree.get(treeData, path);
// Get the node bounds
Bounds nodeBounds = treeView.getNodeBounds(path);
int nodeIndent = treeView.getNodeIndent(path.getLength());
nodeBounds = new Bounds(nodeBounds.x + nodeIndent, nodeBounds.y,
nodeBounds.width - nodeIndent, nodeBounds.height);
// Render the node data
TreeViewNodeRenderer nodeRenderer = (TreeViewNodeRenderer)treeView.getNodeRenderer();
nodeRenderer.render(nodeData, treeView, false, false,
TreeView.NodeCheckState.UNCHECKED, false, false);
nodeRenderer.setSize(nodeBounds.width, nodeBounds.height);
// Get the text bounds
Bounds textBounds = nodeRenderer.getTextBounds();
if (textBounds != null) {
textInput = new TextInput();
Insets padding = (Insets)textInput.getStyles().get("padding");
// Calculate the bounds of what we're editing
Bounds editBounds = new Bounds(nodeBounds.x + textBounds.x - (padding.left + 1),
nodeBounds.y, nodeBounds.width - textBounds.x + (padding.left + 1),
nodeBounds.height);
// Scroll to make the text as visible as possible
treeView.scrollAreaToVisible(editBounds.x, editBounds.y,