本文整理汇总了Java中org.eclipse.swtbot.swt.finder.widgets.SWTBotTree.expandNode方法的典型用法代码示例。如果您正苦于以下问题:Java SWTBotTree.expandNode方法的具体用法?Java SWTBotTree.expandNode怎么用?Java SWTBotTree.expandNode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.swtbot.swt.finder.widgets.SWTBotTree
的用法示例。
在下文中一共展示了SWTBotTree.expandNode方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: convertExistingProject
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree; //导入方法依赖的package包/类
public void convertExistingProject() throws CoreException {
SWTBotTree tree = getProjectTree();
SWTBotTreeItem item = tree.expandNode(this.projectName);
item.setFocus();
item.select();
SWTBotMenu menu = item.contextMenu("Configure").contextMenu("Convert to GW4E");
menu.click();
bot.waitUntil(new DefaultCondition() {
@Override
public boolean test() throws Exception {
boolean b = GW4ENature
.hasGW4ENature(ResourceManager.getProject(projectName));
return b;
}
@Override
public String getFailureMessage() {
return "GraphWalker has not GraphWalker Nature ";
}
});
cleanBuild();
}
示例2: prepareConvertTo
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree; //导入方法依赖的package包/类
private ConvertDialog prepareConvertTo(String project, String packageRootFragment, String pkg,
String targetFilename, String targetFormat, String... nodes) {
SWTBotTree tree = getProjectTree();
SWTBotTreeItem item = tree.expandNode(nodes);
item.select();
item.setFocus();
SWTBotMenu menu = item.contextMenu("GW4E").contextMenu("Convert to...");
menu.click();
bot.waitUntil(Conditions.shellIsActive("GW4E Conversion File"));
SWTBotShell shell = bot.shell("GW4E Conversion File");
ConvertDialog cd = new ConvertDialog(shell);
return cd;
}
示例3: setupTreeForMenu
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree; //导入方法依赖的package包/类
private SWTBotTree setupTreeForMenu(String... nodes) {
SWTBotTree tree = getProjectTree();
SWTBotTreeItem item = tree.expandNode(nodes);
item.setFocus();
item.select();
return tree;
}
示例4: canGenerateSource
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree; //导入方法依赖的package包/类
public SWTBotMenu canGenerateSource(boolean enabled, String... nodes) {
SWTBotTree tree = getProjectTree();
SWTBotTreeItem item = tree.expandNode(nodes);
item.setFocus();
item.select();
SWTBotMenu menu = item.contextMenu("GW4E").contextMenu("Generate Test and Interface");
assertEquals("Invalid state ", enabled, menu.isEnabled());
return menu;
}
示例5: generateSource
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree; //导入方法依赖的package包/类
public void generateSource(String... nodes) {
SWTBotTree tree = getProjectTree();
SWTBotTreeItem item = tree.expandNode(nodes);
item.setFocus();
item.select();
SWTBotMenu menu = item.contextMenu("GW4E").contextMenu("Generate Test and Interface");
assertEquals("Invalid state ", true, menu.isEnabled());
Display.getDefault().asyncExec(new Runnable() {
@Override
public void run() {
menu.click();
}
});
}
示例6: openPropertiesPage
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree; //导入方法依赖的package包/类
public GW4EProjectProperties openPropertiesPage ( ) {
SWTBotTree tree = getProjectTree();
SWTBotTreeItem item = tree.expandNode(this.projectName);
item.setFocus();
item.select();
ICondition condition = new DefaultCondition () {
@Override
public boolean test() throws Exception {
SWTBotTreeItem treeItem = tree.getTreeItem(projectName);
return treeItem.isSelected();
}
@Override
public String getFailureMessage() {
return "Project " + projectName + " not selected ";
}
};
bot.waitUntil(condition);
bot.menu( "File").menu("Properties").click();
bot.waitUntil(Conditions.shellIsActive("Properties for " + projectName));
SWTBotShell shell = bot.shell("Properties for " + projectName).activate();
shell.bot().tree().select("GW4E");
bot.waitUntil(Conditions.waitForWidget(WidgetMatcherFactory.withId( ProjectPropertyPage.PROJECT_PROPERTY_PAGE_WIDGET_ID, ProjectPropertyPage.PROJECT_PROPERTY_PAGE_WIDGET_SECURITY_LEVEL_FOR_ABSTRACT_CONTEXT)));
return new GW4EProjectProperties(bot,shell);
}
示例7: showConsolePreference
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree; //导入方法依赖的package包/类
private void showConsolePreference(SWTBotShell shell) {
SWTBotTree tree = bot.tree().select("Run/Debug");
tree.expandNode("Run/Debug", true);
SWTBotTreeItem[] items = tree.getAllItems();
for (SWTBotTreeItem swtBotTreeItem : items) {
if (swtBotTreeItem.getText().equalsIgnoreCase("Run/Debug")) {
swtBotTreeItem.getNode("Console").select();
}
}
try {
int max = 10;
for (int i = 0; i < max; i++) {
SWTBotCheckBox button = bot.checkBox(i);
if (button.getText().equalsIgnoreCase("&Limit console output")) {
if (button.isChecked()) {
button.click();
break;
}
}
}
} catch (Exception e) {
}
String name = "OK";
if (GW4EPlatform.isEclipse47()) name = "Apply and Close";
bot.button(name).click();
}
示例8: refactorModelName
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree; //导入方法依赖的package包/类
public void refactorModelName (String newName,String [] nodes) {
SWTBotTree tree = getProjectTree();
SWTBotTreeItem item = tree.expandNode(nodes);
item.select();
item.setFocus();
SWTBotMenu menu = item.contextMenu("Refactor").contextMenu("Rename...");
menu.click();
bot.waitUntil(Conditions.shellIsActive("Rename Resource"));
SWTBotShell shell = bot.shell("Rename Resource");
SWTBotText text = shell.bot().textWithLabel("New name:");
text.setText(newName);
ICondition condition = new DefaultCondition () {
@Override
public boolean test() throws Exception {
return shell.bot().button("OK").isEnabled();
}
@Override
public String getFailureMessage() {
return "OK button not enabled";
}
};
bot.waitUntil(condition);
shell.bot().button("OK").click();
bot.waitUntil(Conditions.shellCloses(shell));
}
示例9: refactorRenameFolder
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree; //导入方法依赖的package包/类
public void refactorRenameFolder (String [] nodes, String name) {
SWTBotTree tree = getProjectTree();
SWTBotTreeItem item = tree.expandNode(nodes);
item.select();
item.setFocus();
SWTBotMenu menu = item.contextMenu("Refactor").contextMenu("Rename...");
menu.click();
bot.waitUntil(Conditions.shellIsActive("Rename Package"));
SWTBotShell shell = bot.shell("Rename Package");
SWTBotText text = shell.bot().textWithLabel("New name:");
text.setText(name);
ICondition condition = new DefaultCondition () {
@Override
public boolean test() throws Exception {
return shell.bot().button("OK").isEnabled();
}
@Override
public String getFailureMessage() {
return "OK button not enabled";
}
};
bot.waitUntil(condition);
shell.bot().button("OK").click();
bot.waitUntil(Conditions.shellCloses(shell), 30 * 1000);
}
示例10: refactorMoveModel
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree; //导入方法依赖的package包/类
public void refactorMoveModel (String [] nodes,String [] destination, String name) {
SWTBotTree tree = getProjectTree();
SWTBotTreeItem item = tree.expandNode(nodes);
item.select();
item.setFocus();
SWTBotMenu menu = item.contextMenu("Refactor").contextMenu("Move...");
menu.click();
bot.waitUntil(Conditions.shellIsActive("Move"));
SWTBotShell shell = bot.shell("Move");
SWTBotTree packageTree = shell.bot().treeWithLabel("Choose destination for '"+ name + "':");
SWTBotTreeItem target = packageTree.expandNode(destination);
target.select();
target.setFocus();
ICondition condition = new DefaultCondition () {
@Override
public boolean test() throws Exception {
return shell.bot().button("OK").isEnabled();
}
@Override
public String getFailureMessage() {
return "OK button not enabled";
}
};
bot.waitUntil(condition);
shell.bot().button("OK").click();
bot.waitUntil(Conditions.shellCloses(shell));
}
示例11: testUpdatePathGeneratorInSourceFileFromMenu
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree; //导入方法依赖的package包/类
@Test
public void testUpdatePathGeneratorInSourceFileFromMenu () throws CoreException, IOException, InterruptedException {
System.out.println("XXXXXXXXXXXXXXXXXXXX testUpdatePathGeneratorInSourceFileFromMenu");
GW4EProject project = new GW4EProject(bot, gwproject);
project.createProjectWithoutError( TEST_RESOURCE_FOLDER, PACKAGE_NAME, graphMLFilename);
String targetFormat="test";
String checkTestBox = "Java Test Based";
FileParameters fp = FileParameters.create("java");
String [] contexts = new String [0];
ICondition convertPageCompletedCondition = new DefaultCondition () {
@Override
public boolean test() throws Exception {
boolean b = project.prepareconvertTo(
fp.getProject(),
fp.getPackageFragmentRoot(),
fp.getPackage(),
fp.getTargetFilename(),
targetFormat,
checkTestBox,
"e_StartBrowser",
"v_ShoppingCart",
"e_ShoppingCart",
contexts,
fp.getGraphmlFilePath());
return b;
}
@Override
public String getFailureMessage() {
return "Unable to complete the wizard page.";
}
};
bot.waitUntil(convertPageCompletedCondition);
IProject pj = ResourceManager.getProject(fp.getProject());
bot.waitUntil(new PathFoundCondition(pj,fp.getPath()),15000);
bot.waitUntil(new EditorOpenedCondition(bot, fp.getElementName()),15000);
String policiesFileName = PreferenceManager.getBuildPoliciesFileName(gwproject);
IPath path = new Path (gwproject).append(TEST_RESOURCE_FOLDER).append(PACKAGE_NAME).append(policiesFileName);
IFile buildPolicyFile = (IFile) ResourceManager.getResource(path.toString());
project.setPathGenerator (buildPolicyFile , graphMLFilename, NoBuildRequiredException.SYNCH);
SWTBotTree tree = project.getProjectTree();
String[] nodes = new String[3];
nodes[0] = gwproject;
nodes[1] = "src/main/java";
nodes[2] = "pkgname";
SWTBotTreeItem item = tree.expandNode(nodes);
item.setFocus();
item.select();
Display.getDefault().syncExec(new Runnable () {
@Override
public void run() {
SWTBotMenu menu =item.contextMenu("GW4E").contextMenu("Synchronize Build Policies Files");
menu.click();
}
});
String expectedValue = "AStarPath(ReachedVertex(v_ShoppingCart));I;RandomPath(EdgeCoverage(100));I;RandomPath(TimeDuration(30));I;random(edge_coverage(100));I;";
PropertyValueCondition condition = new PropertyValueCondition(buildPolicyFile,graphMLFilename,expectedValue);
bot.waitUntil(condition);
}
示例12: enterDestination
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree; //导入方法依赖的package包/类
public void enterDestination (String targetFilename, String targetFilenamefullpath, String ... nodeToExpand) {
ICondition nodeSelectedCondition = new DefaultCondition () {
@Override
public boolean test() throws Exception {
try {
SWTBotTree tree = bot.treeWithId(FolderSelectionGroup.GW4E_CONVERSION_TREE,FolderSelectionGroup.GW4E_CONVERSION_TREE);
if (tree.isEnabled()) {
tree.setFocus();
SWTBotTreeItem item = tree.expandNode(nodeToExpand);
item.setFocus();
item.select();
}
return true;
} catch (Throwable e) {
return false;
}
}
@Override
public String getFailureMessage() {
String nodeMsg = "";
for (int i = 0; i < nodeToExpand.length; i++) {
nodeMsg = nodeMsg + "/" + nodeToExpand[i] ;
}
String msg = "Unable to expand nodes " + nodeMsg ;
return msg;
}
};
bot.waitUntil(nodeSelectedCondition);
SWTBotText textFile = bot.textWithLabel("Convert to file");
if(textFile.isEnabled()) {
textFile.setText(targetFilename);
}
textFile = bot.textWithLabel("Output file");
String text = textFile.getText();
org.junit.Assert.assertEquals (targetFilenamefullpath, text);
}
示例13: createPackage
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree; //导入方法依赖的package包/类
public void createPackage (String [] nodes,String [] parent, String name , String pkg) {
SWTBotTree tree = getProjectTree();
SWTBotTreeItem item = tree.expandNode(nodes);
item.select();
item.setFocus();
SWTBotMenu menu = item.contextMenu("Refactor").contextMenu("Move...");
menu.click();
bot.waitUntil(Conditions.shellIsActive("Move"));
SWTBotShell shell = bot.shell("Move");
SWTBotTree packageTree = shell.bot().treeWithLabel("Choose destination for '"+ name + "':");
SWTBotTreeItem target = packageTree.expandNode(parent);
target.select();
target.setFocus();
shell.bot().button("Create Package...").click();
bot.waitUntil(Conditions.shellIsActive("New Java Package"));
SWTBotShell shellNewPackage = bot.shell("New Java Package");
SWTBotText text = shellNewPackage.bot().textWithLabel("Name:");
text.setText(pkg);
ICondition condition = new DefaultCondition () {
@Override
public boolean test() throws Exception {
return shellNewPackage.bot().button("Finish").isEnabled();
}
@Override
public String getFailureMessage() {
return "Finish button not enabled";
}
};
bot.waitUntil(condition);
shellNewPackage.bot().button("Finish").click();
bot.waitUntil(Conditions.shellCloses(shellNewPackage));
shell.bot().button("Cancel").click();
}