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();
}
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);
}
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;
}
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);
}
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;
}
Aggregations