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


Java SWTBotTreeItem.getNode方法代码示例

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


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

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

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

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

示例4: 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 IllegalStateException 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();
        SwtBotTreeActions.waitUntilTreeHasText(bot, item);
        if (item.getNode(subchildName) != null) {
          return item;
        }
      } catch (WidgetNotFoundException e) {
        // Ignore
      }
    }
  }

  throw new IllegalStateException("The '" + itemName + "' node with a child of '" + subchildName
      + "' must exist in the tree.");
}
 
开发者ID:gwt-plugins,项目名称:gwt-eclipse-plugin,代码行数:37,代码来源:SwtBotTreeActions.java

示例5: selectProjectItem

import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem; //导入方法依赖的package包/类
/**
 * Select a file/folder by providing a parent tree, and a list of folders that leads to the
 * file/folder.
 *
 * @param item root tree item
 * @param folderPath list of folder names that lead to file
 * @return the SWTBotTreeItem of the final selected item, or {@code null} if not found
 */
public static SWTBotTreeItem selectProjectItem(SWTBotTreeItem item, String... folderPath) {
  for (String folder : folderPath) {
    if (item == null) {
      return null;
    }
    item.doubleClick();
    item = item.getNode(folder);
  }
  return item;
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:19,代码来源:SwtBotProjectActions.java

示例6: expandNode

import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem; //导入方法依赖的package包/类
/**
 * Expands the node matching the given node texts.
 * The method is copied from SWTBotTreeItem with an additional check if the node is already expanded.
 *
 * @param bot
 *          tree item bot, must not be {@code null}
 * @param nodes
 *          the text on the node, must not be {@code null} or empty
 * @return the last tree node that was expanded, never {@code null}
 */
public static SWTBotTreeItem expandNode(final SWTBotTreeItem bot, final String... nodes) {
  Assert.isNotNull(bot, ARGUMENT_BOT);
  Assert.isNotNull(nodes, ARGUMENT_NODES);
  assertArgumentIsNotEmpty(nodes, ARGUMENT_NODES);
  SWTBotTreeItem item = bot;
  for (String node : nodes) {
    item = item.getNode(node);
    if (!item.isExpanded()) {
      item.expand();
    }
  }
  return item;
}
 
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:24,代码来源:CoreSwtbotTools.java

示例7: checkForModelExistenceUI

import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem; //导入方法依赖的package包/类
private SWTBotTreeItem checkForModelExistenceUI(final SWTBotTreeItem treeItem) {
	try {
		treeItem.expand();
		SWTBotTreeItem models = treeItem.getNode("models");
		models.expand();
		return models.getNode(TEST_MODEL).select();
	} catch(AssertionFailedException e) {
		Assert.fail(e.getMessage());
	}
	return null;
}
 
开发者ID:tlaplus,项目名称:tlaplus,代码行数:12,代码来源:RenameSpecHandlerTest.java

示例8: selectProjectItem

import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem; //导入方法依赖的package包/类
/**
 * Select a file/folder by providing a parent tree, and a list folders that lead to the
 * file/folder.
 *
 * @param item Root tree item.
 * @param folderPath List of folder names that lead to file.
 * @return Returns a SWTBotTreeItem of the last name in texts.
 */
public static SWTBotTreeItem selectProjectItem(SWTBotTreeItem item, String... folderPath) {
  for (String folder : folderPath) {
    if (item == null) {
      return null;
    }
    item.doubleClick();
    item = item.getNode(folder);
  }
  return item;
}
 
开发者ID:gwt-plugins,项目名称:gwt-eclipse-plugin,代码行数:19,代码来源:SwtBotProjectActions.java

示例9: 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.getNode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。