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


Java SWTBotMenu.click方法代码示例

本文整理汇总了Java中org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu.click方法的典型用法代码示例。如果您正苦于以下问题:Java SWTBotMenu.click方法的具体用法?Java SWTBotMenu.click怎么用?Java SWTBotMenu.click使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu的用法示例。


在下文中一共展示了SWTBotMenu.click方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: removeNature

import org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu; //导入方法依赖的package包/类
public void removeNature() {
	SWTBotTree tree = setupTreeForMenu(this.projectName);
	SWTBotMenu menu = new SWTBotMenu(
			ContextMenuHelper.contextMenu(tree, new String[] { "GW4E", "Remove GW4E Nature" }));
	menu.click();

	bot.waitUntil(new DefaultCondition() {
		@Override
		public boolean test() throws Exception {
			boolean b = ClasspathManager
					.hasGW4EClassPathContainer(ResourceManager.getProject(projectName));
			return !b;
		}

		@Override
		public String getFailureMessage() {
			return "GW4E ClassPath Container not removed";
		}
	});
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:21,代码来源:GW4EProject.java

示例2: convertExistingProject

import org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu; //导入方法依赖的package包/类
public void convertExistingProject() throws CoreException {
	SWTBotTree tree = getProjectTree();
	SWTBotTreeItem item = tree.expandNode(this.projectName);
	item.setFocus();
	item.select();
	SWTBotMenu menu = item.contextMenu("Configure").contextMenu("Convert to GW4E");
	menu.click();
	bot.waitUntil(new DefaultCondition() {
		@Override
		public boolean test() throws Exception {
			boolean b = GW4ENature
					.hasGW4ENature(ResourceManager.getProject(projectName));
			return b;
		}

		@Override
		public String getFailureMessage() {
			return "GraphWalker has not GraphWalker Nature ";
		}
	});
	cleanBuild();
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:23,代码来源:GW4EProject.java

示例3: prepareConvertTo

import org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu; //导入方法依赖的package包/类
private ConvertDialog prepareConvertTo(String project, String packageRootFragment, String pkg,
		String targetFilename, String targetFormat, String... nodes) {
	SWTBotTree tree = getProjectTree();
	SWTBotTreeItem item = tree.expandNode(nodes);
	item.select();
	item.setFocus();

	SWTBotMenu menu = item.contextMenu("GW4E").contextMenu("Convert to...");
	menu.click();

	bot.waitUntil(Conditions.shellIsActive("GW4E Conversion File"));
	SWTBotShell shell = bot.shell("GW4E Conversion File");

	ConvertDialog cd = new ConvertDialog(shell);
	return cd;
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:17,代码来源:GW4EProject.java

示例4: init

import org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu; //导入方法依赖的package包/类
private void init() {
	ICondition condition = new DefaultCondition () {
		@Override
		public boolean test() throws Exception {
			SWTBotMenu menu = bot.menu("Window");
			menu = menu.menu("Show View");
			menu = menu.menu("Console");
			menu.click();
			try {
				bot.waitUntil(new ViewOpened(ConsoleView.this.bot, "Console"), 3 * 1000);
			} catch (Exception e) {
				return false;
			}
			return true;
		}

		@Override
		public String getFailureMessage() {
			return "Cannot open Console view";
		}
	};
	bot.waitUntil(condition, TIMEOUT);
	botView = getBotView();
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:25,代码来源:ConsoleView.java

示例5: producePDFInNonUIThread

import org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu; //导入方法依赖的package包/类
@Test @Ignore("not ready yet")
public void producePDFInNonUIThread() throws InterruptedException {
	
	// Open specA 
	SWTBotMenu fileMenu = bot.menu("File");
	SWTBotMenu openSpecMenu = fileMenu.menu("Open Spec");
	SWTBotMenu addNewSpecMenu = openSpecMenu.menu("Add New Spec...");
	addNewSpecMenu.click();

	bot.textWithLabel("Root-module file:").setText(specA);
	bot.button("Finish").click();
	
	// generate PDF
	SWTBotMenu pdfMenu = fileMenu.menu("Produce PDF Version");
	pdfMenu.click();
	
	// wait for the browser to show up with the generated PDF
	SWTBotEditor swtBotEditor = bot.editorById(OpenSpecHandler.TLA_EDITOR);
	Assert.assertNotNull(swtBotEditor);
	
	assertNoBackendCodeInUIThread();
}
 
开发者ID:tlaplus,项目名称:tlaplus,代码行数:23,代码来源:PDFHandlerThreadingTest.java

示例6: refactorModelName

import org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu; //导入方法依赖的package包/类
public void refactorModelName (String newName,String [] nodes) {
	SWTBotTree tree = getProjectTree();
	SWTBotTreeItem item = tree.expandNode(nodes);
	item.select();
	item.setFocus();

	SWTBotMenu menu = item.contextMenu("Refactor").contextMenu("Rename...");
	menu.click();

	bot.waitUntil(Conditions.shellIsActive("Rename Resource"));
	SWTBotShell shell = bot.shell("Rename Resource");
	
	SWTBotText text = shell.bot().textWithLabel("New name:");
	text.setText(newName);
	
	ICondition condition = new DefaultCondition () {
		@Override
		public boolean test() throws Exception {
			return shell.bot().button("OK").isEnabled();
		}

		@Override
		public String getFailureMessage() {
			return "OK button not enabled";
		}
	};
	
	bot.waitUntil(condition);
	
	shell.bot().button("OK").click();
	
	bot.waitUntil(Conditions.shellCloses(shell));
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:34,代码来源:ModelRefactoring.java

示例7: refactorRenameFolder

import org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu; //导入方法依赖的package包/类
public void refactorRenameFolder (String [] nodes, String name) {
	SWTBotTree tree = getProjectTree();
	SWTBotTreeItem item = tree.expandNode(nodes);
	item.select();
	item.setFocus();

	SWTBotMenu menu = item.contextMenu("Refactor").contextMenu("Rename...");
	menu.click();

	bot.waitUntil(Conditions.shellIsActive("Rename Package"));
	SWTBotShell shell = bot.shell("Rename Package");


	SWTBotText text = shell.bot().textWithLabel("New name:");
	text.setText(name);
	
	ICondition condition = new DefaultCondition () {
		@Override
		public boolean test() throws Exception {
			return shell.bot().button("OK").isEnabled();
		}

		@Override
		public String getFailureMessage() {
			return "OK button not enabled";
		}
	};
	
	bot.waitUntil(condition);
	
	shell.bot().button("OK").click();
	
	bot.waitUntil(Conditions.shellCloses(shell), 30 * 1000);
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:35,代码来源:ModelRefactoring.java

示例8: refactorMoveModel

import org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu; //导入方法依赖的package包/类
public void refactorMoveModel (String [] nodes,String [] destination, String name) {
	SWTBotTree tree = getProjectTree();
	SWTBotTreeItem item = tree.expandNode(nodes);
	item.select();
	item.setFocus();

	SWTBotMenu menu = item.contextMenu("Refactor").contextMenu("Move...");
	menu.click();

	bot.waitUntil(Conditions.shellIsActive("Move"));
	SWTBotShell shell = bot.shell("Move");
	
	SWTBotTree packageTree = shell.bot().treeWithLabel("Choose destination for '"+ name + "':");
	SWTBotTreeItem target = packageTree.expandNode(destination);
	target.select();
	target.setFocus();
	
	ICondition condition = new DefaultCondition () {
		@Override
		public boolean test() throws Exception {
			return shell.bot().button("OK").isEnabled();
		}

		@Override
		public String getFailureMessage() {
			return "OK button not enabled";
		}
	};
	
	bot.waitUntil(condition);
	
	shell.bot().button("OK").click();
	
	bot.waitUntil(Conditions.shellCloses(shell));
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:36,代码来源:ModelRefactoring.java

示例9: parseSpecInNonUIThread

import org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu; //导入方法依赖的package包/类
/**
 * Adds a new spec to the toolbox, opens it and tests if parsing is done on
 * a non-UI thread
 * 
 * @see Bug #103 in general/bugzilla/index.html
 */
@Test
public void parseSpecInNonUIThread() {

	// Open specA
	SWTBotMenu fileMenu = bot.menu("File");
	SWTBotMenu openSpecMenu = fileMenu.menu("Open Spec");
	SWTBotMenu addNewSpecMenu = openSpecMenu.menu("Add New Spec...");
	addNewSpecMenu.click();

	bot.textWithLabel("Root-module file:").setText(specB);
	bot.button("Finish").click();

	assertNoBackendCodeInUIThread();

	// Open specB
	addNewSpecMenu.click();

	bot.textWithLabel("Root-module file:").setText(specA);
	bot.button("Finish").click();

	assertNoBackendCodeInUIThread();

	final String specName = getSpecName(new File(specB));

	// increase timeout since farsite spec takes a long time to parse
	final long timeout = SWTBotPreferences.TIMEOUT * 4;

	// specs are created in non-UI thread asynchronously which causes a
	// delay before the menu entry becomes available
	bot.waitUntil(Conditions.waitForMenu(waitForToolboxShell(), WithText.<MenuItem> withText(specName)), timeout);

	// Go back to previous spec
	openSpecMenu.menu(specName);

	assertNoBackendCodeInUIThread();
}
 
开发者ID:tlaplus,项目名称:tlaplus,代码行数:43,代码来源:HandlerThreadingTest.java

示例10: setUp

import org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {
	super.setUp();
	
	// create a dummy spec "ToBeRenamedSpec"
	SWTBotMenu fileMenu = bot.menu("File");
	SWTBotMenu openSpecMenu = fileMenu.menu("Open Spec");
	SWTBotMenu addNewSpecMenu = openSpecMenu.menu("Add New Spec...");
	addNewSpecMenu.click();
	
	String path = System.getProperty("java.io.tmpdir") + File.separator + "RSHTest"
			+ System.currentTimeMillis();
	path += File.separator + TEST_SPEC + TLA_SUFFIX;

	bot.textWithLabel("Root-module file:").setText(path);
	bot.button("Finish").click();

	final String specName = getSpecName(new File(path));
	bot.waitUntil(Conditions.waitForMenu(bot.activeShell(), WithText.<MenuItem> withText(specName)));
	
	// create a new dummy model
	final SWTBotMenu modelMenu = bot.menu("TLC Model Checker");
	final SWTBotMenu newModelMenu = modelMenu.menu("New Model...");
	newModelMenu.click();
	bot.button("OK").click();
	bot.waitUntil(new ModelEditorOpenCondition(TEST_MODEL));
	
	// save and close model editor
	SWTBotEditor activeEditor = bot.activeEditor();
	activeEditor.saveAndClose();
	
	checkSpecAndModelExistenceAPI(TEST_SPEC);
}
 
开发者ID:tlaplus,项目名称:tlaplus,代码行数:34,代码来源:CloneModelTest.java

示例11: cloneModelMainMenu

import org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu; //导入方法依赖的package包/类
@Test
public void cloneModelMainMenu() {
	final SWTBotMenu modelMenu = bot.menu("TLC Model Checker");
	final SWTBotMenu cloneModelMenu = modelMenu.menu("Clone Model");
	final SWTBotMenu cloneModelSubMenu = cloneModelMenu.click();
	cloneModelSubMenu.menu(TEST_MODEL).click();

	bot.button("OK").click();
	bot.waitUntil(new ModelEditorOpenCondition(TEST_MODEL_RENAME));
}
 
开发者ID:tlaplus,项目名称:tlaplus,代码行数:11,代码来源:CloneModelTest.java

示例12: openSpecExplorer

import org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu; //导入方法依赖的package包/类
private void openSpecExplorer() {
	SWTBotMenu windowMenu = bot.menu("Window");
	SWTBotMenu specExplorerMenu = windowMenu.menu(SPEC_EXPLORER);
	specExplorerMenu.click();
	
	// spec context menu
	SWTBotView packageExplorerView = bot.viewByTitle(SPEC_EXPLORER);
	packageExplorerView.setFocus();
}
 
开发者ID:tlaplus,项目名称:tlaplus,代码行数:10,代码来源:RenameSpecHandlerTest.java

示例13: doNotAcceptInvalidSpecNames

import org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu; //导入方法依赖的package包/类
/**
 * Test to make sure the "Add Spec" wizard does not accept invalid spec names
 */
@Test
public void doNotAcceptInvalidSpecNames() {
	
	// Open specA 
	SWTBotMenu fileMenu = bot.menu("File");
	SWTBotMenu openSpecMenu = fileMenu.menu("Open Spec");
	SWTBotMenu addNewSpecMenu = openSpecMenu.menu("Add New Spec...");
	addNewSpecMenu.click();

	// get a handle for the button before invoking the UI (widget not found exception otherwise)
	SWTBotButton button = bot.button("Finish");
	
	// create a valid path
	String path = System.getProperty("java.io.tmpdir");
	path += File.separator + "Invalid-Name.tla";
	
	// set an invalid spec name
	bot.textWithLabel("Root-module file:").setText(path);
	
	// check if the wizard can finish
	Assert.assertTrue(
			"Finish button must not be enabled with invalid spec name",
			!button.isEnabled());
	
	//TODO could change the wizard marker/error area for the correct string too
}
 
开发者ID:tlaplus,项目名称:tlaplus,代码行数:30,代码来源:AddSpecWizardTest.java

示例14: clickContextMenuActionForTreeItem

import org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu; //导入方法依赖的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

示例15: clickContextMenuActionForTreeItem

import org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu; //导入方法依赖的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


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