Example #1
0
  protected SVEditor openEditor(String path) throws PartInitException {
    IEditorPart ed = SVEditorUtil.openEditor(path);
    assertNotNull(ed);
    assertTrue((ed instanceof SVEditor));

    while (Display.getDefault().readAndDispatch()) {}

    SVEditor sv_ed = (SVEditor) ed;
    if (!fEditors.contains(sv_ed)) {
      fEditors.add(sv_ed);
    }

    return sv_ed;
  }
Example #2
0
  protected Tuple<SVEditor, AutoEditTester> openAutoEditTester(String path)
      throws PartInitException {
    IEditorPart ed = SVEditorUtil.openEditor(path);
    assertNotNull(ed);
    assertTrue((ed instanceof SVEditor));

    while (Display.getDefault().readAndDispatch()) {}

    SVEditor sv_ed = (SVEditor) ed;
    if (!fEditors.contains(sv_ed)) {
      fEditors.add(sv_ed);
    }

    AutoEditTester auto_edit =
        new AutoEditTester(sv_ed.getDocument(), SVDocumentPartitions.SV_PARTITIONING);

    auto_edit.setAutoEditStrategy(
        IDocument.DEFAULT_CONTENT_TYPE,
        new SVAutoIndentStrategy(null, SVDocumentPartitions.SV_PARTITIONING));

    return new Tuple<SVEditor, AutoEditTester>(sv_ed, auto_edit);
  }