|
Re: Support to click tree table cell, proposal [message #493041 is a reply to message #493038] |
Thu, 22 October 2009 20:04 |
Jay Norwood Messages: 155 Registered: July 2009 |
Senior Member |
|
|
I guess it would also be good to add a doubleClick(column). I haven't tested this (I did test the single click), but it looks like it might work based on what's done elsewhere with clickXY and doubleclick().
public SWTBotTreeItem doubleClick(final int column) {
assertEnabled();
Rectangle cellBounds = syncExec(new Result<Rectangle>() {
public Rectangle run() {
return widget.getBounds(column);
}
});
doubleClickXY(cellBounds.x + (cellBounds.width / 2), cellBounds.y + (cellBounds.height / 2));
return this;
}
protected void doubleClickXY(int x, int y) {
notifyTree(SWT.MouseEnter);
notifyTree(SWT.MouseMove);
notifyTree(SWT.Activate);
notifyTree(SWT.FocusIn);
notifyTree(SWT.MouseDown, createMouseEvent(x, y, 1, SWT.BUTTON1, 1));
notifyTree(SWT.MouseUp);
notifyTree(SWT.Selection, createEvent());
notifyTree(SWT.MouseDown);
notifyTree(SWT.MouseDoubleClick);
notifyTree(SWT.DefaultSelection,createEvent());
notifyTree(SWT.MouseUp);
notifyTree(SWT.MouseHover);
notifyTree(SWT.MouseMove);
notifyTree(SWT.MouseExit);
notifyTree(SWT.Deactivate);
notifyTree(SWT.FocusOut);
}
|
|
|
Re: Support to click tree table cell, proposal [message #493048 is a reply to message #493041] |
Thu, 22 October 2009 20:26 |
Jay Norwood Messages: 155 Registered: July 2009 |
Senior Member |
|
|
After the button had been successfully created in the cell, in response to the click, I still had to find a way to launch that particular button. While we have a lot of useful matchers ... inGroup, withId, withLabel, and so on... we don't currently have a way to limit the search range to a cell boundary. It would be very useful to have something to do that.
Something like:
buttonInTreeCell(TreeItem row, int column );
buttonInTreeCell(int row,int column);
or maybe something using the cell boundaries:
Rectangle rect = treeItem.cellRect(int column);
SWTBotButton button = buttonInRect(rect);
Would an InRect matcher, in general, be useful for locating widgets in table cells?
|
|
|
Powered by
FUDForum. Page generated in 0.03784 seconds