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


Java JEditorPaneOperator.typeText方法代码示例

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


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

示例1: setUp

import org.netbeans.jemmy.operators.JEditorPaneOperator; //导入方法依赖的package包/类
@Override
public void setUp() throws Exception {
    System.out.println("### " + getName() + " ###");
    openDataProjects("SampleProject");
    JavaNode lrTestClass = new JavaNode(new SourcePackagesNode("SampleProject"), "sample1.outline|TestOutline.java");
    lrTestClass.open();
    EditorOperator eo = new EditorOperator("TestOutline.java");
    eo.setCaretPosition(67, 1);
    new ToggleBreakpointAction().perform();
    String windowMenu = Bundle.getStringTrimmed("org.netbeans.core.windows.resources.Bundle", "Menu/Window");
    String debugMenu = Bundle.getStringTrimmed("org.netbeans.modules.debugger.resources.Bundle", "Menu/Window/Debug");
    String watchesItem = Bundle.getStringTrimmed("org.netbeans.modules.debugger.ui.actions.Bundle", "CTL_WatchesAction");
    new Action(windowMenu + "|" + debugMenu + "|" + watchesItem, null).perform();
    String debug = Bundle.getStringTrimmed("org.netbeans.modules.project.ui.Bundle", "Menu/RunProject");
    String newWatch = Bundle.getStringTrimmed("org.netbeans.modules.debugger.ui.actions.Bundle", "CTL_New_Watch");
    for (int i = 0; i < 3; i++) {
        new ActionNoBlock(debug + "|" + newWatch, null).performMenu();
        NbDialogOperator dia = new NbDialogOperator(Bundle.getStringTrimmed("org.netbeans.modules.debugger.ui.actions.Bundle", "CTL_WatchDialog_Title"));
        JEditorPaneOperator txtWatch = new JEditorPaneOperator(dia);
        txtWatch.typeText("test");
        dia.ok();
    }
    new DebugJavaFileAction().perform(lrTestClass);
    MainWindowOperator.getDefault().waitStatusText("stopped at");
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:26,代码来源:OutlineOperatorTest.java

示例2: testFor

import org.netbeans.jemmy.operators.JEditorPaneOperator; //导入方法依赖的package包/类
public void testFor() throws IOException {
    EditorOperator oper = null;
    try {
        openSourceFile("org.netbeans.test.java.editor.codetemplates", "Main");
        oper = new EditorOperator("Main");
        JEditorPaneOperator txtOper = oper.txtEditorPane();
        oper.setCaretPosition(6, 9);
        txtOper.typeText("fori");
        txtOper.pressKey(KeyEvent.VK_TAB);
        oper.setCaretPosition(9, 10);
        txtOper.typeText("whilen");
        txtOper.pressKey(KeyEvent.VK_TAB);
        compareGoldenFile(oper);
    } finally {
        if (oper != null) {
            oper.closeDiscardAll();
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:20,代码来源:CodeTemplatesTest.java

示例3: testExperessionOnLeftSide

import org.netbeans.jemmy.operators.JEditorPaneOperator; //导入方法依赖的package包/类
public void testExperessionOnLeftSide() {
    final String abbrev = "fore";
    EditorOperator editor = null;
    try {
        openSourceFile("org.netbeans.test.java.editor.codetemplates", "Main");
        editor = new EditorOperator("Main");
        JEditorPaneOperator jepo = editor.txtEditorPane();
        editor.setCaretPosition(4, 1);
        jepo.typeText("static java.util.List<String> a;static java.util.List<Integer> b;");
        useTemplateAt(editor, 6, 9, abbrev);
        jepo.pressKey(KeyEvent.VK_TAB);
        jepo.typeText("b");
        checkContentOfEditorRegexp(editor, ".*for \\(Integer integer \\: b\\) \\{.*");
    } finally {
        editor.closeDiscard();
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:18,代码来源:CodeTemplatesTest.java

示例4: testSynchronizedBlock

import org.netbeans.jemmy.operators.JEditorPaneOperator; //导入方法依赖的package包/类
public void testSynchronizedBlock() {
    final String abbrev = "form";
    String regExp = ".*for \\(Map\\.Entry<Object, Object> en \\: m\\.entrySet\\(\\)\\) \\{.*";
    EditorOperator editor = null;
    try {
        openSourceFile("org.netbeans.test.java.editor.codetemplates", "Main");
        editor = new EditorOperator("Main");
        useTemplateAt(editor, 6, 9, abbrev);
        checkContentOfEditorRegexp(editor, regExp);
        JEditorPaneOperator jepo = editor.txtEditorPane();
        assertEquals("Text is not selected", "en", jepo.getSelectedText());
        assertEquals("Wrong start selection position ", 159, jepo.getSelectionStart());
        assertEquals("Wrong end selection position", 161, jepo.getSelectionEnd());

        jepo.typeText("var");
        checkContentOfEditorRegexp(editor, ".*var \\:.*var\\.getKey.*var\\.getValue.*");
        jepo.pressKey(KeyEvent.VK_TAB);
        assertEquals("Wrong start selection position ", 165, jepo.getSelectionStart());
        assertEquals("Wrong end selection position", 166, jepo.getSelectionEnd());
        jepo.pressKey(KeyEvent.VK_TAB);
        assertEquals("Wrong start selection position ", 193, jepo.getSelectionStart());
        assertEquals("Wrong end selection position", 199, jepo.getSelectionEnd());
        jepo.pressKey(KeyEvent.VK_TAB);
        assertEquals("Wrong start selection position ", 200, jepo.getSelectionStart());
        assertEquals("Wrong end selection position", 203, jepo.getSelectionEnd());
    } finally {
        if (editor != null) {
            editor.closeDiscard();
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:32,代码来源:CodeTemplatesTest.java

示例5: testTemplatesInCompletionByCode

import org.netbeans.jemmy.operators.JEditorPaneOperator; //导入方法依赖的package包/类
public void testTemplatesInCompletionByCode() {
    final String abbrev = "xxxyyy";
    final String expanded = "abcdef";
    final Set<String> context = new HashSet<>();
    context.add("BLOCK");
    CodeTemplatesOperator oper = null;
    EditorOperator editor = null;
    try {
        oper = CodeTemplatesOperator.invoke(true);
        oper.switchLanguage("Java").addNewTemplate(abbrev,expanded).selectTemplate(abbrev);
        oper.setContext(context);            
    } finally {
        oper.ok();
    }
    try {
        openSourceFile("org.netbeans.test.java.editor.codetemplates", "Main");
        editor = new EditorOperator("Main");
        JEditorPaneOperator jepo = editor.txtEditorPane();
        editor.setCaretPosition(6, 9);
        jepo.typeText("abcde");            
        jepo.pressKey(KeyEvent.VK_SPACE,KeyEvent.CTRL_DOWN_MASK);
        new EventTool().waitNoEvent(1000);
        jepo.pressKey(KeyEvent.VK_ENTER);
        checkContentOfEditorRegexp(editor, ".*abcdef.*");
    } finally {
        editor.closeDiscard();
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:29,代码来源:CodeTemplatesTest.java

示例6: testTemplatesInCompletionByAbbrev

import org.netbeans.jemmy.operators.JEditorPaneOperator; //导入方法依赖的package包/类
public void testTemplatesInCompletionByAbbrev() {
    final String abbrev = "xxxyyy";
    final String expanded = "abcdef";
    final Set<String> context = new HashSet<>();
    context.add("BLOCK");
    CodeTemplatesOperator oper = null;
    EditorOperator editor = null;
    try {
        oper = CodeTemplatesOperator.invoke(true);
        oper.switchLanguage("Java").addNewTemplate(abbrev,expanded).selectTemplate(abbrev);
        oper.setContext(context);            
    } finally {
        oper.ok();
    }
    try {
        openSourceFile("org.netbeans.test.java.editor.codetemplates", "Main");
        editor = new EditorOperator("Main");
        JEditorPaneOperator jepo = editor.txtEditorPane();
        editor.setCaretPosition(6, 9);
        jepo.typeText("xxxyy");            
        jepo.pressKey(KeyEvent.VK_SPACE,KeyEvent.CTRL_DOWN_MASK);
        new EventTool().waitNoEvent(1000);
        jepo.pressKey(KeyEvent.VK_ENTER);
        checkContentOfEditorRegexp(editor, ".*abcdef.*");
    } finally {
        editor.closeDiscard();
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:29,代码来源:CodeTemplatesTest.java

示例7: useTemplateAt

import org.netbeans.jemmy.operators.JEditorPaneOperator; //导入方法依赖的package包/类
private void useTemplateAt(EditorOperator editor, int row, int col, String abbrev, int key, int modifier) {
    editor.setCaretPosition(row, col);
    JEditorPaneOperator txtOper = editor.txtEditorPane();
    txtOper.typeText(abbrev);
    editor.pressKey(key, modifier);
    editor.releaseKey(key, modifier);        
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:CodeTemplatesTest.java

示例8: putAndType

import org.netbeans.jemmy.operators.JEditorPaneOperator; //导入方法依赖的package包/类
private void putAndType(int row, int col, String text) {
    editor.setCaretPosition(row, col);
    JEditorPaneOperator jepo = editor.txtEditorPane();
    jepo.typeText(text);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:6,代码来源:PatternsTest.java


注:本文中的org.netbeans.jemmy.operators.JEditorPaneOperator.typeText方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。