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


Java SWTBotShell.activate方法代码示例

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


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

示例1: showPreferenceDialogWindowPreference

import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell; //导入方法依赖的package包/类
private SWTBotShell showPreferenceDialogWindowPreference() {
	ICondition condition = new DefaultCondition () {
		@Override
		public boolean test() throws Exception {
			try {
				bot.menu("Window").menu("Preferences").click();
				bot.waitUntil(new ShellActiveCondition("Preferences"), 5 * 1000);
				return true;
			} catch (Throwable e) {
			} 
			return false;
		}

		@Override
		public String getFailureMessage() {
			return "Cannot open the Preference page";
		}
	};
	bot.waitUntil(condition, 30 * 1000);
	SWTBotShell shell = bot.shell("Preferences");
	shell.activate();
	return shell;	
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:24,代码来源:GW4EPreferencePage.java

示例2: openImportProjectsWizard

import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell; //导入方法依赖的package包/类
private static void openImportProjectsWizard(SWTWorkbenchBot bot,
    String wizardCategory, String importWizardName) {
  for (int tries = 1; true; tries++) {
    SWTBotShell shell = null;
    try {
      bot.menu("File").menu("Import...").click();
      shell = bot.shell("Import");
      shell.activate();

      SwtBotTreeUtilities.waitUntilTreeHasItems(bot, bot.tree());
      SWTBotTreeItem treeItem = bot.tree().expandNode(wizardCategory);
      SwtBotTreeUtilities.waitUntilTreeItemHasChild(bot, treeItem, importWizardName);
      treeItem.select(importWizardName);
      break;
    } catch (TimeoutException e) {
      if (tries == 2) {
        throw e;
      } else if (shell != null) {
        shell.close();
      }
    }
  }
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:24,代码来源:SwtBotAppEngineActions.java

示例3: createProject

import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell; //导入方法依赖的package包/类
@Test
public void createProject() throws Exception {
	String projectName = "prjBot-001";
	
	bot.menu("File").menu("New").click();
	SWTBotShell shell = bot.shell("New");
	shell.activate();
	// From menu open File > New dialog, verify whether the dialog has been opened.
	
	bot.tree().select("Project");
	SWTBotAssert.assertEnabled(bot.button("Next >"));
	// After selecting Project, the Next button should be enabled.
	
	bot.button("Next >").click();
	bot.textWithLabel("Project name:").setText(projectName);
	SWTBotAssert.assertEnabled(bot.button("Finish"));
	// Enter the Project Name, then Finish button should be enabled.
	
	bot.button("Finish").click();
	SWTBotAssert.assertVisible(bot.tree().select(projectName));
	// Click Finish button and verify whether the project's been successfully created.
}
 
开发者ID:heartsome,项目名称:translationstudio8,代码行数:23,代码来源:CreateProjectDemo.java

示例4: handleCreationWizard

import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell; //导入方法依赖的package包/类
/**
 * @param bot
 */
public static void handleCreationWizard(SWTWorkbenchBot bot) {

	bot.activeShell().bot().button(Properties.BUTTON_NEXT).click();

	bot.textWithLabel(TEXT_WITH_LABEL_ENDPOINT_NAME).setText(ENDPOINT_NAME);
	bot.activeShell().bot().link()
			.click(IMAGE_HYPER_LINK_CREATE_NEW_PROJECT);

	SWTBotShell shell = bot.shell(Properties.SHELL_EMPTY_STRING);
	shell.activate();
	bot.button(Properties.BUTTON_NEXT).click();
	bot.textWithLabel(Properties.TEXT_WITH_LABEL_PROJECT_NAME).setText(
			PropertiesESB.ARTIFACT_MY_ESB_CONFIG_PROJECT_FOR_ENDPOINT_TEST);
	bot.button(Properties.BUTTON_FINISH).click();
	bot.textWithLabel(Properties.TEXT_WITH_LABEL_Address).setText(
			PropertiesESB.ARTIFACT_ENDPOINT_URL);
	bot.button(Properties.BUTTON_FINISH).click();

}
 
开发者ID:Tharshayene,项目名称:DevStudioUITestAutomation,代码行数:23,代码来源:EndPointCreation.java

示例5: testESBConfigProjectCreation

import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell; //导入方法依赖的package包/类
@Test
public void testESBConfigProjectCreation() throws Exception {

	assertTrue(Properties.ERROR_OPEN_DASHBOARD,
			DashBoardCreation.openDashBoard(bot));

	@SuppressWarnings({ "rawtypes", "unchecked" })
	Matcher matcherImageHyperLink = allOf(
			widgetOfType(ImageHyperlink.class),
			withText(EndPointCreation.IMAGE_HYPER_LINK));

	assertTrue(Properties.ERROR_OPEN_CREATION_WIZARD,
			DashBoardCreation.openWizard(matcherImageHyperLink, bot));

	SWTBotShell shell = bot
			.shell(EndPointCreation.SHELL_CREATE_NEW_ENDPOINT);
	shell.activate();

	EndPointCreation.handleCreationWizard(bot);

	assertTrue(EndPointCreation.checkCreatedProject(bot));

}
 
开发者ID:Tharshayene,项目名称:DevStudioUITestAutomation,代码行数:24,代码来源:EndPointTestCase.java

示例6: canLoginAdmin

import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell; //导入方法依赖的package包/类
@Test
public void canLoginAdmin() throws Exception {
    SWTBotShell loginShell = BOT.activeShell();
    loginShell.activate();
    BOT.textWithLabel("Deployment Url").setText(ADDRESS);
    BOT.textWithLabel("Username").setText(ADMIN_UNAME);
    BOT.textWithLabel("Password").setText(ADMIN_PWD);
    BOT.button("Login").click();
    BOT.waitWhile(new ICondition() {

        @Override
        public boolean test() throws Exception {
            String title = BOT.activeShell().getText();
            return title.equals("Loading Templates");
        }

        @Override
        public void init(final SWTBot bot) {
        }

        @Override
        public String getFailureMessage() {
            return "Unable to Login";
        }
    });
}
 
开发者ID:apache,项目名称:syncope,代码行数:27,代码来源:SyncopeViewTest.java

示例7: createNewOrmModelFileWizard

import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell; //导入方法依赖的package包/类
protected SWTBotShell createNewOrmModelFileWizard(String category, String parentProjectName,
    String fileType, String fileName) {
  bot.menu("File").menu("New").menu("Other...").click();

  SWTBotShell shell = bot.shell("New");
  shell.activate();

  bot.text().setText(fileType);
  bot.waitUntil(new NodeAvailableAndSelect(bot.tree(), category, fileType));

  bot.tree().expandNode(category).select(fileType);
  bot.button("Next >").click();

  bot.textWithLabel("Enter or select the parent folder:").setText(parentProjectName);
  bot.textWithLabel("File name:").setText(fileName);
  bot.button("Next >").click();

  bot.comboBox(0).setSelection("Compartment Diagram");
  // bot.comboBox("Model Object").setSelection("Compartment Diagram");
  bot.button("Finish").click();
  return shell;
}
 
开发者ID:leondart,项目名称:FRaMED,代码行数:23,代码来源:FramedComponentsAbstractTests.java

示例8: createProjectAndAssertNoErrorMarker

import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell; //导入方法依赖的package包/类
protected void createProjectAndAssertNoErrorMarker(String projectType) throws CoreException {
	SWTBotMenu fileMenu = bot.menu("File");
	SWTBotMenu newMenu = fileMenu.menu("New");
	SWTBotMenu projectMenu = newMenu.menu("Project...");
	projectMenu.click();

	SWTBotShell shell = bot.shell("New Project");
	shell.activate();
	SWTBotTreeItem xsemanticsNode = bot.tree().expandNode("Xsemantics");
	waitForTreeItems(xsemanticsNode);
	xsemanticsNode.expandNode(projectType).select();
	bot.button("Next >").click();

	bot.textWithLabel("Project name:").setText(TEST_PROJECT);

	bot.button("Finish").click();

	// creation of a project might require some time
	bot.waitUntil(shellCloses(shell), SHELL_TIMEOUT);
	assertTrue("Project doesn't exist", isProjectCreated(TEST_PROJECT));

	waitForBuild();
	assertNoErrorsInProject();
}
 
开发者ID:eclipse,项目名称:xsemantics,代码行数:25,代码来源:XsemanticsSwtbotTestBase.java

示例9: createExampleProjects

import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell; //导入方法依赖的package包/类
protected void createExampleProjects(String projectType,
		String mainProjectId) {
	SWTBotMenu fileMenu = bot.menu("File");
	SWTBotMenu newMenu = fileMenu.menu("New");
	SWTBotMenu otherMenu = newMenu.menu("Other...");
	otherMenu.click();

	SWTBotShell shell = bot.shell("New");
	shell.activate();
	SWTBotTreeItem xsemanticsNode = bot.tree().expandNode("Xsemantics");
	waitForTreeItems(xsemanticsNode);
	SWTBotTreeItem examplesNode = xsemanticsNode.expandNode("Examples");
	waitForTreeItems(examplesNode);
	examplesNode.expandNode(projectType).select();
	bot.button("Next >").click();

	bot.button("Finish").click();

	// creation of a project might require some time
	bot.waitUntil(shellCloses(shell), SHELL_TIMEOUT);
	assertTrue("Project doesn't exist", isProjectCreated(mainProjectId));
	assertTrue("Project doesn't exist", isProjectCreated(mainProjectId
			+ ".tests"));
	assertTrue("Project doesn't exist", isProjectCreated(mainProjectId
			+ ".ui"));
}
 
开发者ID:eclipse,项目名称:xsemantics,代码行数:27,代码来源:XsemanticsImportExamplesProjectWizardTests.java

示例10: beforeClass

import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell; //导入方法依赖的package包/类
@BeforeClass
public static void beforeClass() throws Exception {
	bot = new SWTWorkbenchBot();
	try {
		bot.viewByTitle("Welcome").close();
	} catch (WidgetNotFoundException e) {
		// OK, no Welcome view, that's fine :)
	}

	// Change the perspective via the Open Perspective dialog
	bot.menu("Window").menu("Open Perspective").menu("Other...").click();
	SWTBotShell openPerspectiveShell = bot.shell("Open Perspective");
	openPerspectiveShell.activate();

	// select the dialog
	bot.table().select("Plug-in Development");
	bot.button("OK").click();

	// in Luna the Error Log is not shown by default in the Plug-in Development perspective
	// bot.viewByPartName("Error Log").close();

	// in SwtBot 2.2.0 we must use viewByPartName instead of viewByTitle
	bot.viewByPartName("Problems").show();
}
 
开发者ID:LorenzoBettini,项目名称:packtpub-xtext-book-examples,代码行数:25,代码来源:SmallJavaProjectWizardTests.java

示例11: createProject

import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell; //导入方法依赖的package包/类
private void createProject(String projectType, String projectName) {
	bot.menu("File").menu("New").menu("Project...").click();

	SWTBotShell shell = bot.shell("New Project");
	shell.activate();
	bot.tree().expandNode("Xtext").select(projectType);
	bot.button("Next >").click();

	bot.textWithLabel("Project name:").setText(projectName);

	bot.button("Finish").click();

	// creation of a project might require some time
	bot.waitUntil(shellCloses(shell), 50000);
	assertTrue("Project doesn't exist", isProjectCreated(projectName));
}
 
开发者ID:LorenzoBettini,项目名称:packtpub-xtext-book-examples,代码行数:17,代码来源:SmallJavaProjectWizardTests.java

示例12: getPreferenceDialog

import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell; //导入方法依赖的package包/类
private SWTBotShell getPreferenceDialog() {
	Matcher<Shell> matcher = WidgetMatcherFactory.withText("Preferences");
	bot.waitUntil(Conditions.waitForShell(matcher));
	SWTBotShell shell = bot.shell("Preferences");
	shell.activate();
	return shell;
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:8,代码来源:GW4EPreferencePage.java

示例13: createMavenProject

import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell; //导入方法依赖的package包/类
/**
 * Create a Maven project based on an archetype.
 */
public static IProject createMavenProject(final SWTWorkbenchBot bot, String groupId,
    String artifactId, String archetypeGroupId, String archetypeArtifactId,
    String archetypeVersion, String archetypeUrl, String javaPackage) {
  bot.menu("File").menu("New").menu("Project...").click();

  SWTBotShell shell = bot.shell("New Project");
  shell.activate();

  bot.tree().expandNode("Maven").select("Maven Project");
  bot.button("Next >").click();

  // we want to specify an archetype
  bot.checkBox("Create a simple project (skip archetype selection)").deselect();
  bot.button("Next >").click();

  // open archetype dialog
  SwtBotTestingUtilities.clickButtonAndWaitForWindowChange(bot, bot.button("Add Archetype..."));

  bot.comboBox(0).setText(archetypeGroupId);
  bot.comboBox(1).setText(archetypeArtifactId);
  bot.comboBox(2).setText(archetypeVersion);
  bot.comboBox(3).setText(archetypeUrl);

  // close archetype dialog
  // After OK, it will take a minute to download
  SwtBotTestingUtilities.clickButtonAndWaitForWindowChange(bot, bot.button("OK"));

  // move to last wizard
  bot.button("Next >").click();

  // set archetype inputs
  bot.comboBoxWithLabel("Group Id:").setText(groupId);
  bot.comboBoxWithLabel("Artifact Id:").setText(artifactId);
  bot.comboBoxWithLabel("Package:").setText(javaPackage);

  SwtBotTestingUtilities.clickButtonAndWaitForWindowClose(bot, bot.button("Finish"));
  return getWorkspaceRoot().getProject("testartifact");
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:42,代码来源:SwtBotProjectActions.java

示例14: switchPerspective

import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell; //导入方法依赖的package包/类
/**
 * Switching to a new Perspective.
 *
 * @param bot
 *          to work with, must not be {@code null}
 * @param perspective
 *          the new perspective to open, must not be {@code null}
 */
public static void switchPerspective(final SWTWorkbenchBot bot, final String perspective) {
  Assert.isNotNull(bot, ARGUMENT_BOT);
  Assert.isNotNull(perspective, "perspective");
  // Change the perspective via the Open Perspective dialog
  bot.menu("Window").menu("Open Perspective").menu("Other...").click();
  final SWTBotShell shell = bot.shell("Open Perspective");
  shell.activate();

  // select the dialog
  bot.table().select(perspective);
  bot.button("OK").click();
}
 
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:21,代码来源:CoreSwtbotTools.java

示例15: openAvaloqPreferencesSection

import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell; //导入方法依赖的package包/类
/**
 * Open a specific Avaloq Prefrences Page.
 *
 * @param bot
 *          to work with, must not be {@code null}
 * @param section
 *          the name of the desired page (e.g. 'Database'), must not be {@code null}
 */
public static void openAvaloqPreferencesSection(final SWTWorkbenchBot bot, final String section) {
  Assert.isNotNull(bot, ARGUMENT_BOT);
  Assert.isNotNull(section, "section");
  bot.menu("Window").menu("Preferences").click();
  final SWTBotShell shell = bot.shell("Preferences");
  shell.activate();
  final SWTBotTreeItem item = bot.tree().getTreeItem("Avaloq");
  CoreSwtbotTools.waitForItem(bot, item);
  CoreSwtbotTools.expandNode(bot.tree(), "Avaloq").select(section);
}
 
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:19,代码来源:CoreSwtbotTools.java


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