本文整理汇总了Java中org.netbeans.jemmy.operators.JTreeOperator.selectRow方法的典型用法代码示例。如果您正苦于以下问题:Java JTreeOperator.selectRow方法的具体用法?Java JTreeOperator.selectRow怎么用?Java JTreeOperator.selectRow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.netbeans.jemmy.operators.JTreeOperator
的用法示例。
在下文中一共展示了JTreeOperator.selectRow方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testOpenOnSelecting
import org.netbeans.jemmy.operators.JTreeOperator; //导入方法依赖的package包/类
public void testOpenOnSelecting(){
browseChild = false;
findUsages("fu", "FindSubtype", 47, 19, FIND_USAGES | NOT_SEARCH_IN_COMMENTS);
browseChild = true;
RefactoringResultOperator result = RefactoringResultOperator.getFindUsagesResult();
if (!result.physicalIsSelected()) {
result.physical();
}
JTreeOperator preview = new JTreeOperator(result.getPreviewTree());
preview.selectRow(7);
new EventTool().waitNoEvent(2000);
String file = getFileForSelectedNode(preview);
TreePath selectionPath = preview.getSelectionPath();
preview.clickOnPath(selectionPath, 2);
new EventTool().waitNoEvent(2000);
EditorOperator edt = new EditorOperator(file);
edt.verify();
}
示例2: 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);
}
}
示例3: 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);
}
}
示例4: 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);
}
}
示例5: 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);
}
}
示例6: testPrimitiveType
import org.netbeans.jemmy.operators.JTreeOperator; //导入方法依赖的package包/类
public void testPrimitiveType() {
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();
jto.selectRow(2);
ggso.generate();
String expected = "" +
" public int getNum() {\n"+
" return num;\n"+
" }\n"+
"\n"+
" public void setNum(int num) {\n"+
" this.num = num;\n"+
" }\n";
waitAndCompare(expected);
} finally {
editor.close(false);
}
}
示例7: testObjectType
import org.netbeans.jemmy.operators.JTreeOperator; //导入方法依赖的package包/类
public void testObjectType() {
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();
jto.selectRow(4);
ggso.generate();
String expected = "" +
" public List<? extends Thread> getThreads() {\n"+
" return threads;\n"+
" }\n"+
"\n"+
" public void setThreads(List<? extends Thread> threads) {\n"+
" this.threads = threads;\n"+
" }\n";
waitAndCompare(expected);
} finally {
editor.close(false);
}
}
示例8: testBooleanType
import org.netbeans.jemmy.operators.JTreeOperator; //导入方法依赖的package包/类
public void testBooleanType() {
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();
jto.selectRow(1);
ggso.generate();
String expected = "" +
" public boolean isBool() {\n"+
" return bool;\n"+
" }\n"+
"\n"+
" public void setBool(boolean bool) {\n"+
" this.bool = bool;\n"+
" }\n";
waitAndCompare(expected);
} finally {
editor.close(false);
}
}
示例9: testStaticType
import org.netbeans.jemmy.operators.JTreeOperator; //导入方法依赖的package包/类
public void testStaticType() {
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();
jto.selectRow(3);
ggso.generate();
String expected = "" +
" public static int getStatField() {\n"+
" return statField;\n"+
" }\n"+
"\n"+
" public static void setStatField(int statField) {\n"+
" CreateGetterSetter.statField = statField;\n"+
" }\n";
waitAndCompare(expected);
} finally {
editor.close(false);
}
}
示例10: testArray
import org.netbeans.jemmy.operators.JTreeOperator; //导入方法依赖的package包/类
public void testArray() {
openSourceFile("org.netbeans.test.java.editor.codegeneration", "CreateGetterSetter");
editor = new EditorOperator("CreateGetterSetter");
txtOper = editor.txtEditorPane();
try {
editor.requestFocus();
editor.setCaretPosition(11, 1);
editor.txtEditorPane().typeText("int [] pole;");
GenerateCodeOperator.openDialog(GenerateCodeOperator.GENERATE_GETTER_SETTER, editor);
GenerateGettersAndSettersOperator ggso = new GenerateGettersAndSettersOperator(GenerateGettersAndSettersOperator.GETTERS_AND_SETTERS);
JTreeOperator jto = ggso.treeTreeView$ExplorerTree();
jto.selectRow(3);
ggso.generate();
String expected = "" +
" public int[] getPole() {\n"+
" return pole;\n"+
" }\n"+
"\n"+
" public void setPole(int[] pole) {\n"+
" this.pole = pole;\n"+
" }\n";
waitAndCompare(expected);
} finally {
editor.close(false);
}
}
示例11: selectHintNode
import org.netbeans.jemmy.operators.JTreeOperator; //导入方法依赖的package包/类
protected void selectHintNode(JTreeOperator jto, String category, String hintName) {
int i = 0;
for (i = 0; i < jto.getRowCount(); i++) {
jto.selectRow(i);
jto.collapseRow(i);
Object lastSelectedPathComponent = jto.getLastSelectedPathComponent();
Object userObject = ((DefaultMutableTreeNode) lastSelectedPathComponent).getUserObject();
String fileName = ((FileObject) userObject).getName();
if (fileName.equals(category)) {
break;
}
}
assertTrue("Category "+category+" not found", i < jto.getRowCount());
jto.expandRow(i);
Object root = jto.getLastSelectedPathComponent();
for(int j = 0;j<jto.getChildCount(root);j++) {
DefaultMutableTreeNode child = (DefaultMutableTreeNode)jto.getChild(root, j);
String displayName = ((AbstractHint) child.getUserObject()).getDisplayName();
if(displayName.equals(hintName)) {
jto.selectRow(i + j + 1);
return;
}
}
assertTrue("Hint "+hintName+" not found", false);
}
示例12: testIssue112613
import org.netbeans.jemmy.operators.JTreeOperator; //导入方法依赖的package包/类
public void testIssue112613() {
openSourceFile("org.netbeans.test.java.editor.codegeneration", "test112613");
editor = new EditorOperator("test112613");
txtOper = editor.txtEditorPane();
try {
editor.requestFocus();
editor.setCaretPosition(18, 5);
assertTrue("Expected items are not pressent",GenerateCodeOperator.checkItems(editor, GenerateCodeOperator.GENERATE_CONSTRUCTOR, GenerateCodeOperator.OVERRIDE_METHOD));
} finally {
editor.close(false);
}
openSourceFile("org.netbeans.test.java.editor.codegeneration", "test112613b");
editor = new EditorOperator("test112613b");
txtOper = editor.txtEditorPane();
try {
editor.requestFocus();
editor.setCaretPosition(17, 1);
GenerateCodeOperator.openDialog(GenerateCodeOperator.IMPLEMENT_METHOD, editor);
ImplementMethodsOperator imo = new ImplementMethodsOperator();
JTreeOperator jto = imo.treeTreeView$ExplorerTree();
jto.selectRow(1);
imo.btGenerate().push();
String expected = "" +
" public void m() {\n" +
" throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n" +
" }\n";
waitAndCompare(expected);
} finally {
editor.close(false);
}
}
示例13: testMoreIfaces
import org.netbeans.jemmy.operators.JTreeOperator; //导入方法依赖的package包/类
public void testMoreIfaces() {
openSourceFile("org.netbeans.test.java.editor.codegeneration", "testMoreIfaces");
editor = new EditorOperator("testMoreIfaces");
txtOper = editor.txtEditorPane();
try {
editor.requestFocus();
editor.setCaretPosition(7, 5);
GenerateCodeOperator.openDialog(GenerateCodeOperator.IMPLEMENT_METHOD, editor);
ImplementMethodsOperator imo = new ImplementMethodsOperator();
JTreeOperator jto = imo.treeTreeView$ExplorerTree();
jto.expandRow(4);
jto.selectRow(1);
jto.selectRow(5);
imo.btGenerate().push();
String expected = "" +
" @Override\n"+
" public int getColumnCount() {\n" +
" throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n" +
" }\n" +
"\n" +
" @Override\n"+
" public void run() {\n" +
" throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n" +
" }\n";
waitAndCompare(expected);
} finally {
editor.close(false);
}
}
示例14: testEqualsOnly
import org.netbeans.jemmy.operators.JTreeOperator; //导入方法依赖的package包/类
public void testEqualsOnly() {
openSourceFile("org.netbeans.test.java.editor.codegeneration", "testEqualsHashcode");
editor = new EditorOperator("testEqualsHashcode");
txtOper = editor.txtEditorPane();
try {
editor.requestFocus();
editor.setCaretPosition(14, 5);
GenerateCodeOperator.openDialog(GenerateCodeOperator.GENERATE_EQUALS, editor);
GenerateEqualsOperator geo = new GenerateEqualsOperator();
JTreeOperator jto = geo.equalsTreeOperator();
jto.selectRow(0);
jto.selectRow(2);
geo.generate();
String expected = "" +
" @Override\n" +
" public boolean equals(Object obj) {\n" +
" if (obj == null) {\n" +
" return false;\n" +
" }\n" +
" if (getClass() != obj.getClass()) {\n" +
" return false;\n" +
" }\n" +
" final testEqualsHashcode other = (testEqualsHashcode) obj;\n" +
" if (!Objects.equals(this.a, other.a)) {\n"+
" return false;\n"+
" }\n"+
" if (!Objects.equals(this.c, other.c)) {\n"+
" return false;\n"+
" }\n"+
" return true;\n" +
" }\n" +
"\n";
waitAndCompare(expected);
} finally {
editor.close(false);
}
}
示例15: testInitFieldAndSuper
import org.netbeans.jemmy.operators.JTreeOperator; //导入方法依赖的package包/类
public void testInitFieldAndSuper() {
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(7);
jto = gco.treeTreeView$ExplorerTree2();
jto.selectRow(2);
gco.btOK().push();
String expected = "" +
" public testSimpleCase(double c, ThreadGroup group, Runnable target, String name, long stackSize) {\n" +
" super(group, target, name, stackSize);\n" +
" this.c = c;\n" +
" }\n";
String expected2 = "" +
" public testSimpleCase(double c, ThreadGroup tg, Runnable r, String string, long l) {\n" +
" super(tg, r, string, l);\n" +
" this.c = c;\n" +
" }\n";
waitAndCompare(expected, expected2);
} finally {
editor.close(false);
}
}