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


Java SWTBotTreeItem类代码示例

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


SWTBotTreeItem类属于org.eclipse.swtbot.swt.finder.widgets包,在下文中一共展示了SWTBotTreeItem类的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: checkValuesTree3

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

	ControlTree ct = getControlTree("control_tree3.xml");
	bot.getDisplay().syncExec(()->viewer.setControlTree(ct));

	assertEquals(2, bot.tree(0).columnCount());
	assertEquals(1, bot.tree(0).rowCount());

	assertEquals("Machine", bot.tree(0).cell(0, 0));

    SWTBotTreeItem item = bot.tree(0).getTreeItem("Machine");
	List<String> children = item.getNodes();
	assertEquals(Arrays.asList("Current"), children);

	assertEquals("Current",   item.cell(0, 0));
	assertEquals("5.0    mA", item.cell(0, 1));
}
 
开发者ID:eclipse,项目名称:scanning,代码行数:19,代码来源:ControlTreeViewerTest.java

示例4: checkSetStageXValue

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

    SWTBotTreeItem item = bot.tree(0).getTreeItem("Translations");
	assertEquals("Stage X",   item.cell(0, 0));

	SWTBotTreeItem node = item.getNode("Stage X");

	node.click(1);
    setEditorValue("10.0");
	assertEquals("10.0    mm", item.cell(0, 1));

    node.click(1);
    setEditorValue("0.0");
	assertEquals("0.0    mm", item.cell(0, 1));
}
 
开发者ID:eclipse,项目名称:scanning,代码行数:17,代码来源:ControlTreeViewerTest.java

示例5: checkSetTemperatureValue

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

    SWTBotTreeItem item = bot.tree(0).getTreeItem("Experimental Conditions");
	assertEquals("Temperature",   item.cell(0, 0));

	SWTBotTreeItem node = item.getNode("Temperature");

	node.click(1);
    setEditorValue("290.0");
	assertEquals("290.0    K", item.cell(0, 1));

    node.click(1);
    setEditorValue("295.0");
	assertEquals("295.0    K", item.cell(0, 1));
}
 
开发者ID:eclipse,项目名称:scanning,代码行数:17,代码来源:ControlTreeViewerTest.java

