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


Java SWTBotTreeItem.getNodes方法代码示例

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


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

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

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

示例3: checkDefaultValues

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

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

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

    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("0.0    mm", item.cell(0, 1));
	assertEquals("Stage Y",   item.cell(1, 0));
	assertEquals("0.0    mm", item.cell(1, 1));
	assertEquals("Stage Z",   item.cell(2, 0));
	assertEquals("2.0    mm", item.cell(2, 1));


	assertEquals("Experimental Conditions",  bot.tree(0).cell(1, 0));
	item = bot.tree(0).getTreeItem("Experimental Conditions");
	children = item.getNodes();
	assertEquals(Arrays.asList("Temperature"), children);
	assertEquals("Temperature",   item.cell(0, 0));
	assertEquals("295.0    K", item.cell(0, 1));
}
 
开发者ID:eclipse,项目名称:scanning,代码行数:28,代码来源:ControlTreeViewerTest.java

示例4: checkValuesTree2

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

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

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

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

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

	assertEquals("X",   item.cell(0, 0));
	assertEquals("10.0    mm", item.cell(0, 1));
	assertEquals("Y",   item.cell(1, 0));
	assertEquals("10.0    mm", item.cell(1, 1));
	assertEquals("Z",   item.cell(2, 0));
	assertEquals("10.0    mm", item.cell(2, 1));


	assertEquals("Experimental Conditions",  bot.tree(0).cell(1, 0));
	item = bot.tree(0).getTreeItem("Experimental Conditions");
	children = item.getNodes();
	assertEquals(Arrays.asList("Temperature"), children);
	assertEquals("Temperature",   item.cell(0, 0));
	assertEquals("295.0    K", item.cell(0, 1));
}
 
开发者ID:eclipse,项目名称:scanning,代码行数:31,代码来源:ControlTreeViewerTest.java

示例5: checkValuesTree4

import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem; //导入方法依赖的package包/类
@Ignore("Cannot get the click to work...")
@Test
public void checkValuesTree4() throws Exception {

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

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

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

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

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

	SWTBotTreeItem node = item.getNode("Port Shutter");
	node.click(1); // Cannot get the click to work...

	SWTBotCCombo combo = bot.ccomboBox(0);
	combo.setSelection(1); // Closed

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

	assertEquals("Closed", item.cell(0, 1));

	node.click(1);
	combo = bot.ccomboBox(0);
	combo.setSelection(0); // Open

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

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

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


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