本文整理汇总了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));
}
示例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);
}
}
示例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));
}
示例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));
}
示例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));
}