本文整理汇总了Java中org.netbeans.jemmy.operators.JDialogOperator.pushKey方法的典型用法代码示例。如果您正苦于以下问题:Java JDialogOperator.pushKey方法的具体用法?Java JDialogOperator.pushKey怎么用?Java JDialogOperator.pushKey使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.netbeans.jemmy.operators.JDialogOperator
的用法示例。
在下文中一共展示了JDialogOperator.pushKey方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: openDialog
import org.netbeans.jemmy.operators.JDialogOperator; //导入方法依赖的package包/类
public boolean openDialog(EditorOperator operator) {
operator.pressKey(KeyEvent.VK_INSERT, KeyEvent.ALT_DOWN_MASK);
JDialogOperator jdo = new JDialogOperator();
JListOperator list = new JListOperator(jdo);
ListModel lm = list.getModel();
for (int i = 0; i < lm.getSize(); i++) {
CodeGenerator cg = (CodeGenerator) lm.getElementAt(i);
if(cg.getDisplayName().equals("Add Property...")) {
list.setSelectedIndex(i);
jdo.pushKey(KeyEvent.VK_ENTER);
new EventTool().waitNoEvent(250);
return true;
}
}
fail("Dialog not found");
return false;
}
示例2: openDialog
import org.netbeans.jemmy.operators.JDialogOperator; //导入方法依赖的package包/类
/**
* Opens requested code generation dialog
* @param type Displayname of menu item
* @param editor Operator of editor window where should be menu opened
* @return true is item is found, false elsewhere
*/
public static boolean openDialog(String type, EditorOperator editor) {
new EventTool().waitNoEvent(1000);
editor.pushKey(KeyEvent.VK_INSERT, KeyEvent.ALT_DOWN_MASK);
JDialogOperator jdo = new JDialogOperator();
new EventTool().waitNoEvent(1000);
JListOperator list = new JListOperator(jdo);
ListModel lm = list.getModel();
for (int i = 0; i < lm.getSize(); i++) {
CodeGenerator cg = (CodeGenerator) lm.getElementAt(i);
if(cg.getDisplayName().equals(type)) {
list.setSelectedIndex(i);
jdo.pushKey(KeyEvent.VK_ENTER);
new EventTool().waitNoEvent(1000);
return true;
}
}
return false;
}