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


Java JTextComponentOperator类代码示例

本文整理汇总了Java中org.netbeans.jemmy.operators.JTextComponentOperator的典型用法代码示例。如果您正苦于以下问题:Java JTextComponentOperator类的具体用法?Java JTextComponentOperator怎么用?Java JTextComponentOperator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: Browser

import org.netbeans.jemmy.operators.JTextComponentOperator; //导入依赖的package包/类
/**
   External Browser (Command Line) : Change arguments -- "Cancel" 
   **/
   
   public void testChangeArgumentsCancelEBCL() {
String newArg = "UnRealArgs";
OptionsOperator oo = OptionsOperator.invoke();
TextFieldProperty pr = getTFProperty(ideConfiguration + iSep + sets + iSep + browsers + iSep + cl, pnameBrowserExecutable);
String origExec = pr.getValue();
pr.openEditor();
NbDialogOperator nbo = new NbDialogOperator(pnameBrowserExecutable);
new JTextComponentOperator(nbo, 1).setText(newArg);
nbo.cancel();
pr = getTFProperty(ideConfiguration + iSep + sets + iSep + browsers + iSep + cl, pnameBrowserExecutable);
if (!pr.getValue().equals(origExec)) {
    fail("\"" + pr.getValue() + "\" instead of \"" + origExec + "\"");
}
   }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:19,代码来源:BrowserRegistry.java

示例2: collapseFoldAtCaretPosition