示例6: checkSettingScannableValue

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

	Services.getConnector().getScannable("stage_x").setPosition(1.0d);
	Services.getConnector().getScannable("stage_y").setPosition(2.0d);
	Thread.sleep(500);

	try {

	    SWTBotTreeItem item = bot.tree(0).getTreeItem("Translations");
		List<String> children = item.getNodes();
		assertEquals(Arrays.asList("Stage X", "Stage Y", "Stage Z"), children);

		assertEquals("Stage X",   item.cell(0, 0));
		assertEquals("1.0    mm", item.cell(0, 1));
		assertEquals("Stage Y",   item.cell(1, 0));
		assertEquals("2.0    mm", item.cell(1, 1));

	} finally {

		Services.getConnector().getScannable("stage_x").setPosition(0.0d);
		Services.getConnector().getScannable("stage_y").setPosition(0.0d);
		Thread.sleep(500);

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

示例7: testFilterName

import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem; //导入依赖的package包/类
@Test
public void testFilterName() throws CoreException {
	GW4EProject project = new GW4EProject(bot, PROJECT_NAME);
	String[] resources = project.createWithSharedTemplate(PROJECT_NAME);
	
	editor = bot.gefEditor(resources[0]);
	editor.show();
	OutLineView oview = new OutLineView(bot,editor);
	oview.toggleFilterOn();
	oview.setNameText("v_A"); 
	bot.waitUntil(oview.createTreeRowCountCondition (4));
	Map<String,SWTBotTreeItem> map = oview.geVisibleTreeItems ();
	
	String [] keys  = new String [] { "v_A" ,"e_v_A_to_v_A" ,"e_v_A_to_v_B", "e_v_B_to_v_A" };
	
	for (String key : keys) {
		map.remove(key);
	}		
	assertTrue("Invalid filter result (name)", map.size()==0);
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:21,代码来源:OutLineTest.java

示例8: testFilterDescription

import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem; //导入依赖的package包/类
@Test
public void testFilterDescription() throws CoreException {
	GW4EProject project = new GW4EProject(bot, PROJECT_NAME);
	String[] resources = project.createWithSharedTemplate(PROJECT_NAME);
	
	editor = bot.gefEditor(resources[0]);
	editor.show();
	
	VertexProperties gp = new VertexProperties(bot,editor);
	SWTBotGefEditPart vA = editor.getEditPart("v_A");
	 
	gp.setDescription(vA, "new description");
	
	OutLineView oview = new OutLineView(bot,editor);
	oview.toggleFilterOn();
	oview.setDescriptionText("new description"); 
	bot.waitUntil(oview.createTreeRowCountCondition (1));
	Map<String,SWTBotTreeItem> map = oview.geVisibleTreeItems ();
	
	String [] keys  = new String [] { "v_A" };
	for (String key : keys) {
		map.remove(key);
	}		
	assertTrue("Invalid filter result (description)", map.size()==0);
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:26,代码来源:OutLineTest.java

示例9: testSelectionVertex2

import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem; //导入依赖的package包/类
@Test
public void testSelectionVertex2() throws CoreException {
	GW4EProject project = new GW4EProject(bot, PROJECT_NAME);
	String[] resources = project.createWithSharedTemplate(PROJECT_NAME);
	editor = bot.gefEditor(resources[1]);
	editor.close();
	
	editor = bot.gefEditor(resources[0]);
	editor.show();

	OutLineView oview = new OutLineView(bot, editor);
	VertexProperties gp = new VertexProperties(bot, editor);
	
	oview.select("v_A");
	SWTBotGefEditPart vA = editor.getEditPart("v_A");
	oview.isSelected(vA);
	gp.assertPropertiesShown(vA);
	VertexId vertexId = new VertexId (((GWNode) vA.part().getModel()).getId());
	
	IToolbar toolbar = getToolbar();
	toolbar.delete(new UnexistingVertexCondition(vertexId,"v_A"));
	 
	Map<String,SWTBotTreeItem> map = oview.geVisibleTreeItems();
	assertNull(map.get("v_A"));
	}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:26,代码来源:ToolbarEditorTest.java

示例10: testSelectionEdge2

import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem; //导入依赖的package包/类
@Test
public void testSelectionEdge2() throws CoreException {
	GW4EProject project = new GW4EProject(bot, PROJECT_NAME);
	String[] resources = project.createWithSharedTemplate(PROJECT_NAME);
	editor = bot.gefEditor(resources[1]);
	editor.close();
	
	editor = bot.gefEditor(resources[0]);
	editor.show();

	OutLineView oview = new OutLineView(bot, editor);
	 
	VertexProperties gp = new VertexProperties(bot, editor);
	oview.select("e_to_V_A");
	SWTBotGefEditPart vA = editor.getEditPart("e_to_V_A");
	oview.isSelected(vA);
	gp.assertPropertiesShown(vA);
	
	IToolbar toolbar = getToolbar();
	toolbar.delete(new UnexistingEdgeCondition("e_to_V_A"));
	 
	Map<String,SWTBotTreeItem> map = oview.geVisibleTreeItems();
	assertNull(map.get("e_to_V_A"));
	}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:25,代码来源:ToolbarEditorTest.java

示例11: 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

示例12: 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

示例13: hasErrorsInProblemsView

import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem; //导入依赖的package包/类
public static boolean hasErrorsInProblemsView(SWTWorkbenchBot bot) {
	// Open Problems View by Window -> show view -> Problems
	bot.menu("Window").menu("Show View").menu("Problems").click();

	SWTBotView view = bot.viewByTitle("Problems");
	view.show();
	SWTBotTree tree = view.bot().tree();

	for (SWTBotTreeItem item : tree.getAllItems()) {
		String text = item.getText();
		if (text != null && text.startsWith("Errors")) {
			return true;
		}
	}

	return false;
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:18,代码来源:ProblemView.java

示例14: test

import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem; //导入依赖的package包/类
public boolean test() throws Exception {
	try {
		
		SWTBotTreeItem item = this.problemView.expandErrorItem ();
		SWTBotTreeItem[] child = item.getItems();
		for (int i = 0; i < child.length; i++) {
			if (child[i].isSelected() && child[i].row().get(0).equalsIgnoreCase(checkedItem.row().get(0))) {
				return true;
			}
		}
		retry ();
		return false;
	} catch (WidgetNotFoundException e) {
		retry ();
		return false;
	}
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:18,代码来源:IsItemSelectedInErrors.java

示例15: getUniqueTreeItem

import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem; //导入依赖的package包/类
/**
 * Given a tree that contains an entry with <code>itemName</code> and a direct child with a name
 * matching <code>subchildName</code>, return its tree item.
 *
 * This method is useful when there is the possibility of a tree having two similarly-named
 * top-level nodes.
 *
 * @param mainTree the tree
 * @param itemName the name of a top-level node in the tree
 * @param subchildName the name of a direct child of the top-level node (used to uniquely select
 *        the appropriate tree item for the given top-level node name)
 * @return the tree item corresponding to the top-level node with <code>itemName</code>that has a
 *         direct child with <code>subchildName</code>. If there are multiple tree items that
 *         satisfy this criteria, then the first one (in the UI) will be returned
 *
 * @throws WidgetNotFoundException if no such node can be found
 */
public static SWTBotTreeItem getUniqueTreeItem(final SWTBot bot, final SWTBotTree mainTree,
    String itemName, String subchildName) {
  for (SWTBotTreeItem item : mainTree.getAllItems()) {
    if (itemName.equals(item.getText())) {
      try {
        item.expand();
        waitUntilTreeHasText(bot, item);
        if (item.getNode(subchildName) != null) {
          return item;
        }
      } catch (WidgetNotFoundException ex) {
        // Ignore
      }
    }
  }

  throw new WidgetNotFoundException(
      "The " + itemName + " node with a child of " + subchildName + " must exist in the tree.");
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:37,代码来源:SwtBotTreeUtilities.java


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