Search in sources :

Example 1 with IsFileOpenedInEditor

use of net.heartsome.test.swtbot.waits.IsFileOpenedInEditor in project translationstudio8 by heartsome.

the class ProjectFile method openFile.

/**
	 * @param from
	 *            打开文件的入口:右键菜单、双击,请使用 TS 类提供的常量;
	 */
public void openFile(Entry from) {
    assertTrue("参数错误,Excel 数据行 row 为 null。", row != null);
    getDataFile();
    SWTBotTreeItem item = select();
    assertTrue("如下选择类型不是文件:" + selectType, selectType == TsUIConstants.ResourceType.FILE);
    switch(from) {
        case DOUBLE_CLICK:
            {
                item.doubleClick();
                break;
            }
        case CONTEXT_MENU:
            {
                view.ctxMenuOpenFile().click();
                break;
            }
        default:
            {
                assertTrue("参数错误,无此入口:" + from, false);
            }
    }
    HSBot.bot().waitUntil(new IsFileOpenedInEditor(fileName));
}
Also used : IsFileOpenedInEditor(net.heartsome.test.swtbot.waits.IsFileOpenedInEditor) SWTBotTreeItem(org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem)

Aggregations

IsFileOpenedInEditor (net.heartsome.test.swtbot.waits.IsFileOpenedInEditor)1 SWTBotTreeItem (org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem)1