diff options
author | Patrick Tasse | 2017-04-25 17:52:23 +0000 |
---|---|---|
committer | Patrick Tasse | 2017-04-25 18:35:18 +0000 |
commit | a809170b7fa39f9f08f2c26aa5544e7d9c73ed91 (patch) | |
tree | fe66c25a7630c7eedfd3e7b143b1e8a586147189 | |
parent | 4033f81c7f06bbe87e9ce890636340e5eaeb14b7 (diff) | |
download | org.eclipse.swtbot-a809170b7fa39f9f08f2c26aa5544e7d9c73ed91.tar.gz org.eclipse.swtbot-a809170b7fa39f9f08f2c26aa5544e7d9c73ed91.tar.xz org.eclipse.swtbot-a809170b7fa39f9f08f2c26aa5544e7d9c73ed91.zip |
Bug 393032: SWTBotTable.click causes row selection events problem
The selection of the TableItem is now made first in a syncExec, and the
clickXY method is no longer called from within an asyncExec.
Change-Id: Ibc0daf66ee75a7121b23a1ea96dff142b4d2d66d
Signed-off-by: Patrick Tasse <patrick.tasse@gmail.com>
-rw-r--r-- | org.eclipse.swtbot.swt.finder/src/org/eclipse/swtbot/swt/finder/widgets/SWTBotTable.java | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/org.eclipse.swtbot.swt.finder/src/org/eclipse/swtbot/swt/finder/widgets/SWTBotTable.java b/org.eclipse.swtbot.swt.finder/src/org/eclipse/swtbot/swt/finder/widgets/SWTBotTable.java index 7a5e78dc..dcca55a7 100644 --- a/org.eclipse.swtbot.swt.finder/src/org/eclipse/swtbot/swt/finder/widgets/SWTBotTable.java +++ b/org.eclipse.swtbot.swt.finder/src/org/eclipse/swtbot/swt/finder/widgets/SWTBotTable.java @@ -449,14 +449,16 @@ public class SWTBotTable extends AbstractSWTBotControl<Table> { assertIsLegalCell(row, column); // for some reason, it does not work without setting selection first setFocus(); - select(row); - asyncExec(new VoidResult() { - public void run() { + Rectangle cellBounds = syncExec(new Result<Rectangle>() { + public Rectangle run() { TableItem item = widget.getItem(row); Rectangle cellBounds = item.getBounds(column); - clickXY(cellBounds.x + (cellBounds.width / 2), cellBounds.y + (cellBounds.height / 2)); + widget.setSelection(row); + lastSelectionItem = item; + return cellBounds; } }); + clickXY(cellBounds.x + (cellBounds.width / 2), cellBounds.y + (cellBounds.height / 2)); } /** @@ -473,7 +475,6 @@ public class SWTBotTable extends AbstractSWTBotControl<Table> { public Rectangle run() { TableItem item = widget.getItem(row); Rectangle cellBounds = item.getBounds(column); - // for some reason, it does not work without setting selection first widget.setSelection(row); lastSelectionItem = item; return cellBounds; |