Search in sources :

Example 21 with SWTBotMenu

use of org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu in project liferay-ide by liferay.

the class Tree method contextMenu.

public void contextMenu(String menu, String... items) {
    SWTBotTreeItem item = null;
    int timeout = 10 * 1000;
    long current = System.currentTimeMillis();
    while (true) {
        if (System.currentTimeMillis() > (current + timeout)) {
            break;
        }
        sleep();
        try {
            if (items.length > 1) {
                item = getWidget().expandNode(items);
            } else {
                item = getWidget().getTreeItem(items[0]);
            }
        } catch (Exception e) {
        }
    }
    Assert.assertNotNull("Could not find " + items[items.length - 1] + " after " + timeout, item);
    SWTBotMenu botMenu = item.contextMenu(menu);
    botMenu.click();
}
Also used : SWTBotMenu(org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu) SWTBotTreeItem(org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem) WidgetNotFoundException(org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException)

Example 22 with SWTBotMenu

use of org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu in project liferay-ide by liferay.

the class AbstractWidget method contextMenu.

public void contextMenu(String menu) {
    SWTBotMenu botMenu = getWidget().contextMenu(menu);
    botMenu.click();
}
Also used : SWTBotMenu(org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu)

Example 23 with SWTBotMenu

use of org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu in project translationstudio8 by heartsome.

the class ProjectTreeItem method ctxMenuReverseConvertFile.

/**
	 * 转换当前项目中的一个 XLIFF 为源格式
	 * @param xlfFileName
	 *            要转换为源格式的 XLIFF 文件名称
	 */
public void ctxMenuReverseConvertFile(String xlfFileName) {
    selectFile("XLIFF", xlfFileName);
    SWTBotMenu reverseConvertFile = ptv.ctxMenuConvertXliffFile2Tgt();
    reverseConvertFile.isEnabled();
    reverseConvertFile.click();
// TODO:确认转换对话框正确打开
}
Also used : SWTBotMenu(org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu)

Example 24 with SWTBotMenu

use of org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu in project translationstudio8 by heartsome.

the class ProjectTreeItem method ctxMenuOpenProjectFiles.

/**
	 * 合并打开当前项目中的所有 XLIFF
	 */
public void ctxMenuOpenProjectFiles() {
    ptn.select();
    SWTBotMenu openProjectFiles = ptv.ctxMenuOpenProjectFiles();
    // 确认右键菜单中的打开项目功能可用
    openProjectFiles.isEnabled();
    // 点击该菜单项
    openProjectFiles.click();
    // 确认文件被成功打开
    SWTBotEditor editor = HSBot.bot().editorByTitle(prjName);
    HSBot.bot().waitUntil(new IsEditorOpened(editor));
}
Also used : SWTBotEditor(org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor) IsEditorOpened(net.heartsome.test.swtbot.waits.IsEditorOpened) SWTBotMenu(org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu)

Example 25 with SWTBotMenu

use of org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu in project translationstudio8 by heartsome.

the class ProjectTreeItem method ctxMenuConvertFile.

/**
	 * 转换当前项目中的一个源文件为 XLIFF
	 * @param srcFileName
	 *            要转换的源文件名称
	 */
public void ctxMenuConvertFile(String srcFileName) {
    selectFile("Source", srcFileName);
    SWTBotMenu convertFiles = ptv.ctxMenuConvertSrcFile2Xliff();
    convertFiles.isEnabled();
    convertFiles.click();
// TODO:确认转换对话框正确打开
}
Also used : SWTBotMenu(org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu)

Aggregations

SWTBotMenu (org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu)44 Test (org.junit.Test)27 DockerClient (com.spotify.docker.client.DockerClient)14 DockerConnection (org.eclipse.linuxtools.internal.docker.core.DockerConnection)14 SWTBotEditor (org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor)3 WidgetNotFoundException (org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException)3 SWTBotShell (org.eclipse.swtbot.swt.finder.widgets.SWTBotShell)3 SWTBotTreeItem (org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem)3 IsEditorOpened (net.heartsome.test.swtbot.waits.IsEditorOpened)2 SWTWorkbenchBot (org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot)2 SWTBot (org.eclipse.swtbot.swt.finder.SWTBot)2 SWTBotRadio (org.eclipse.swtbot.swt.finder.widgets.SWTBotRadio)2 SWTBotText (org.eclipse.swtbot.swt.finder.widgets.SWTBotText)2 ArrayList (java.util.ArrayList)1 ContributionItem (org.eclipse.jface.action.ContributionItem)1 IContributionItem (org.eclipse.jface.action.IContributionItem)1 IMenuManager (org.eclipse.jface.action.IMenuManager)1 MenuManager (org.eclipse.jface.action.MenuManager)1 AbstractTest (org.eclipse.linuxtools.profiling.tests.AbstractTest)1 AbstractChartBuilder (org.eclipse.linuxtools.systemtap.graphing.ui.charts.AbstractChartBuilder)1