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


Java SWTWorkbenchBot.tree方法代码示例

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


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

示例1: openView

import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot; //导入方法依赖的package包/类
/**
 * Open view.
 *
 * @param bot
 *          to work with, must not be {@code null}
 * @param category
 *          the category, must not be {@code null}
 * @param view
 *          the name of the view, must not be {@code null}
 */
public static void openView(final SWTWorkbenchBot bot, final String category, final String view) {
  Assert.isNotNull(bot, ARGUMENT_BOT);
  Assert.isNotNull(category, "category");
  Assert.isNotNull(view, ARGUMENT_VIEW);
  bot.menu("Window").menu("Show View").menu("Other...").click();
  bot.shell("Show View").activate();
  final SWTBotTree tree = bot.tree();

  for (SWTBotTreeItem item : tree.getAllItems()) {
    if (category.equals(item.getText())) {
      CoreSwtbotTools.waitForItem(bot, item);
      final SWTBotTreeItem[] node = item.getItems();

      for (SWTBotTreeItem swtBotTreeItem : node) {
        if (view.equals(swtBotTreeItem.getText())) {
          swtBotTreeItem.select();
        }
      }
    }
  }
  assertTrue("View or Category found", bot.button().isEnabled());
  bot.button("OK").click();
}
 
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:34,代码来源:CoreSwtbotTools.java

示例2: createJavaProject

import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot; //导入方法依赖的package包/类
/**
 * Create a java project with the specified project name. This function opens up the Java
 * Perspective.
 *
 * @param bot The current SWTWorkbenchBot object
 * @param projectName Name of java project to be created
 */
public static void createJavaProject(SWTWorkbenchBot bot, String projectName) {
  // Open Java Perspective
  bot.perspectiveById("org.eclipse.jdt.ui.JavaPerspective").activate();

  // Open the list of new project wizards
  bot.menu("File").menu("New").menu("Project...").click();

  // Select the Java project
  SWTBotTree projectSelectionTree = bot.tree();
  SWTBotTreeItem projectSelectionTreeItem =
      SwtBotTreeActions.getUniqueTreeItem(bot, projectSelectionTree, "Java", "Java Project");
  SwtBotTreeActions.selectTreeItem(bot, projectSelectionTreeItem, "Java Project");

  bot.button("Next >").click();

  // Configure the project and then create it
  bot.textWithLabel("Project name:").setText(projectName);

  SwtBotUtils.clickButtonAndWaitForWindowChange(bot, bot.button("Finish"));
}
 
开发者ID:gwt-plugins,项目名称:gwt-eclipse-plugin,代码行数:28,代码来源:SwtBotUtils.java

示例3: createJavaProject

import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot; //导入方法依赖的package包/类
/**
 * Creates a java project with the specified project name.
 *
 * @param bot the SWTWorkbenchBot
 * @param projectName the name of the java project to create
 */
public static void createJavaProject(SWTWorkbenchBot bot, String projectName) {
  // Open Java Perspective
  bot.perspectiveById("org.eclipse.jdt.ui.JavaPerspective").activate();

  // Open the list of new project wizards
  bot.menu("File").menu("New").menu("Project...").click();

  // Select the Java project
  SWTBotTree projectSelectionTree = bot.tree();
  SWTBotTreeItem projectSelectionGoogleTreeItem =
      SwtBotTreeActions.getUniqueTreeItem(bot, projectSelectionTree, "Java", "Java Project");
  SwtBotTreeActions.selectTreeItem(bot, projectSelectionGoogleTreeItem, "Java Project");

  bot.button("Next >").click();

  // Configure the project and then create it
  bot.textWithLabel("Project name:").setText(projectName);

  SwtBotUtils.clickButtonAndWaitForWindowChange(bot, bot.button("Finish"));
}
 
开发者ID:gwt-plugins,项目名称:gwt-eclipse-plugin,代码行数:27,代码来源:SwtBotProjectActions.java

