本文整理汇总了Java中org.netbeans.jemmy.operators.JTreeOperator类的典型用法代码示例。如果您正苦于以下问题:Java JTreeOperator类的具体用法?Java JTreeOperator怎么用?Java JTreeOperator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
JTreeOperator类属于org.netbeans.jemmy.operators包,在下文中一共展示了JTreeOperator类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testCreateNewBundle
import org.netbeans.jemmy.operators.JTreeOperator; //导入依赖的package包/类
public void testCreateNewBundle() throws Exception{
//open default project
openDefaultProject();
//create new bundle in default package
pto = new ProjectsTabOperator().invoke();
prn = new ProjectRootNode(new JTreeOperator(pto), DEFAULT_PROJECT_NAME);
createNewPropertiesFile(prn);
//check that new properties file was created and is accessible via file tab
boolean result = existsFileInFilesTab(WIZARD_DEFAULT_PROPERTIES_FILE_NAME);
if (result) {
log(WIZARD_DEFAULT_PROPERTIES_FILE_NAME + ".properties file was created and was found in File explorer");
} else {
throw new Exception(WIZARD_DEFAULT_PROPERTIES_FILE_NAME + ".properties file was not found in File explorer");
}
//close Simple editor
closePropertiesFile(WIZARD_DEFAULT_PROPERTIES_FILE_NAME);
}
示例2: testCreateDatabase
import org.netbeans.jemmy.operators.JTreeOperator; //导入依赖的package包/类
public void testCreateDatabase(){
// <workaround for #112788> - FIXME
SystemAction.get(StartAction.class).performAction();
sleep(2000);
// </workaround>
JTreeOperator rtt = RuntimeTabOperator.invoke().tree();
Node n = new Node(rtt, "Databases|Java DB");
new ActionNoBlock(null, "Create Database").performPopup(n);
CreateJavaDBDatabaseOperator operator = new CreateJavaDBDatabaseOperator();
operator.setDatabaseName(DB);
operator.setUserName(USER);
operator.setPassword(PASSWORD);
operator.ok();
sleep(3000);
}
示例3: testNavigator
import org.netbeans.jemmy.operators.JTreeOperator; //导入依赖的package包/类
public void testNavigator() throws Exception{
String navigatorTestFile = "navigatorTest.css";
openFile(newFileName);
NavigatorOperator navigatorOperator = NavigatorOperator.invokeNavigator();
assertNotNull(navigatorOperator);
JTreeOperator treeOperator = navigatorOperator.getTree();
Object root = treeOperator.getRoot();
assertNotNull(root);
assertEquals("NUMBER OF ROOT CHILD", 2, treeOperator.getChildCount(root));
openFile(navigatorTestFile).setVerification(true);
treeOperator = navigatorOperator.getTree();
root = treeOperator.getRoot();
assertNotNull(root);
assertEquals("NUMBER OF ROOT CHILD", 2, treeOperator.getChildCount(root));
Object firstChild = treeOperator.getChild(root, 0);
assertEquals("NUMBER OF @MEDIA SCREEN CHILD", 2, treeOperator.getChildCount(firstChild));
Object aChild = treeOperator.getChild(firstChild, 1);
assertNotNull("A rule", aChild);
TreePath path = new TreePath(new Object[]{root, firstChild, aChild});
treeOperator.clickOnPath(path, 2);
// new EditorOperator(navigatorTestFile).
JEditorPaneOperator editorPane = new EditorOperator(navigatorTestFile).txtEditorPane();
assertEquals("CARET POSSITION ", 374, editorPane.getCaretPosition());
}
示例4: expandItem
import org.netbeans.jemmy.operators.JTreeOperator; //导入依赖的package包/类
@Override
public void expandItem(ComponentOperator oper, final int index) {
checkSupported(oper);
final JTreeOperator toper = (JTreeOperator) oper;
final MouseDriver mdriver = DriverManager.getMouseDriver(oper);
if (!toper.isExpanded(index)) {
queueTool.invokeSmoothly(new QueueTool.QueueAction<Void>("Path selecting") {
@Override
public Void launch() {
Point p = toper.getPointToClick(index);
mdriver.clickMouse(toper, p.x, p.y, 2, Operator.getDefaultMouseButton(),
0, toper.getTimeouts().
create("ComponentOperator.MouseClickTimeout"));
return null;
}
});
}
}
示例5: prepare
import org.netbeans.jemmy.operators.JTreeOperator; //导入依赖的package包/类
public void prepare(){
Node pNode = new ProjectsTabOperator().getProjectRootNode(testProjectName);
pNode.select();
pNode.performPopupAction("Properties");
jdo = new NbDialogOperator(testProjectName);
JTreeOperator cattree = new JTreeOperator(jdo);
Node cNode = new Node(cattree,"Abilities") ;
cNode.select();
JButtonOperator addButton = new JButtonOperator(jdo,"Add");
addButton.pushNoBlock();
NbDialogOperator add_abil = new NbDialogOperator("Add Ability");
JComboBoxOperator abilityCombo = new JComboBoxOperator(add_abil);
abilityCombo.clearText();
abilityCombo.typeText("Ability_"+System.currentTimeMillis());
JButtonOperator abil_okButton = new JButtonOperator(add_abil,"OK");
abil_okButton.push();
}
示例6: testContextualSearch
import org.netbeans.jemmy.operators.JTreeOperator; //导入依赖的package包/类
public void testContextualSearch() {
new HelpAction().perform();
helpWindow = new HelpOperator();
helpWindow.selectPageSearch();
helpWindow.searchFind("compile");
try {
Thread.sleep(5000);
} catch (Exception exc) {
exc.printStackTrace(getLog());
}
JTreeOperator tree = helpWindow.treeSearch();
log("Selection path=" + tree.getSelectionPath());
log("Selection count=" + tree.getSelectionCount());
if (tree.getSelectionCount() < 1) {
fail("None founded text in the help, it isn't obvious");
}
}
示例7: getTreePath
import org.netbeans.jemmy.operators.JTreeOperator; //导入依赖的package包/类
public static TreePath getTreePath(JTreeOperator treeOperator, String targetNode, NodeConverter converter) {
Stack<TreeNode> lifo = new Stack<TreeNode>();
lifo.push((TreeNode) treeOperator.getRoot());
while(!lifo.isEmpty()) {
TreeNode actNode = lifo.pop();
if(targetNode.equals(converter.getDisplayName(actNode))) {
List<TreeNode> path = new LinkedList<TreeNode>();
path.add(actNode);
actNode = actNode.getParent();
while(actNode!=null) {
path.add(0,actNode);
actNode = actNode.getParent();
}
TreeNode[] res = path.toArray(new TreeNode[path.size()]);
return new TreePath(res);
}
final Enumeration children = actNode.children();
while(children.hasMoreElements()) {
lifo.add((TreeNode)children.nextElement());
}
}
return null;
}
示例8: collapseItem
import org.netbeans.jemmy.operators.JTreeOperator; //导入依赖的package包/类
@Override
public void collapseItem(ComponentOperator oper, final int index) {
checkSupported(oper);
final JTreeOperator toper = (JTreeOperator) oper;
final MouseDriver mdriver = DriverManager.getMouseDriver(oper);
if (toper.isExpanded(index)) {
queueTool.invokeSmoothly(new QueueTool.QueueAction<Void>("Path selecting") {
@Override
public Void launch() {
Point p = toper.getPointToClick(index);
mdriver.clickMouse(toper, p.x, p.y, 2, Operator.getDefaultMouseButton(),
0, toper.getTimeouts().
create("ComponentOperator.MouseClickTimeout"));
return null;
}
});
}
}
示例9: testSuperConstructor
import org.netbeans.jemmy.operators.JTreeOperator; //导入依赖的package包/类
public void testSuperConstructor() {
openSourceFile("org.netbeans.test.java.editor.codegeneration", "testSimpleCase");
editor = new EditorOperator("testSimpleCase");
txtOper = editor.txtEditorPane();
try {
editor.requestFocus();
editor.setCaretPosition(12, 1);
GenerateCodeOperator.openDialog(GenerateCodeOperator.GENERATE_CONSTRUCTOR, editor);
GenerateConstructorOperator gco = new GenerateConstructorOperator();
JTreeOperator jto = gco.treeTreeView$ExplorerTree();
jto.selectRow(2);
gco.btOK().push();
String expected = "" +
" public testSimpleCase(ThreadGroup group, Runnable target) {\n" +
" super(group, target);\n" +
" }\n";
String expected2 = "" +
" public testSimpleCase(ThreadGroup tg, Runnable r) {\n" +
" super(tg, r);\n" +
" }\n";
waitAndCompare(expected, expected2);
} finally {
editor.close(false);
}
}
示例10: testInitFields
import org.netbeans.jemmy.operators.JTreeOperator; //导入依赖的package包/类
public void testInitFields() {
openSourceFile("org.netbeans.test.java.editor.codegeneration", "testSimpleCase");
editor = new EditorOperator("testSimpleCase");
txtOper = editor.txtEditorPane();
try {
editor.requestFocus();
editor.setCaretPosition(12, 1);
GenerateCodeOperator.openDialog(GenerateCodeOperator.GENERATE_CONSTRUCTOR, editor);
GenerateConstructorOperator gco = new GenerateConstructorOperator();
JTreeOperator jto = gco.treeTreeView$ExplorerTree2();
jto.selectRow(1);
gco.btOK().push();
String expected = "" +
" public testSimpleCase(int b) {\n" +
" this.b = b;\n" +
" }\n";
waitAndCompare(expected);
} finally {
editor.close(false);
}
}
示例11: testMultipleFiledSelection
import org.netbeans.jemmy.operators.JTreeOperator; //导入依赖的package包/类
public void testMultipleFiledSelection() {
openSourceFile("org.netbeans.test.java.editor.codegeneration", "testSimpleCase");
editor = new EditorOperator("testSimpleCase");
txtOper = editor.txtEditorPane();
try {
editor.requestFocus();
editor.setCaretPosition(12, 1);
GenerateCodeOperator.openDialog(GenerateCodeOperator.GENERATE_CONSTRUCTOR, editor);
GenerateConstructorOperator gco = new GenerateConstructorOperator();
JTreeOperator jto = gco.treeTreeView$ExplorerTree2();
jto.selectRow(0);
jto.selectRow(1);
jto.selectRow(2);
jto.selectRow(0);
gco.btOK().push();
String expected = "" +
" public testSimpleCase(int b, double c) {\n" +
" this.b = b;\n" +
" this.c = c;\n" +
" }";
waitAndCompare(expected);
} finally {
editor.close(false);
}
}
示例12: testInnerClass
import org.netbeans.jemmy.operators.JTreeOperator; //导入依赖的package包/类
public void testInnerClass() {
openSourceFile("org.netbeans.test.java.editor.codegeneration", "TestInnerClass");
editor = new EditorOperator("TestInnerClass");
txtOper = editor.txtEditorPane();
try {
editor.requestFocus();
editor.setCaretPosition(20, 1);
GenerateCodeOperator.openDialog(GenerateCodeOperator.GENERATE_CONSTRUCTOR, editor);
GenerateConstructorOperator gco = new GenerateConstructorOperator();
JTreeOperator jto = gco.treeTreeView$ExplorerTree();
jto.selectRow(0);
gco.btOK().push();
String expected = "" +
" public Inner(String afield) {\n" +
" this.afield = afield;\n" +
" }\n";
waitAndCompare(expected);
} finally {
editor.close(false);
}
}
示例13: testAvailableGettersSetters
import org.netbeans.jemmy.operators.JTreeOperator; //导入依赖的package包/类
public void testAvailableGettersSetters() {
openSourceFile("org.netbeans.test.java.editor.codegeneration", "CreateGetterSetter");
editor = new EditorOperator("CreateGetterSetter");
txtOper = editor.txtEditorPane();
try {
editor.requestFocus();
editor.setCaretPosition(11, 1);
GenerateCodeOperator.openDialog(GenerateCodeOperator.GENERATE_GETTER_SETTER,editor);
GenerateGettersAndSettersOperator ggso = new GenerateGettersAndSettersOperator(GenerateGettersAndSettersOperator.GETTERS_AND_SETTERS);
JTreeOperator jto = ggso.treeTreeView$ExplorerTree();
int rowCount = jto.getRowCount();
ggso.cancel();
assertEquals("Wrong number of rows",5,rowCount);
} finally {
editor.close(false);
}
}
示例14: testAvailableGetters
import org.netbeans.jemmy.operators.JTreeOperator; //导入依赖的package包/类
public void testAvailableGetters() {
openSourceFile("org.netbeans.test.java.editor.codegeneration", "CreateGetterSetter");
editor = new EditorOperator("CreateGetterSetter");
txtOper = editor.txtEditorPane();
try {
editor.requestFocus();
editor.setCaretPosition(11, 1);
GenerateCodeOperator.openDialog(GenerateCodeOperator.GENERATE_GETTER, editor);
GenerateGettersAndSettersOperator ggso = new GenerateGettersAndSettersOperator(GenerateGettersAndSettersOperator.GETTERS_ONLY);
JTreeOperator jto = ggso.treeTreeView$ExplorerTree();
int rowCount = jto.getRowCount();
ggso.cancel();
assertEquals("Wrong number of rows",6,rowCount);
} finally {
editor.close(false);
}
}
示例15: testAvailableSetters
import org.netbeans.jemmy.operators.JTreeOperator; //导入依赖的package包/类
public void testAvailableSetters() {
openSourceFile("org.netbeans.test.java.editor.codegeneration", "CreateGetterSetter");
editor = new EditorOperator("CreateGetterSetter");
txtOper = editor.txtEditorPane();
try {
editor.requestFocus();
editor.setCaretPosition(11, 1);
GenerateCodeOperator.openDialog(GenerateCodeOperator.GENERATE_SETTER,editor);
GenerateGettersAndSettersOperator ggso = new GenerateGettersAndSettersOperator(GenerateGettersAndSettersOperator.SETTERS_ONLY);
JTreeOperator jto = ggso.treeTreeView$ExplorerTree();
int rowCount = jto.getRowCount();
ggso.cancel();
assertEquals("Wrong number of rows",6,rowCount);
} finally {
editor.close(false);
}
}