Search in sources :

Example 16 with SWTBotTree

use of org.eclipse.swtbot.swt.finder.widgets.SWTBotTree in project linuxtools by eclipse.

the class AbstractSWTBotTest method compareWithEachOther.

/**
 * Compare The selected items in PROJ_NAME with each other
 * @param The name of a tree item to select
 * @param The name of a second tree item to select
 */
public void compareWithEachOther(String first, String second) {
    SWTWorkbenchBot bot = new SWTWorkbenchBot();
    enterProjectFolder(bot);
    // Refresh and Select
    SWTBotTree treeBot = projectExplorer.bot().tree();
    treeBot.contextMenu("Refresh").click();
    treeBot.select(new String[] { first, second });
    // Workaround for context menu on multiple selections
    click(ContextMenuHelper.contextMenu(treeBot, "Compare With", "Each Other"));
    exitProjectFolder(bot);
}
Also used : SWTWorkbenchBot(org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot) SWTBotTree(org.eclipse.swtbot.swt.finder.widgets.SWTBotTree)

Example 17 with SWTBotTree

use of org.eclipse.swtbot.swt.finder.widgets.SWTBotTree in project linuxtools by eclipse.

the class AbstractSWTBotTest method runPerfViewTestActions.

private void runPerfViewTestActions(SWTWorkbenchBot bot) throws Exception {
    projectExplorer.bot().tree().select(PROJ_NAME);
    final Shell shellWidget = bot.activeShell().widget;
    // Open profiling configurations dialog
    UIThreadRunnable.asyncExec(() -> {
        DebugUITools.openLaunchConfigurationDialogOnGroup(shellWidget, (StructuredSelection) PlatformUI.getWorkbench().getWorkbenchWindows()[0].getSelectionService().getSelection(), "org.eclipse.debug.ui.launchGroup.profilee");
    });
    bot.shell("Profiling Tools Configurations").activate();
    // Create new Perf configuration
    SWTBotTree profilingConfigs = bot.tree();
    SWTBotTree perfNode = profilingConfigs.select("Profile with Perf");
    perfNode.contextMenu("New").click();
    // Activate options tab
    bot.cTabItem("Perf Options").activate();
    setPerfOptions(bot);
    bot.button("Apply").click();
    if (PerfCore.checkPerfInPath(null)) {
        bot.button("Profile").click();
    } else {
        bot.button("Close").click();
        openStubView();
    }
    testPerfView();
}
Also used : SWTBotShell(org.eclipse.swtbot.swt.finder.widgets.SWTBotShell) Shell(org.eclipse.swt.widgets.Shell) SWTBotTree(org.eclipse.swtbot.swt.finder.widgets.SWTBotTree)

Example 18 with SWTBotTree

use of org.eclipse.swtbot.swt.finder.widgets.SWTBotTree in project eclipse-pmd by acanda.

the class JavaProjectClient method createJavaProject.

/**
 * Creates a Java project with the provided name.
 *
 * @param name The name of the Java project.
 */
public static void createJavaProject(final String name) {
    final SWTWorkbenchBot bot = new SWTWorkbenchBot();
    bot.menu("File").menu("New").menu("Project...").click();
    final SWTBotShell dialog = bot.shell("New Project");
    final SWTBot newProjectDialogBot = dialog.bot();
    final SWTBotTree projectTree = newProjectDialogBot.tree();
    projectTree.expandNode("Java", "Java Project").select();
    newProjectDialogBot.button("Next >").click();
    newProjectDialogBot.textWithLabel("Project name:").setText(name);
    newProjectDialogBot.button("Finish").click();
    bot.waitUntil(Conditions.shellCloses(dialog));
}
Also used : SWTWorkbenchBot(org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot) SWTBot(org.eclipse.swtbot.swt.finder.SWTBot) SWTBotTree(org.eclipse.swtbot.swt.finder.widgets.SWTBotTree) SWTBotShell(org.eclipse.swtbot.swt.finder.widgets.SWTBotShell)

Aggregations

SWTBotTree (org.eclipse.swtbot.swt.finder.widgets.SWTBotTree)18 SWTBotShell (org.eclipse.swtbot.swt.finder.widgets.SWTBotShell)7 SWTBotTreeItem (org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem)7 SWTBotView (org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView)4 DockerConnection (org.eclipse.linuxtools.internal.docker.core.DockerConnection)3 Test (org.junit.Test)3 DockerClient (com.spotify.docker.client.DockerClient)2 IDockerConnection (org.eclipse.linuxtools.docker.core.IDockerConnection)2 Shell (org.eclipse.swt.widgets.Shell)2 SWTWorkbenchBot (org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot)2 Consumer (java.util.function.Consumer)1 ConfirmProjectDeleteDialog (net.heartsome.cat.ts.test.ui.msgdialogs.ConfirmProjectDeleteDialog)1 ProgressDialog (net.heartsome.cat.ts.test.ui.msgdialogs.ProgressDialog)1 ProjectTreeView (net.heartsome.cat.ts.test.ui.views.ProjectTreeView)1 IResource (org.eclipse.core.resources.IResource)1 Composite (org.eclipse.swt.widgets.Composite)1 Tree (org.eclipse.swt.widgets.Tree)1 SWTBotEclipseEditor (org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor)1 SWTBotMultiPageEditor (org.eclipse.swtbot.eclipse.finder.widgets.SWTBotMultiPageEditor)1 SWTBot (org.eclipse.swtbot.swt.finder.SWTBot)1