示例4: createUiBinder

import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot; //导入方法依赖的package包/类
public static void createUiBinder(final SWTWorkbenchBot bot, String projectName,
    String packageName, String name, boolean generateSampleContent, boolean generateComments) {
  // Open the list of new project wizards
  bot.menu("File").menu("New").menu("Other...").click();

  // Select the Web App project wizard
  SWTBotTree projectSelectionTree = bot.tree();
  SWTBotTreeItem projectSelectionGoogleTreeItem = SwtBotTreeActions
      .getUniqueTreeItem(bot, projectSelectionTree, "GWT Classes", "UiBinder").expand();
  SwtBotTreeActions.selectTreeItem(bot, projectSelectionGoogleTreeItem, "UiBinder");
  bot.button("Next >").click();

  // Configure the UiBinder and then create it
  String sourceFolder = projectName + "/" + SOURCE_FOLDER;
  bot.textWithLabel("Source folder:").setText(sourceFolder);
  bot.textWithLabel("Package:").setText(packageName);
  bot.textWithLabel("Name:").setText(name);

  SwtBotUtils.setCheckBox(bot.checkBox("Generate sample content"),
      generateSampleContent);
  SwtBotUtils.setCheckBox(bot.checkBox("Generate comments"), generateComments);

  SwtBotUtils.clickButtonAndWaitForWindowChange(bot, bot.button("Finish"));
}
 
开发者ID:gwt-plugins,项目名称:gwt-eclipse-plugin,代码行数:25,代码来源:SwtBotProjectActions.java

示例5: openNewMavenProject

import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot; //导入方法依赖的package包/类
public static void openNewMavenProject(SWTWorkbenchBot bot) {
  openNewOtherProjectDialog(bot);

  // filter maven options
  bot.text().setText("maven");
  bot.sleep(500);

  // click on Maven Project
  SWTBotTree tree = bot.tree();
  SWTBotTreeItem[] items = tree.getAllItems();
  SwtBotTreeActions.selectTreeItem(bot, items[0], "Maven Project");

  // move to next step
  bot.button("Next >").click();
}
 
开发者ID:gwt-plugins,项目名称:gwt-eclipse-plugin,代码行数:16,代码来源:SwtBotMenuActions.java

示例6: createWebAppProject

import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot; //导入方法依赖的package包/类
public static void createWebAppProject(final SWTWorkbenchBot bot, String projectName,
    String packageName, boolean useGwt, boolean generateSampleCode) {
  // Open Java Perspective
  bot.perspectiveById("org.eclipse.jdt.ui.JavaPerspective").activate();

  // Open the list of new project wizards
  bot.menu("File").menu("New").menu("Project...").click();

  // Select the Web App project wizard
  SWTBotTree projectSelectionTree = bot.tree();
  // GWT Application
  SWTBotTreeItem projectSelectionTreeItem = SwtBotTreeActions.getUniqueTreeItem(bot,
      projectSelectionTree, "GWT Application", "GWT Web Application Project").expand();
  SwtBotTreeActions.selectTreeItem(bot, projectSelectionTreeItem,
      "GWT Web Application Project");
  bot.button("Next >").click();

  // Configure the project and then create it
  bot.textWithLabel("Project name:").setText(projectName);
  bot.textWithLabel("Package: (e.g. com.example.myproject)").setText(packageName);

  SwtBotUtils.setCheckBox(bot.checkBox("Use GWT"), useGwt);
  SwtBotUtils.setCheckBox(bot.checkBox("Generate project sample code"),
      generateSampleCode);

  SwtBotUtils.clickButtonAndWaitForWindowChange(bot, bot.button("Finish"));

  SwtBotWorkbenchActions.waitForIdle(bot);
}
 
开发者ID:gwt-plugins,项目名称:gwt-eclipse-plugin,代码行数:30,代码来源:SwtBotProjectActions.java


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