Search in sources :

Example 11 with Position

use of org.eclipse.swtbot.swt.finder.utils.Position in project translationstudio8 by heartsome.

the class XlfEditor method navigateBefore.

/**
	 * 将光标定位到指定字符串之前
	 * @param beforeText
	 *            指定的字符串,光标将置于其第一个字符之前
	 */
public void navigateBefore(String beforeText) {
    HsSWTBotStyledText styledText = getStyledText();
    Position targetPos = styledText.positionOf(beforeText);
    Assert.isTrue(!targetPos.equals(new Position(-1, -1)), "Text \"" + beforeText + "\" not found.");
    styledText.navigateTo(targetPos);
}
Also used : Position(org.eclipse.swtbot.swt.finder.utils.Position) HsSWTBotStyledText(net.heartsome.test.swtbot.widgets.HsSWTBotStyledText)

Aggregations

Position (org.eclipse.swtbot.swt.finder.utils.Position)11 HsSWTBotStyledText (net.heartsome.test.swtbot.widgets.HsSWTBotStyledText)6 SWTBotNatTable (net.heartsome.test.swtbot.widgets.SWTBotNatTable)5 InformationDialog (net.heartsome.cat.ts.test.ui.msgdialogs.InformationDialog)1 XliffUtil (net.heartsome.cat.ts.test.ui.utils.XliffUtil)1