Examples of SWTBotEclipseEditor


Examples of net.sf.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor

    SWTEclipseBot bot = new SWTEclipseBot();

    createJavaProject(bot);
    createJavaClass(bot);
    Thread.sleep(1000);
    SWTBotEclipseEditor editor = bot.editor("HelloWorld.java");

    Thread.sleep(1000);
    editor.notifyKeyboardEvent(SWT.CTRL, '.');
    editor.quickfix("Add unimplemented methods");

    editor.navigateTo(7, 0);
    editor.autoCompleteProposal("sys", "sysout - print to standard out");

    editor.typeText("\"Hello World\"");

    editor.navigateTo(3, 0);
    editor.autoCompleteProposal("main", "main - main method");

    editor.typeText("new Thread (new HelloWorld ());");
    if (true)
      return;
    editor.notifyKeyboardEvent(SWT.CTRL, '2');
    editor.notifyKeyboardEvent(SWT.NONE, 'L');
    editor.notifyKeyboardEvent(SWT.NONE, '\n');

    editor.typeText("\n");
    editor.typeText("thread.start();\n");
    editor.typeText("thread.join();");
    editor.quickfix("Add throws declaration");
    editor.notifyKeyboardEvent(SWT.NONE, (char) 27);
    editor.notifyKeyboardEvent(SWT.NONE, '\n');

    editor.notifyKeyboardEvent(SWT.CTRL, 's');

    editor.notifyKeyboardEvent(SWT.ALT | SWT.SHIFT, 'x');
    editor.notifyKeyboardEvent(SWT.NONE, 'j');

    try {
      Thread.sleep(1000);
    } catch (InterruptedException e1) {
      e1.printStackTrace();
View Full Code Here

Examples of net.sf.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor

   * @param fileName the name of the file.
   * @return an editor for the specified fileName.
   * @throws WidgetNotFoundException if the editor is not found.
   */
  public SWTBotEclipseEditor editor(String fileName) throws WidgetNotFoundException {
    return new SWTBotEclipseEditor(this, finder, fileName);
  }
View Full Code Here

Examples of net.sf.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor

    List editors = SWTBotEclipseEditor.findEditors();
   
    List result = new ArrayList(editors.size());
    for (Iterator iterator = editors.iterator(); iterator.hasNext();) {
      IEditorReference editorReference = (IEditorReference) iterator.next();
      result.add(new SWTBotEclipseEditor(editorReference));
    }
    return result;
  }
View Full Code Here

Examples of net.sf.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor

   * @param fileName the name of the file.
   * @return an editor for the specified fileName.
   * @throws WidgetNotFoundException if the editor is not found.
   */
  public SWTBotEclipseEditor editor(String fileName) throws WidgetNotFoundException {
    return new SWTBotEclipseEditor(this, finder, fileName);
  }
View Full Code Here

Examples of net.sf.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor

    List editors = SWTBotView.findEditors();

    List result = new ArrayList(editors.size());
    for (Iterator iterator = editors.iterator(); iterator.hasNext();) {
      IEditorReference editorReference = (IEditorReference) iterator.next();
      result.add(new SWTBotEclipseEditor(editorReference));
    }
    return result;
  }
View Full Code Here

Examples of org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor

  @SuppressWarnings("unchecked")
  public SWTBotEclipseEditor editor(String fileName, int index) throws WidgetNotFoundException {
    Matcher matcher = allOf(instanceOf(IEditorReference.class), withPartName(fileName));
    WaitForEditor waitForView = waitForEditor(matcher);
    waitUntilWidgetAppears(waitForView);
    return new SWTBotEclipseEditor(waitForView.get(index), this);
  }
View Full Code Here

Examples of org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor

    List<IEditorReference> editors = waiForEditor.all();
    List<SWTBotEclipseEditor> result = new ArrayList<SWTBotEclipseEditor>(editors.size());

    for (IWorkbenchPartReference editor : editors) {
      result.add(new SWTBotEclipseEditor((IEditorReference) editor, this));
    }
    return result;
  }
View Full Code Here

Examples of org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor

        }
      }
    });
    if (editor == null)
      throw new WidgetNotFoundException("There is no active editor"); //$NON-NLS-1$
    return new SWTBotEclipseEditor(editor, this);
  }
View Full Code Here

Examples of org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor

  @SuppressWarnings("unchecked")
  public SWTBotEclipseEditor editor(String fileName, int index) throws WidgetNotFoundException {
    Matcher matcher = allOf(instanceOf(IEditorReference.class), withPartName(fileName));
    WaitForEditor waitForEditor = waitForEditor(matcher);
    waitUntilWidgetAppears(waitForEditor);
    return new SWTBotEclipseEditor(waitForEditor.get(index), this);
  }
View Full Code Here

Examples of org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor

    List<IEditorReference> editors = waitForEditor.getAllMatches();
    List<SWTBotEclipseEditor> result = new ArrayList<SWTBotEclipseEditor>(editors.size());

    for (IWorkbenchPartReference editor : editors) {
      result.add(new SWTBotEclipseEditor((IEditorReference) editor, this));
    }
    return result;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.