Search in sources :

Example 21 with SWTBotShell

use of org.eclipse.swtbot.swt.finder.widgets.SWTBotShell in project gfm_viewer by satyagraha.

the class MarkdownViewBot method open.

public static MarkdownViewBot open() {
    bot.menu("Window").menu("Show View").menu("Other...").click();
    SWTBotShell shell = bot.shell("Show View");
    shell.activate();
    bot.tree().expandNode("GFM Support").select("GFM View");
    bot.button("OK").click();
    return findById();
}
Also used : SWTBotShell(org.eclipse.swtbot.swt.finder.widgets.SWTBotShell)

Example 22 with SWTBotShell

use of org.eclipse.swtbot.swt.finder.widgets.SWTBotShell in project gfm_viewer by satyagraha.

the class PreferencesBot method fromActivatedPreferences.

static PreferencesBot fromActivatedPreferences() {
    SWTBotShell botShell = bot.shell("Preferences");
    botShell.activate();
    return new PreferencesBot(botShell);
}
Also used : SWTBotShell(org.eclipse.swtbot.swt.finder.widgets.SWTBotShell)

Example 23 with SWTBotShell

use of org.eclipse.swtbot.swt.finder.widgets.SWTBotShell in project gfm_viewer by satyagraha.

the class ProjectBot method delete.

public void delete() {
    projectTree.contextMenu("Refresh").click();
    SWTUtils.sleep(2000);
    projectTree.contextMenu("Delete").click();
    SWTBotShell shell = bot.shell("Delete Resources");
    shell.activate();
    shell.pressShortcut(SWT.ALT, 'D');
    bot.button("OK").click();
    projectTree = null;
}
Also used : SWTBotShell(org.eclipse.swtbot.swt.finder.widgets.SWTBotShell)

Example 24 with SWTBotShell

use of org.eclipse.swtbot.swt.finder.widgets.SWTBotShell in project gfm_viewer by satyagraha.

the class ProjectBot method createSimpleProject.

public static ProjectBot createSimpleProject() {
    String projectName = "Project_" + System.currentTimeMillis();
    bot.menu("File").menu("New").menu("Project...").click();
    SWTBotShell shell = bot.shell("New Project");
    shell.activate();
    bot.tree().expandNode("General").select("Project");
    bot.button("Next >").click();
    bot.textWithLabel("Project name:").setText(projectName);
    bot.button("Finish").click();
    SWTUtils.sleep(2000);
    SWTBotTree projectsTree = bot.viewByTitle("Project Explorer").bot().tree();
    SWTBotTreeItem projectTree = projectsTree.getTreeItem(projectName);
    return new ProjectBot(projectTree);
}
Also used : SWTBotTree(org.eclipse.swtbot.swt.finder.widgets.SWTBotTree) SWTBotTreeItem(org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem) SWTBotShell(org.eclipse.swtbot.swt.finder.widgets.SWTBotShell)

Example 25 with SWTBotShell

use of org.eclipse.swtbot.swt.finder.widgets.SWTBotShell in project xtext-xtend by eclipse.

the class SwtBotProjectHelper method newXtendEditor.

public static SWTBotEclipseEditor newXtendEditor(final SWTWorkbenchBot it, final String typeName, final String packageName, final String sourceFolderPath) {
    SWTBotEclipseEditor _xblockexpression = null;
    {
        try {
            SwtBotProjectHelper.fileNew(it, "Xtend Class");
        } catch (final Throwable _t) {
            if (_t instanceof WidgetNotFoundException) {
                final WidgetNotFoundException e = (WidgetNotFoundException) _t;
                final Consumer<SWTBotShell> _function = (SWTBotShell it_1) -> {
                    StringConcatenation _builder = new StringConcatenation();
                    _builder.append("Shell: \'");
                    String _text = it_1.getText();
                    _builder.append(_text);
                    _builder.append("\', active: ");
                    boolean _isActive = it_1.isActive();
                    _builder.append(_isActive);
                    InputOutput.<String>println(_builder.toString());
                };
                ((List<SWTBotShell>) Conversions.doWrapArray(it.shells())).forEach(_function);
                StringConcatenation _builder = new StringConcatenation();
                _builder.append(SWTBotPreferences.SCREENSHOTS_DIR);
                _builder.append("/MenuFileNotFound");
                long _currentTimeMillis = System.currentTimeMillis();
                _builder.append(_currentTimeMillis);
                _builder.append(".");
                _builder.append(SWTBotPreferences.SCREENSHOT_FORMAT);
                final Function1<SWTBotShell, Boolean> _function_1 = (SWTBotShell it_1) -> {
                    return Boolean.valueOf(it_1.isActive());
                };
                SWTUtils.captureScreenshot(_builder.toString(), IterableExtensions.<SWTBotShell>head(IterableExtensions.<SWTBotShell>filter(((Iterable<SWTBotShell>) Conversions.doWrapArray(it.shells())), _function_1)).widget);
                throw e;
            } else {
                throw Exceptions.sneakyThrow(_t);
            }
        }
        it.shell("Xtend Class").activate();
        SWTBotText _textWithLabel = it.textWithLabel("Source folder:");
        _textWithLabel.setText(sourceFolderPath);
        SWTBotText _textWithLabel_1 = it.textWithLabel("Package:");
        _textWithLabel_1.setText(packageName);
        SWTBotText _textWithLabel_2 = it.textWithLabel("Name:");
        _textWithLabel_2.setText(typeName);
        it.button("Finish").click();
        _xblockexpression = it.editorByTitle((typeName + ".xtend")).toTextEditor();
    }
    return _xblockexpression;
}
Also used : WidgetNotFoundException(org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException) SWTBotEclipseEditor(org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor) SWTBotText(org.eclipse.swtbot.swt.finder.widgets.SWTBotText) StringConcatenation(org.eclipse.xtend2.lib.StringConcatenation) List(java.util.List) SWTBotShell(org.eclipse.swtbot.swt.finder.widgets.SWTBotShell)

Aggregations

SWTBotShell (org.eclipse.swtbot.swt.finder.widgets.SWTBotShell)41 Test (org.junit.Test)14 SWTWorkbenchBot (org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot)8 SWTBotTable (org.eclipse.swtbot.swt.finder.widgets.SWTBotTable)6 SWTBotTree (org.eclipse.swtbot.swt.finder.widgets.SWTBotTree)6 SWTBotEclipseEditor (org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor)5 SWTBotCombo (org.eclipse.swtbot.swt.finder.widgets.SWTBotCombo)5 SWTBotText (org.eclipse.swtbot.swt.finder.widgets.SWTBotText)5 SWTBotTreeItem (org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem)5 WidgetNotFoundException (org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException)4 Point (org.eclipse.swt.graphics.Point)3 SWTBotEditor (org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor)3 SWTBot (org.eclipse.swtbot.swt.finder.SWTBot)3 SWTBotMenu (org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu)3 BeforeClass (org.junit.BeforeClass)3 DockerClient (com.spotify.docker.client.DockerClient)2 ProgressHandler (com.spotify.docker.client.ProgressHandler)2 Path (java.nio.file.Path)2 IFile (org.eclipse.core.resources.IFile)2 IWorkspace (org.eclipse.core.resources.IWorkspace)2