On 10-09-14 11:57 AM, Ketan Padegaonkar wrote:
> I think it should be possible to do it. Try whacking the code out of
> table.click() and put it somewhere. Make sure that the clickOnCell()
> test works exactly the same way :)
I had to do the same thing (I thought I added a bug report for that but
I can't seem to find it :P). What I did is extend SWTBotTreeItem and use
this handy-dandy bit of code:
public SwtBotTreeItemExtension click(final int columnIndex)
int columnCount = new SWTBotTree(parentTree).columnCount();
if (columnIndex < 0 || columnIndex > columnCount)
throw new IndexOutOfBoundsException("Index should be
between 0 and "
+ ". Passed value is: "
// Get the center point of the cell at the specified column
Point point = syncExec(new Result<Point>()
public Point run()
Rectangle bounds = widget.getBounds(columnIndex);
int x = bounds.x + (bounds.width / 2);
int y = bounds.y + (bounds.height / 2);
return new Point(x, y);
this, of course, could be integrated as part of SWTBotTreeItem API.