本文整理汇总了Java中org.eclipse.swtbot.swt.finder.widgets.SWTBotCCombo.setSelection方法的典型用法代码示例。如果您正苦于以下问题:Java SWTBotCCombo.setSelection方法的具体用法?Java SWTBotCCombo.setSelection怎么用?Java SWTBotCCombo.setSelection使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.swtbot.swt.finder.widgets.SWTBotCCombo
的用法示例。
在下文中一共展示了SWTBotCCombo.setSelection方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addANumericScannable
import org.eclipse.swtbot.swt.finder.widgets.SWTBotCCombo; //导入方法依赖的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));
}
示例2: addAStringScannable
import org.eclipse.swtbot.swt.finder.widgets.SWTBotCCombo; //导入方法依赖的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));
}
示例3: selectComboPathGenerator
import org.eclipse.swtbot.swt.finder.widgets.SWTBotCCombo; //导入方法依赖的package包/类
private void selectComboPathGenerator (SWTBotTableItem tableItem,String path) {
DefaultCondition condition = new DefaultCondition() {
@Override
public boolean test() throws Exception {
try {
tableItem.click(1);
SWTBotCCombo combo = bot.ccomboBoxWithId(ModelPathGenerator.GW4E_LAUNCH_CONFIGURATION_PATH_GENERATOR_ID,ModelPathGenerator.GW4E_LAUNCH_CONFIGURATION_PATH_GENERATOR_COMBO_EDITOR);
combo.setSelection(path);
return true;
} catch (Exception e) {
return false;
}
}
@Override
public String getFailureMessage() {
return "Unable to open the path generator combo";
}
};
bot.waitUntil(condition);
}
示例4: setItem
import org.eclipse.swtbot.swt.finder.widgets.SWTBotCCombo; //导入方法依赖的package包/类
public void setItem(String value) {
selectPart(null);
selectTab(null, PROPERTIES);
SWTBotCCombo combo = bot.ccomboBoxWithId( WIDGET_ID, WIDGET_COMBO_EDGE);
combo.setSelection(value);
}
示例5: checkValuesTree4
import org.eclipse.swtbot.swt.finder.widgets.SWTBotCCombo; //导入方法依赖的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));
}