当前位置: 首页>>代码示例>>Java>>正文


Java SWTBotTreeItem.contextMenu方法代码示例

本文整理汇总了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;
  }
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:11,代码来源:FlexDeployCommandHandlerTest.java

示例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());
}
 
开发者ID:scenarioo,项目名称:scenarioo-example-swtbot-e4,代码行数:9,代码来源:OrderOverviewContextMenuHandler.java

示例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);
}
 
开发者ID:scenarioo,项目名称:scenarioo-example-swtbot-e4,代码行数:8,代码来源:ScenariooTestWrapper.java

示例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;
}
 
开发者ID:scenarioo,项目名称:scenarioo-example-swtbot-e4,代码行数:17,代码来源:ScenariooTestWrapper.java

示例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);
			}
		});
	}
}
 
开发者ID:tlaplus,项目名称:tlaplus,代码行数:62,代码来源:RenameSpecHandlerTest.java


注:本文中的org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem.contextMenu方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。