diff options
author | Aparna Argade | 2019-05-24 12:15:18 +0000 |
---|---|---|
committer | Patrick Tasse | 2019-05-29 17:22:03 +0000 |
commit | e36ff52c3ce02f5e46489a543bb1d5de5d363035 (patch) | |
tree | 06a7f6e519a121380c9b504235e76731f811936b /org.eclipse.swtbot.swt.finder.test/src/org/eclipse/swtbot/swt/finder | |
parent | 6c054cd1e0c53bd3223332be02a4625bff423fe3 (diff) | |
download | org.eclipse.swtbot-e36ff52c3ce02f5e46489a543bb1d5de5d363035.tar.gz org.eclipse.swtbot-e36ff52c3ce02f5e46489a543bb1d5de5d363035.tar.xz org.eclipse.swtbot-e36ff52c3ce02f5e46489a543bb1d5de5d363035.zip |
Bug 547624- StyledText.cursorPos should use getCaretOffset
After some text is selected, the caret actually points at the end of
selection. But cursorPos API was returning start column of selection,
because it was using x of selection range.
The API now uses StyledText's getCaretOffset.
Change-Id: I9ce73db82f6ab01e6ce2fa65a44486bf0f99431f
Signed-off-by: Aparna Argade <aprsac@yahoo.com>
Signed-off-by: Patrick Tasse <patrick.tasse@gmail.com>
Diffstat (limited to 'org.eclipse.swtbot.swt.finder.test/src/org/eclipse/swtbot/swt/finder')
-rw-r--r-- | org.eclipse.swtbot.swt.finder.test/src/org/eclipse/swtbot/swt/finder/widgets/SWTBotStyledTextTest.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/org.eclipse.swtbot.swt.finder.test/src/org/eclipse/swtbot/swt/finder/widgets/SWTBotStyledTextTest.java b/org.eclipse.swtbot.swt.finder.test/src/org/eclipse/swtbot/swt/finder/widgets/SWTBotStyledTextTest.java index b451ab0c..12ff67c9 100644 --- a/org.eclipse.swtbot.swt.finder.test/src/org/eclipse/swtbot/swt/finder/widgets/SWTBotStyledTextTest.java +++ b/org.eclipse.swtbot.swt.finder.test/src/org/eclipse/swtbot/swt/finder/widgets/SWTBotStyledTextTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2018 Ketan Padegaonkar and others. + * Copyright (c) 2008, 2019 Ketan Padegaonkar and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -293,7 +293,7 @@ public class SWTBotStyledTextTest extends AbstractCustomControlExampleTest { styledText.setText("This is sample text"); bot.button("Clear").click(); styledText.click(line, column, SWT.MOD2); - assertEquals(new Position(0, 0), styledText.cursorPosition(true)); + assertEquals(new Position(line, column), styledText.cursorPosition(true)); assertEquals("This is sample te", styledText.getSelection()); verifyNotifyClick(SWT.MOD2); } @@ -318,8 +318,8 @@ public class SWTBotStyledTextTest extends AbstractCustomControlExampleTest { bot.button("Clear").click(); styledText.doubleClick(line, column); // Default behavior: word is selected upon doubleClick, so cursor position needs - // to be compared with start column of the word - assertEquals(new Position(line, column - 1), styledText.cursorPosition(true)); + // to be compared with end of the word + assertEquals(new Position(line, column + 1), styledText.cursorPosition(true)); assertEquals(styledText.getSelection(), "is"); verifyNotifyClick(0); |