// Get the data being edited
List<?> listData = listView.getListData();
ListItem listItem = (ListItem)listData.get(index);
// Get the item bounds
Bounds itemBounds = listView.getItemBounds(index);
int itemIndent = listView.getItemIndent();
itemBounds = new Bounds(itemBounds.x + itemIndent, itemBounds.y,
itemBounds.width - itemIndent, itemBounds.height);
// Render the item data
ListViewItemRenderer itemRenderer = (ListViewItemRenderer)listView.getItemRenderer();
itemRenderer.render(listItem, listView, false, false, false, false);
itemRenderer.setSize(itemBounds.width, itemBounds.height);
// Calculate the text bounds
Bounds textBounds = itemRenderer.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(itemBounds.x + textBounds.x - (padding.left + 1),
itemBounds.y, itemBounds.width - textBounds.x + (padding.left + 1),
itemBounds.height);
// Scroll to make the text as visible as possible
listView.scrollAreaToVisible(editBounds.x, editBounds.y,