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


Java SWTBotCCombo类代码示例

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


SWTBotCCombo类属于org.eclipse.swtbot.swt.finder.widgets包,在下文中一共展示了SWTBotCCombo类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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));

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

示例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));

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

示例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);
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:22,代码来源:ModelPathGeneratorHelper.java

示例4: getItemCount

import org.eclipse.swtbot.swt.finder.widgets.SWTBotCCombo; //导入依赖的package包/类
/**
 * Gets the item count.
 *
 * @param control
 *          the control
 * @return the item count
 */
private static int getItemCount(final AbstractSWTBotControl<?> control) {
  int itemCount;
  if (control instanceof SWTBotCCombo) {
    itemCount = ((SWTBotCCombo) control).itemCount();
  } else if (control instanceof SWTBotList) {
    itemCount = ((SWTBotList) control).itemCount();
  } else if (control instanceof SWTBotCombo) {
    itemCount = ((SWTBotCombo) control).itemCount();
  } else {
    throw new WrappedException("Control not supported", null);
  }
  return itemCount;
}
 
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:21,代码来源:SwtBotControlUtils.java

示例5: 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);
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:7,代码来源:GraphProperties.java

示例6: getItem

import org.eclipse.swtbot.swt.finder.widgets.SWTBotCCombo; //导入依赖的package包/类
public String getItem() {
	selectPart(null);
	selectTab(null, PROPERTIES);
	SWTBotCCombo combo = bot.ccomboBoxWithId( WIDGET_ID,  WIDGET_COMBO_EDGE);
	return combo.getText();
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:7,代码来源:GraphProperties.java

示例7: 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));

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

示例8: getCcomboItemText

import org.eclipse.swtbot.swt.finder.widgets.SWTBotCCombo; //导入依赖的package包/类
/**
 * Returns the full text of the first CcomboItem found with the given prefix.
 * <p>
 * <em>Note</em>: Throws an AssertionError if the item could not be found.
 * </p>
 *
 * @param ccombo
 *          the ccomboBox to search in, must not be {@code null}
 * @param prefix
 *          the prefix of the item to search for, must not be {@code null}
 * @return the full name of the item as string, never {@code null}
 */
public static String getCcomboItemText(final SWTBotCCombo ccombo, final String prefix) {
  Assert.isNotNull(ccombo, "ccombo");
  Assert.isNotNull(prefix, "prefix");
  for (String ccomboItem : ccombo.items()) {
    if (ccomboItem.startsWith(prefix)) {
      return ccomboItem;
    }
  }
  throw new AssertionFailedException(NLS.bind("Must have a CcomboItem named ''{0}''.", prefix));
}
 
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:23,代码来源:CoreSwtbotTools.java


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