use of org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu in project translationstudio8 by heartsome.
the class ProjectTreeItem method ctxMenuOpenFile.
/**
* 打开当前项目中的一个 XLIFF 文件
* @param xlfFileName
* 要打开的 XLIFF 文件名称
*/
public void ctxMenuOpenFile(final String xlfFileName) {
selectFile("XLIFF", xlfFileName);
SWTBotMenu openFiles = ptv.ctxMenuOpenFile();
openFiles.isEnabled();
openFiles.click();
SWTBotEditor editor = HSBot.bot().editorByTitle(xlfFileName);
HSBot.bot().waitUntil(new IsEditorOpened(editor));
}
use of org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu in project xtext-xtend by eclipse.
the class AbstractRefactoringSwtBotTest method renameInXtendEditor.
public void renameInXtendEditor(final SWTBotEclipseEditor xtendEditor, final String newName, final String dialogName) {
final SWTBotMenu renameMenuItem = SwtBotProjectHelper.clickableContextMenu(xtendEditor, "Refactor", "Rename Element");
renameMenuItem.click();
boolean _isUseInlineRefactoring = this.testParams.isUseInlineRefactoring();
if (_isUseInlineRefactoring) {
this.waitForLinkedMode();
xtendEditor.typeText(newName);
boolean _isUsePreview = this.testParams.isUsePreview();
if (_isUsePreview) {
xtendEditor.pressShortcut(SWT.CTRL, SWT.CR);
AbstractRefactoringSwtBotTest.bot.shell(dialogName).activate();
AbstractRefactoringSwtBotTest.bot.button("OK").click();
} else {
xtendEditor.pressShortcut(KeyStroke.getInstance(SWT.LF));
}
} else {
SWTBot _bot = AbstractRefactoringSwtBotTest.bot.shell(dialogName).activate().bot();
final Procedure1<SWTBot> _function = (SWTBot it) -> {
SWTBotText _textWithLabel = it.textWithLabel("New name:");
_textWithLabel.setText(newName);
boolean _isUsePreview_1 = this.testParams.isUsePreview();
if (_isUsePreview_1) {
it.button("Preview >").click();
}
it.button("OK").click();
};
ObjectExtensions.<SWTBot>operator_doubleArrow(_bot, _function);
}
this.waitForRefactoring(xtendEditor);
}
use of org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu in project linuxtools by eclipse.
the class PreferencesTest method testPreferencesPage.
@Test
public void testPreferencesPage() {
SWTWorkbenchBot bot = new SWTWorkbenchBot();
// Set default tool for "timing" profiling.
checkDefaultPreference(PROFILING_PREFS_CATEGORY, PROFILING_PREFS_TYPE);
// Open preferences shell.
// $NON-NLS-1$
SWTBotMenu windowsMenu = bot.menu("Window");
// $NON-NLS-1$
windowsMenu.menu("Preferences").click();
// $NON-NLS-1$
SWTBotShell shell = bot.shell("Preferences");
shell.activate();
// Go to "Profiling Categories" preferences page.
bot.text().setText(PROFILING_PREFS_CATEGORY);
bot.waitUntil(new NodeAvailableAndSelect(bot.tree(), "C/C++", "Profiling", "Categories", // $NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
PROFILING_PREFS_CATEGORY));
// Get name of default tool to deselect.
String defaultToolId = ProviderFramework.getProviderIdToRun(null, PROFILING_PREFS_TYPE);
// $NON-NLS-1$
String defaultToolName = ProviderFramework.getToolInformationFromId(defaultToolId, "name");
// Workaround for BZ #344484.
deselectSelectionByName(defaultToolName, bot);
// Assert specified tool to select is what we expect and select it.
SWTBotRadio stubRadio = bot.radio(STUB_LABEL);
assertNotNull(stubRadio);
assertEquals(STUB_TOOLTIP, stubRadio.getToolTipText());
stubRadio.click();
// $NON-NLS-1$
bot.button("Apply").click();
// $NON-NLS-1$
bot.button("Apply and Close").click();
}
use of org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu in project linuxtools by eclipse.
the class TestCreateSystemtapScript method openRunConfigurations.
private static void openRunConfigurations(String scriptName) {
// Focus on project explorer view.
projectExplorer.setFocus();
new SWTBotMenu(ContextMenuHelper.contextMenu(projectExplorer.bot().tree().select(scriptName), "Run As", "Run Configurations...")).click();
}
use of org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu in project linuxtools by eclipse.
the class TestCreateSystemtapScript method clickMainMenu.
/**
* Click an item from the main Eclipse menu, with a guarantee that the main
* shell will be in focus.
* @param items The names of each item in the path to the target item to click.
* For example, to click "File->New->Project...", the items would be "File",
* "New", and "Project...".
*/
public static void clickMainMenu(String... items) {
if (items.length == 0) {
return;
}
mainShell.setFocus();
SWTBotMenu menu = bot.menu(items[0]);
for (int i = 1; i < items.length; i++) {
menu = menu.menu(items[i]);
}
menu.click();
}
Aggregations