import org.netbeans.jemmy.operators.JTextComponentOperator; //导入依赖的package包/类
protected void collapseFoldAtCaretPosition(EditorOperator editor, int line, int column){
    System.out.println("Collapsing");
    // 1. move to adequate place 
    editor.setCaretPosition(line, column);

    // 2. hit CTRL -
    JEditorPaneOperator txtOper = editor.txtEditorPane();
    txtOper.pushKey(KeyEvent.VK_SUBTRACT, KeyEvent.CTRL_DOWN_MASK);

    JTextComponentOperator text = new JTextComponentOperator(editor);
    JTextComponent target = (JTextComponent)text.getSource();

    // give max 500 milis to fold to collapse
    waitMaxMilisForValue(500, getResolver(target), Boolean.TRUE);
   
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:17,代码来源:CodeFoldingTestCase.java

示例3: createNewFile

import org.netbeans.jemmy.operators.JTextComponentOperator; //导入依赖的package包/类
protected EditorOperator createNewFile(String fileName, String project, String category, String fileType) {

        NewFileWizardOperator opNewFileWizard = NewFileWizardOperator.invoke();
        opNewFileWizard.selectCategory(category);
        opNewFileWizard.selectFileType(fileType);
        opNewFileWizard.next();

        JDialogOperator jdNew = new JDialogOperator("New " + fileType);
        JTextComponentOperator jt = new JTextComponentOperator(jdNew, 0);
        if (null != fileName) {
            jt.setText(fileName);
        } else {
            fileName = jt.getText();
        }

        opNewFileWizard.finish();
        return new EditorOperator(fileName);
    }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:19,代码来源:GeneralCSSPrep.java

示例4: testSearchBackwards

import org.netbeans.jemmy.operators.JTextComponentOperator; //导入依赖的package包/类
public void testSearchBackwards() {
    openDefaultProject();
    openFile("Source Packages|org.netbeans.test.editor.search.IncrementalSearchTest", "testSearchForward");
    EditorOperator editor = new EditorOperator("testSearchForward");
    editor.setCaretPosition(54, 1);
    SearchBarOperator barOperator = SearchBarOperator.invoke(editor);
    JTextComponentOperator t = barOperator.findCombo();
    t.clearText();
    new EventTool().waitNoEvent(100);
    t.typeText("pub");
    t.pushKey(KeyEvent.VK_ENTER,KeyEvent.SHIFT_DOWN_MASK);
    assertSelection(editor, 2402, 2405);
    t.pushKey(KeyEvent.VK_ENTER,KeyEvent.SHIFT_DOWN_MASK);
    assertSelection(editor, 2323, 2326);
    t.pushKey(KeyEvent.VK_ENTER,KeyEvent.SHIFT_DOWN_MASK);
    assertSelection(editor, 368, 371);        
    t.pushKey(KeyEvent.VK_ENTER,KeyEvent.SHIFT_DOWN_MASK);
    MainWindowOperator mwo = MainWindowOperator.getDefault();
    assertEquals("'pub' found at 55:5; Beginning of the document reached. Continuing search from end.",mwo.getStatusText());
    t.pushKey(KeyEvent.VK_ESCAPE);
    new EventTool().waitNoEvent(100);
    assertFalse("ToolBar not closed",barOperator.isVisible());
    editor.closeDiscard();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:25,代码来源:IncrementalSearchTest.java

示例5: testNextButton

import org.netbeans.jemmy.operators.JTextComponentOperator; //导入依赖的package包/类
public void testNextButton() {
    openDefaultProject();
    openFile("Source Packages|org.netbeans.test.editor.search.IncrementalSearchTest", "match.txt");
    EditorOperator editor = new EditorOperator("match.txt");
    editor.setCaretPosition(1, 1);
    SearchBarOperator barOperator = SearchBarOperator.invoke(editor);
    JTextComponentOperator t = barOperator.findCombo();
    t.clearText();
    new EventTool().waitNoEvent(200);
    t.typeText("abc");
    JButtonOperator b = barOperator.nextButton();
    b.push();
    new EventTool().waitNoEvent(200);
    assertSelection(editor, 0, 3);
    b.push();
    new EventTool().waitNoEvent(200);
    assertSelection(editor, 4, 7);
    t.pushKey(KeyEvent.VK_ESCAPE);
    new EventTool().waitNoEvent(100);
    assertFalse("ToolBar not closed",barOperator.isVisible());
    editor.closeDiscard();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:23,代码来源:IncrementalSearchTest.java

示例6: testPrevButton

import org.netbeans.jemmy.operators.JTextComponentOperator; //导入依赖的package包/类
public void testPrevButton() {
    openDefaultProject();
    openFile("Source Packages|org.netbeans.test.editor.search.IncrementalSearchTest", "match.txt");
    EditorOperator editor = new EditorOperator("match.txt");
    editor.setCaretPosition(3, 1);
    SearchBarOperator barOperator = SearchBarOperator.invoke(editor);
    JTextComponentOperator t = barOperator.findCombo();
    t.clearText();
    new EventTool().waitNoEvent(100);
    t.typeText("abc");
    JButtonOperator b = barOperator.prevButton();
    b.push();
    assertSelection(editor, 4, 7);
    b.push();
    assertSelection(editor, 0, 3);
    t.pushKey(KeyEvent.VK_ESCAPE);
    new EventTool().waitNoEvent(100);
    assertFalse("ToolBar not closed",barOperator.isVisible());
    editor.closeDiscard();        
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:21,代码来源:IncrementalSearchTest.java

示例7: testNotFound

import org.netbeans.jemmy.operators.JTextComponentOperator; //导入依赖的package包/类
public void testNotFound() {
    openDefaultProject();
    openFile("Source Packages|org.netbeans.test.editor.search.IncrementalSearchTest", "match.txt");
    EditorOperator editor = new EditorOperator("match.txt");
    editor.setCaretPosition(3, 1);
    SearchBarOperator barOperator = SearchBarOperator.invoke(editor);
    JTextComponentOperator t = barOperator.findCombo();
    try {            
        t.clearText();
        new EventTool().waitNoEvent(100);
        t.requestFocus();
        t.typeText("XYZ");        
        t.pushKey(KeyEvent.VK_ENTER);                        
        new EventTool().waitNoEvent(100);            
        MainWindowOperator mwo =  MainWindowOperator.getDefault();
        assertEquals("'XYZ' not found",mwo.getStatusText());                        
        JTextComponentOperator filed = barOperator.findCombo();
        assertEquals(new Color(178, 0, 0), filed.getForeground());                
    } finally {
        barOperator.closeButton().doClick();                              
    }
    new EventTool().waitNoEvent(200);
    assertFalse("ToolBar not closed",barOperator.isVisible());
    editor.closeDiscard();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:26,代码来源:IncrementalSearchTest.java

示例8: testInvalidRegexp

import org.netbeans.jemmy.operators.JTextComponentOperator; //导入依赖的package包/类
public void testInvalidRegexp() {
    openDefaultProject();
    openFile("Source Packages|org.netbeans.test.editor.search.IncrementalSearchTest", "match.txt");
    EditorOperator editor = new EditorOperator("match.txt");
    editor.setCaretPosition(3, 1);
    SearchBarOperator barOperator = SearchBarOperator.invoke(editor);
    JTextComponentOperator t = barOperator.findCombo();
    JCheckBoxOperator ch2 = barOperator.reqularExpressionCheckBox();        
    ch2.setSelected(true);
    t.clearText();
    new EventTool().waitNoEvent(100);
    t.requestFocus();
    t.typeText("(");
    new EventTool().waitNoEvent(1000);        
    JTextComponentOperator filed = barOperator.findCombo();
    assertEquals(new Color(255, 0, 0), filed.getForeground());        
    MainWindowOperator mwo = MainWindowOperator.getDefault();
    assertEquals("Invalid regular expression: 'Unclosed group'",mwo.getStatusText());
    ch2.setSelected(false);
    t.pushKey(KeyEvent.VK_ESCAPE);
    new EventTool().waitNoEvent(100);
    assertFalse("ToolBar not closed",barOperator.isVisible());
    editor.closeDiscard();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:25,代码来源:IncrementalSearchTest.java

示例9: testSearchForwardBackward

import org.netbeans.jemmy.operators.JTextComponentOperator; //导入依赖的package包/类
public void testSearchForwardBackward() {
    openDefaultProject();
    openFile("Source Packages|org.netbeans.test.editor.search.IncrementalSearchTest", "match.txt");
    EditorOperator editor = new EditorOperator("match.txt");
    editor.setCaretPosition(2, 1);
    SearchBarOperator barOperator = SearchBarOperator.invoke(editor);
    JTextComponentOperator t = barOperator.findCombo();
    t.clearText();
    new EventTool().waitNoEvent(100);
    t.typeText("abc");
    t.pushKey(KeyEvent.VK_ENTER);
    assertSelection(editor, 4, 7);
    t.pushKey(KeyEvent.VK_ENTER, KeyEvent.SHIFT_DOWN_MASK);
    assertSelection(editor, 0, 3);
    editor.txtEditorPane().requestFocus();
    new EventTool().waitNoEvent(100);
    assertTrue("ToolBar closed by focus transfer ",barOperator.isVisible());        
    editor.closeDiscard();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:20,代码来源:IncrementalSearchTest.java

示例10: testWholeWords

import org.netbeans.jemmy.operators.JTextComponentOperator; //导入依赖的package包/类
public void testWholeWords() {
    openDefaultProject();        
    openFile("Source Packages|org.netbeans.test.editor.search.IncrementalSearchTest", "match2.txt");
    EditorOperator editor = new EditorOperator("match2.txt");        
    editor.setCaretPosition(1, 1);
    SearchBarOperator barOperator = SearchBarOperator.invoke(editor);
    JTextComponentOperator t = barOperator.findCombo();
    JCheckBoxOperator ch1 = barOperator.wholeWordsCheckBox();
    ch1.setSelected(true);
    t.clearText();        
    t.typeText("whole");
    t.pushKey(KeyEvent.VK_ENTER);        
    assertSelection(editor, 12, 17);                
    t.pushKey(KeyEvent.VK_ESCAPE);
    new EventTool().waitNoEvent(100);
    assertFalse("ToolBar not closed",barOperator.isVisible());
    closeFileWithDiscard();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:19,代码来源:IncrementalSearchTest.java

示例11: testRegularExpression

import org.netbeans.jemmy.operators.JTextComponentOperator; //导入依赖的package包/类
public void testRegularExpression() {
    openDefaultProject();        
    openFile("Source Packages|org.netbeans.test.editor.search.IncrementalSearchTest", "match2.txt");
    EditorOperator editor = new EditorOperator("match2.txt");        
    editor.setCaretPosition(1, 1);
    SearchBarOperator barOperator =SearchBarOperator.invoke(editor);
    JTextComponentOperator t = barOperator.findCombo();
    JCheckBoxOperator ch1 = barOperator.matchCaseCheckBox();
    JCheckBoxOperator ch2 = barOperator.reqularExpressionCheckBox();
    ch1.setSelected(false);        
    ch2.setSelected(true);
    t.clearText();        
    t.typeText("[aA]b*cd?");
    t.pushKey(KeyEvent.VK_ENTER);
    assertSelection(editor, 19, 23);        
    t.pushKey(KeyEvent.VK_ENTER);
    assertSelection(editor, 36, 39);        
    t.pushKey(KeyEvent.VK_ESCAPE);
    new EventTool().waitNoEvent(100);
    assertFalse("ToolBar not closed",barOperator.isVisible());
    closeFileWithDiscard();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:23,代码来源:IncrementalSearchTest.java

示例12: testFindNext

import org.netbeans.jemmy.operators.JTextComponentOperator; //导入依赖的package包/类
public void testFindNext() {
    openDefaultProject();        
    openFile("Source Packages|org.netbeans.test.editor.search.IncrementalSearchTest", "match2.txt");
    EditorOperator editor = new EditorOperator("match2.txt");                
    SearchBarOperator barOperator = SearchBarOperator.invoke(editor);
    JTextComponentOperator t = barOperator.findCombo();
    t.clearText();        
    barOperator.matchCaseCheckBox().setSelected(false);
    barOperator.reqularExpressionCheckBox().setSelected(false);
    barOperator.wholeWordsCheckBox().setSelected(false);        
    t.pushKey(KeyEvent.VK_ESCAPE);
    editor.setCaretPosition(1, 1);
    barOperator = SearchBarOperator.invoke(editor);        
    new EventTool().waitNoEvent(100);
    t.typeText("ab");        
    t.pushKey(KeyEvent.VK_ENTER);
    new EventTool().waitNoEvent(100);
    assertSelection(editor, 19,21);        
    t.pushKey(KeyEvent.VK_ESCAPE);
    new EventTool().waitNoEvent(100);
    assertFalse("ToolBar not closed",barOperator.isVisible());
    t.pushKey(KeyEvent.VK_F3);
    new EventTool().waitNoEvent(100);
    assertSelection(editor, 24, 26);                
    closeFileWithDiscard();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:27,代码来源:IncrementalSearchTest.java

示例13: editCell

import org.netbeans.jemmy.operators.JTextComponentOperator; //导入依赖的package包/类
@Override
public void editCell(ComponentOperator oper, int row, int column, Object value) {
    JTableOperator toper = (JTableOperator) oper;
    toper.scrollToCell(row, column);
    if (!toper.isEditing()
            || toper.getEditingRow() != row
            || toper.getEditingColumn() != column) {
        clickOnCell((JTableOperator) oper, row, column, 2);
    }
    JTextComponentOperator textoper
            = new JTextComponentOperator((JTextComponent) toper.
                    waitSubComponent(new JTextComponentOperator.JTextComponentFinder()));
    TextDriver text = DriverManager.getTextDriver(JTextComponentOperator.class);
    text.clearText(textoper);
    text.typeText(textoper, value.toString(), 0);
    DriverManager.getKeyDriver(oper).
            pushKey(textoper, KeyEvent.VK_ENTER, 0,
                    oper.getTimeouts().
                    create("ComponentOperator.PushKeyTimeout"));
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:21,代码来源:JTableMouseDriver.java

示例14: prepare

import org.netbeans.jemmy.operators.JTextComponentOperator; //导入依赖的package包/类
public void prepare(){
    new ActionNoBlock("File|Open Project...",null).perform(); //NOI18N
    WizardOperator opd = new WizardOperator("Open Project"); //NOI18N
    JTextComponentOperator path = new JTextComponentOperator(opd,1);
    openButton = new JButtonOperator(opd,"Open Project"); //NOI18N
    String paths = getDataDir() + java.io.File.separator + projectName;
    path.setText(paths);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:OpenBPELprojectTest.java

示例15: prepare

import org.netbeans.jemmy.operators.JTextComponentOperator; //导入依赖的package包/类
public void prepare() {
    new ActionNoBlock("File|Open Project...", null).perform(); //NOI18N
    WizardOperator opd = new WizardOperator("Open Project"); //NOI18N
    JTextComponentOperator path = new JTextComponentOperator(opd, 1);
    openButton = new JButtonOperator(opd, "Open Project"); //NOI18N
    String paths = getDataDir().toString()+ java.io.File.separator + projectName;
    path.setText(paths);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:OpenMobileProjectTest.java


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