// 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.x += nodeIndent;
nodeBounds.width -= nodeIndent;
// 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);
editBounds.x += textBounds.x - (padding.left + 1);
editBounds.width -= textBounds.x;
editBounds.width += (padding.left + 1);
// Scroll to make the text as visible as possible