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


Java SWTBotTreeItem.select方法代码示例

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


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

示例1: addANumericScannable

import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem; //导入方法依赖的package包/类
@Ignore("Travis does not like this one, rather a shame that")
@Test
public void addANumericScannable() throws Exception {

    SWTBotTreeItem item = bot.tree(0).getTreeItem("Experimental Conditions");
    item.select();

	bot.getDisplay().syncExec(()->viewer.addNode());

	SWTBotCCombo combo = bot.ccomboBox(0);
	assertNotNull(combo);
	combo.setSelection("a");

	assertEquals("a",   item.cell(1, 0));
	assertEquals("10.0    mm", item.cell(1, 1));

}
 
开发者ID:eclipse,项目名称:scanning,代码行数:18,代码来源:ControlTreeViewerTest.java

示例2: addAStringScannable

import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem; //导入方法依赖的package包/类
@Ignore("Travis does not like this one, rather a shame that")
@Test
public void addAStringScannable() throws Exception {

    SWTBotTreeItem item = bot.tree(0).getTreeItem("Experimental Conditions");
    item.select();

	bot.getDisplay().syncExec(()->viewer.addNode());

	SWTBotCCombo combo = bot.ccomboBox(0);
	assertNotNull(combo);
	combo.setSelection("portshutter");

	assertEquals("portshutter",   item.cell(1, 0));
	assertEquals("Open", item.cell(1, 1));

}
 
开发者ID:eclipse,项目名称:scanning,代码行数:18,代码来源:ControlTreeViewerTest.java

示例3: convertExistingProject

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

示例4: prepareConvertTo

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

示例5: openImportProjectsWizard

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

示例6: selectTreeItem

import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem; //导入方法依赖的package包/类
/**
 * Select a tree item.
 *
 * @param treeItem
 *          the tree node
 * @param name
 *          the name of the item to look for
 * @return true, if item was found and selected
 */
private static boolean selectTreeItem(final SWTBotTreeItem treeItem, final String name) {
  if (name.equals(treeItem.getText())) {
    treeItem.select();
    return true;
  }
  if (!treeItem.isExpanded()) {
    treeItem.expand();
  }
  for (SWTBotTreeItem item : treeItem.getItems()) {
    if (selectTreeItem(item, name)) {
      return true;
    }
  }
  return false;
}
 
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:25,代码来源:SwtBotWizardUtil.java

示例7: openView

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

示例8: openContextMenuForTreeItem

import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem; //导入方法依赖的package包/类
private void openContextMenuForTreeItem(final SWTBotTreeItem treeItem) {

		treeItem.select();
		Display.getDefault().syncExec(new Runnable() {

			@Override
			public void run() {
				Menu menu = orderOverviewTree.widget.getMenu();
				Point menuItemLocation = getMenuItemLocation(treeItem);
				menu.setLocation(menuItemLocation.x, menuItemLocation.y);
				menu.setVisible(true);
			}
		});
		bot.sleep(200); // remove this sleep with waitUntil context menu is open
		LOGGER.info("popup is opened: " + treeItem.getText());
	}
 
开发者ID:scenarioo,项目名称:scenarioo-example-swtbot-e4,代码行数:17,代码来源:OrderOverviewContextMenuHandler.java

示例9: getGraphmlProperties

import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem; //导入方法依赖的package包/类
public GraphModelProperties getGraphmlProperties(String folder, String pkg, String filename) {
	SWTBotTreeItem pti = getProjectTreeItem(this.projectName);
	pti.expand();

	SWTBotTreeItem fileItem = null;
	if (pkg == null) {
		fileItem = pti.expandNode(folder, filename);
	} else {
		fileItem = pti.expandNode(folder, pkg, filename);
	}

	bot.waitUntil(new isItemExpandedInTree(pti.getNode(folder)));

	fileItem.setFocus();
	fileItem.select();
	bot.waitUntil(new isItemSelectedInTree(fileItem));

	fileItem.click();

	bot.waitUntil(new isItemSelected(fileItem));

	SWTBotMenu fileMenu = bot.menu("File");
	fileMenu.menu("Properties").click();

	bot.waitUntil(Conditions.shellIsActive("Properties for " + filename));
	SWTBotShell shell = bot.shell("Properties for " + filename);
	GraphModelProperties gp = new GraphModelProperties(shell.bot(), this.projectName, folder, pkg, filename);

	return gp;
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:31,代码来源:GW4EProject.java

示例10: setupTreeForMenu

import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem; //导入方法依赖的package包/类
private SWTBotTree setupTreeForMenu(String... nodes) {
	SWTBotTree tree = getProjectTree();
	SWTBotTreeItem item = tree.expandNode(nodes);
	item.setFocus();
	item.select();
	return tree;
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:8,代码来源:GW4EProject.java

示例11: canGenerateSource

import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem; //导入方法依赖的package包/类
public SWTBotMenu canGenerateSource(boolean enabled, String... nodes) {
	SWTBotTree tree = getProjectTree();
	SWTBotTreeItem item = tree.expandNode(nodes);
	item.setFocus();
	item.select();
	SWTBotMenu menu = item.contextMenu("GW4E").contextMenu("Generate Test and Interface");
	assertEquals("Invalid state ", enabled, menu.isEnabled());
	return menu;
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:10,代码来源:GW4EProject.java

示例12: generateSource

import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem; //导入方法依赖的package包/类
public void generateSource(String... nodes) {
	SWTBotTree tree = getProjectTree();
	SWTBotTreeItem item = tree.expandNode(nodes);
	item.setFocus();
	item.select();
	SWTBotMenu menu = item.contextMenu("GW4E").contextMenu("Generate Test and Interface");
	assertEquals("Invalid state ", true, menu.isEnabled());
	Display.getDefault().asyncExec(new Runnable() {
		@Override
		public void run() {
			menu.click();
		}
	});

}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:16,代码来源:GW4EProject.java

示例13: openPropertiesPage

import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem; //导入方法依赖的package包/类
public GW4EProjectProperties openPropertiesPage ( ) {
	SWTBotTree tree = getProjectTree();
	SWTBotTreeItem item = tree.expandNode(this.projectName);
	item.setFocus();
	item.select();

	ICondition condition = new DefaultCondition () {
		@Override
		public boolean test() throws Exception {
			SWTBotTreeItem treeItem = tree.getTreeItem(projectName);
			return treeItem.isSelected();
		}

		@Override
		public String getFailureMessage() {
			return "Project " + projectName + " not selected ";
		}
		
	};
	bot.waitUntil(condition);
	bot.menu( "File").menu("Properties").click();		 
	bot.waitUntil(Conditions.shellIsActive("Properties for " + projectName));
	SWTBotShell shell = bot.shell("Properties for " + projectName).activate();
	shell.bot().tree().select("GW4E");
	bot.waitUntil(Conditions.waitForWidget(WidgetMatcherFactory.withId(	ProjectPropertyPage.PROJECT_PROPERTY_PAGE_WIDGET_ID, ProjectPropertyPage.PROJECT_PROPERTY_PAGE_WIDGET_SECURITY_LEVEL_FOR_ABSTRACT_CONTEXT)));
	return new GW4EProjectProperties(bot,shell);
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:28,代码来源:GW4EProjectPreference.java

示例14: refactorModelName

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

示例15: refactorRenameFolder

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


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