use of org.eclipse.swtbot.swt.finder.widgets.SWTBotTree in project xtext-xtend by eclipse.
the class SwtBotProjectHelper method clearSourceFolderContents.
public static void clearSourceFolderContents(final SWTWorkbenchBot it, final String project) {
try {
try {
SWTBotTree packageExplorerTree = it.tree();
boolean _hasItems = it.tree().hasItems();
boolean _not = (!_hasItems);
if (_not) {
packageExplorerTree = it.viewByTitle("Package Explorer").bot().tree();
}
final SWTBotTreeItem srcNode = SwtBotProjectHelper.expandNode(SwtBotProjectHelper.expandNode(packageExplorerTree, project), "src");
SWTBotTreeItem[] _items = srcNode.getItems();
for (final SWTBotTreeItem source : _items) {
boolean _isDisposed = source.widget.isDisposed();
boolean _not_1 = (!_isDisposed);
if (_not_1) {
InputOutput.<SWTBotText>println(it.text());
srcNode.select(source.getText());
source.contextMenu("Delete").click();
it.shell("Delete").activate();
it.button("OK").click();
}
}
} catch (final Throwable _t) {
if (_t instanceof WidgetNotFoundException) {
final Consumer<IResource> _function = (IResource it_1) -> {
try {
it_1.delete(true, null);
} catch (Throwable _e) {
throw Exceptions.sneakyThrow(_e);
}
};
((List<IResource>) Conversions.doWrapArray(ResourcesPlugin.getWorkspace().getRoot().getProject(project).getFolder("src").members())).forEach(_function);
} else {
throw Exceptions.sneakyThrow(_t);
}
}
} catch (Throwable _e) {
throw Exceptions.sneakyThrow(_e);
}
}
use of org.eclipse.swtbot.swt.finder.widgets.SWTBotTree in project linuxtools by eclipse.
the class ImagePushSWTBotTests method openPushWizard.
private void openPushWizard() {
SWTUtils.syncExec(() -> dockerExplorerView.getCommonViewer().expandAll());
final SWTBotTreeItem imageTreeItem = SWTUtils.getTreeItem(dockerExplorerViewBot, "Test", "Images", "foo/bar");
// when opening the "Push Image..." wizard
final SWTBotTree dockerExplorerViewTreeBot = dockerExplorerViewBot.bot().tree();
dockerExplorerViewTreeBot.select(imageTreeItem);
SWTUtils.getContextMenu(dockerExplorerViewTreeBot, "Push...").click();
}
use of org.eclipse.swtbot.swt.finder.widgets.SWTBotTree in project linuxtools by eclipse.
the class SVNReporsitoriesView method discardRepository.
/**
* Select repository
*/
public void discardRepository(String repo) {
SWTBotView svnRepoView = bot.viewByTitle("SVN Repositories");
svnRepoView.show();
svnRepoView.setFocus();
SWTBotTree tree = svnRepoView.bot().tree();
tree.select(repo);
// discard
clickOnDiscardRepo(tree);
}
use of org.eclipse.swtbot.swt.finder.widgets.SWTBotTree in project linuxtools by eclipse.
the class PreferencesTest method testProfileProjectActions.
private void testProfileProjectActions(SWTWorkbenchBot bot) throws Exception {
testPreferencesPage();
// Focus on project explorer view.
// $NON-NLS-1$
SWTBotView projectExplorer = bot.viewByTitle("Project Explorer");
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(), // $NON-NLS-1$
"org.eclipse.debug.ui.launchGroup.profilee");
});
// $NON-NLS-1$
SWTBotShell shell = bot.shell("Profiling Tools Configurations");
shell.activate();
// Create new profiling configuration
SWTBotTree profilingConfigs = bot.tree();
// $NON-NLS-1$
SWTBotTree perfNode = profilingConfigs.select("Profile Timing");
// $NON-NLS-1$
perfNode.contextMenu("New").click();
// $NON-NLS-1$
bot.button("Profile").click();
bot.waitUntil(Conditions.shellCloses(shell));
// Assert that the expected tool is running.
// $NON-NLS-1$
SWTBotShell profileShell = bot.shell("Successful profile launch").activate();
assertNotNull(profileShell);
// $NON-NLS-1$
bot.button("Apply and Close").click();
bot.waitUntil(shellCloses(profileShell));
}
use of org.eclipse.swtbot.swt.finder.widgets.SWTBotTree in project linuxtools by eclipse.
the class TestUtils method openPropertyPage.
/**
* Open the property page, and activate its shell.
*/
public static SWTBotShell openPropertyPage(SWTWorkbenchBot bot, SWTBotView navigator) {
navigator.show();
// select the .repo file from the package explorer and open its properties
SWTBotTree botTree = navigator.bot().tree();
botTree.select(ICreaterepoTestConstants.REPO_NAME).contextMenu(ICreaterepoTestConstants.PROPERTIES).click();
// get a handle of the property shell
SWTBotShell propertyShell = bot.shell(String.format(ICreaterepoTestConstants.PROPERTIES_SHELL, ICreaterepoTestConstants.REPO_NAME));
propertyShell.activate();
return propertyShell;
}
Aggregations