| Support to click tree table cell, proposal [message #493038] |
Thu, 22 October 2009 15:53  |
Jay Norwood Messages: 112 Registered: July 2009 |
Senior Member |
|
|
I have a tree table that I'm testing, and needed a way to click in a specific cell in order to activate one of those controls that get created when you click the cell. I didn't see support for clicking a specific cell in SWTBotTreeItem, but there was code to click() on the first cell, which was almost correct.
So I would like to propse addition of this to SWTBotTreeItem:
/**
* Clicks on the cell at the specified column.
*
* @return the current node.
* @since 1.2
*/
public SWTBotTreeItem click(final int column) {
assertEnabled();
Rectangle cellBounds = syncExec(new Result<Rectangle>() {
public Rectangle run() {
return widget.getBounds(column);
}
});
clickXY(cellBounds.x + (cellBounds.width / 2), cellBounds.y + (cellBounds.height / 2));
return this;
}
So now I can click on a cell by index:
SWTBotTreeItem item = tree.expandNode("rowname").select().click(); // clicks cell 0 in that row
item.click(1); // to click in cell 1 in that row
|
|
|