Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » Support to click tree table cell, proposal (Code proposal to click tree cell)
Support to click tree table cell, proposal [message #493038] Thu, 22 October 2009 15:53 Go to previous message
Jay Norwood is currently offline 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


 
Read Message
Read Message
Read Message
Previous Topic:Virtual lists in Combo
Next Topic:How to Maximize/Restore/Minimize Views?
Goto Forum:
  


Current Time: Thu May 23 11:02:46 EDT 2013

Powered by FUDForum. Page generated in 0.07248 seconds