Пример #1
0
 public void testBasicIndentation() {
   oper.setCaretPosition(279, 1);
   oper.pushEndKey();
   oper.pushKey(KeyEvent.VK_ENTER);
   oper.pushKey(KeyEvent.VK_ENTER);
   oper.txtEditorPane().typeText("public void method(boolean cond1");
   oper.pushEndKey();
   oper.txtEditorPane().typeText("{");
   oper.pushKey(KeyEvent.VK_ENTER);
   oper.txtEditorPane().typeText("if(cond1");
   oper.pushEndKey();
   oper.txtEditorPane().typeText("sout");
   oper.pushTabKey();
   oper.txtEditorPane().typeText("Hello");
   oper.pushEndKey();
 }
  protected void expandAllFolds(EditorOperator editor) {
    // hit CTRL Shift +
    JEditorPaneOperator txtOper = editor.txtEditorPane();
    txtOper.pushKey(KeyEvent.VK_ADD, KeyEvent.CTRL_DOWN_MASK | KeyEvent.SHIFT_DOWN_MASK);

    // wait a while
    try {
      Thread.currentThread().sleep(COLLAPSE_EXPAND_DELAY);
    } catch (InterruptedException ex) {
    }
  }
Пример #3
0
  @Override
  public void setUp() throws IOException {
    super.setUp();
    testClass = getName();
    System.out.println(testClass);
    System.out.println(curPackage);
    setTestPackageName(curPackage);
    openFile(testClass);
    FormDesignerOperator fdo = new FormDesignerOperator(testClass);

    oper = fdo.editor();
    oper.txtEditorPane().setVerification(false);
  }
  protected void expandFoldAtCaretPosition(EditorOperator editor, int line, int column) {
    // 1. move to adequate place
    editor.setCaretPosition(line, column);

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

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

    // give max 500 milis to fold to expand
    waitMaxMilisForValue(500, getResolver(target), Boolean.FALSE);
  }
 public void prepare() {
   editorOperator.txtEditorPane().typeText("XXX");
 }
Пример #6
0
 private void type(String text) {
   oper.txtEditorPane().typeText(text);
 }