use of org.eclipse.swtbot.swt.finder.results.VoidResult in project linuxtools by eclipse.
the class SWTUtils method hideMenu.
/**
* Hides the menu for the given <code>tree</code>
*
* @param tree
* the tree whose {@link Menu} should be hidden
*/
public static void hideMenu(final SWTBotTree tree) {
try {
final Menu menu = UIThreadRunnable.syncExec((Result<Menu>) () -> tree.widget.getMenu());
UIThreadRunnable.syncExec(new VoidResult() {
@Override
public void run() {
hide(menu);
}
private void hide(final Menu menu) {
menu.notifyListeners(SWT.Hide, new Event());
if (menu.getParentMenu() != null) {
hide(menu.getParentMenu());
}
}
});
} catch (WidgetNotFoundException e) {
// ignore if widget is not found, that's probably because there's no
// tree in the
// Docker Explorer view for the test that just ran.
}
}
use of org.eclipse.swtbot.swt.finder.results.VoidResult in project xtext-xtend by eclipse.
the class AbstractSwtBotTest method initialize.
@BeforeClass
public static void initialize() throws Exception {
TargetPlatformUtil.setTargetPlatform(AbstractSwtBotTest.class);
IResourcesSetupUtil.cleanWorkspace();
UIThreadRunnable.syncExec(new VoidResult() {
@Override
public void run() {
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell().forceActive();
}
});
}
use of org.eclipse.swtbot.swt.finder.results.VoidResult in project xtext-xtend by eclipse.
the class AbstractRefactoringSwtBotTest method initialize.
@BeforeClass
public static void initialize() {
try {
TargetPlatformUtil.setTargetPlatform(AbstractRefactoringSwtBotTest.class);
IResourcesSetupUtil.cleanWorkspace();
SWTWorkbenchBot _sWTWorkbenchBot = new SWTWorkbenchBot();
AbstractRefactoringSwtBotTest.bot = _sWTWorkbenchBot;
UIThreadRunnable.syncExec(new VoidResult() {
@Override
public void run() {
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell().forceActive();
}
});
SwtBotProjectHelper.newXtendProject(AbstractRefactoringSwtBotTest.bot, "test");
} catch (Throwable _e) {
throw Exceptions.sneakyThrow(_e);
}
}
Aggregations