本文整理汇总了Java中org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem.contextMenu方法的典型用法代码示例。如果您正苦于以下问题:Java SWTBotTreeItem.contextMenu方法的具体用法?Java SWTBotTreeItem.contextMenu怎么用?Java SWTBotTreeItem.contextMenu使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem
的用法示例。
在下文中一共展示了SWTBotTreeItem.contextMenu方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: flexDeployMenuVisible
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem; //导入方法依赖的package包/类
private static boolean flexDeployMenuVisible(IProject project) {
SWTBotTreeItem selected = SwtBotProjectActions.selectProject(
new SWTWorkbenchBot(), project.getName());
try {
selected.contextMenu("Deploy to App Engine Flexible...");
return true;
} catch (WidgetNotFoundException e) {
return false;
}
}
示例2: clickContextMenuActionForTreeItem
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem; //导入方法依赖的package包/类
private void clickContextMenuActionForTreeItem(final SWTBotTreeItem treeItem,
final ContextMenuAction contextMenuAction) {
SWTBotMenu botMenuAction = treeItem.contextMenu(contextMenuAction.getActionName());
botMenuAction.click();
closeContextMenu(botMenuAction);
bot.sleep(500);
LOGGER.info("menu action clicked and context menu closed for: " + treeItem.getText());
}
示例3: clickContextMenuActionForTreeItem
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem; //导入方法依赖的package包/类
protected void clickContextMenuActionForTreeItem(final SWTBotTree tree, final SWTBotTreeItem treeItem,
final String actionName) {
SWTBotMenu contextMenuAction = treeItem.contextMenu(actionName);
contextMenuAction.click();
closeContextMenu(contextMenuAction);
bot.sleep(500);
}
示例4: getContextMenuAndGenerateDocu
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem; //导入方法依赖的package包/类
/**
*
* @param tree
* @param treeItem
* @param actionName
* @return SWTBotMenu
*/
protected SWTBotMenu getContextMenuAndGenerateDocu(final SWTBotTree tree, final SWTBotTreeItem treeItem,
final String actionName) {
openContextMenuForTreeItem(tree, treeItem);
final SWTBotMenu menuAction = treeItem.contextMenu(actionName);
scenariooWriterHelper.writeStep("context_menu_opened", PageName.ORDER_OVERVIEW, screenshot());
return menuAction;
}
示例5: renameSpec
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem; //导入方法依赖的package包/类
/**
* @see Bug #58 in general/bugzilla/index.html
*/
@Test
public void renameSpec() throws InterruptedException {
openSpecExplorer();
SWTBotTreeItem treeItem = bot.tree().getTreeItem(TEST_SPEC + " [ " + TEST_SPEC + TLA_SUFFIX + " ]");
checkForModelExistenceUI(treeItem);
SWTBotMenu contextMenu = treeItem.contextMenu("Rename");
contextMenu.click();
// rename to ..._Copy
bot.button("OK").click();
// wait for rename to be done
bot.waitUntil(new SpecEditorOpenCondition(TEST_SPEC));
// verify (via API)
checkSpecAndModelExistenceAPI(TEST_SPEC + "_Copy");
// try to find the renamed file (via UI)
openSpecExplorer();
treeItem = bot.tree().getTreeItem(TEST_SPEC + "_Copy [ " + TEST_SPEC + TLA_SUFFIX + " ]");
/*
* try to launch the model
*/
SWTBotTreeItem modelTreeItem = checkForModelExistenceUI(treeItem);
modelTreeItem.contextMenu("Open").click();
Assert.assertNotNull("UI tree item (model) could not be found", modelTreeItem);
// register job listener who listens for the model checker job
final String modelName = UIHelper.getActiveEditor().getTitle();
final Model model = ToolboxHandle.getCurrentSpec().getAdapter(TLCSpec.class).getModel(modelName);
final IJobChangeListener listener = new DummyJobChangeListener(model);
Job.getJobManager().addJobChangeListener(listener);
// start model checking by clicking the menu. This is more robust
// compared to the f11 keystroke which can get lost when fired during
// initialization of the model editor.
bot.menu("TLC Model Checker").menu("Run model").click();
// make unit test wait for model checker job to finish
bot.waitUntil((ICondition) listener, SWTBotPreferences.TIMEOUT * 3);
// Do some unregistration prior to model deletion:
Job.getJobManager().removeJobChangeListener(listener);
// close corresponding editor if open
final IEditorPart editorWithModelOpened = model.getAdapter(ModelEditor.class);
if (editorWithModelOpened != null) {
UIHelper.runUISync(new Runnable() {
public void run() {
UIHelper.getActivePage().closeEditor(editorWithModelOpened,
false);
}
});
}
}