Eclipse JDT

From Arnout Engelen

Jump to: navigation, search

Contents

[edit] API

[edit] Headless Eclipse

  • pictorial tutorial - can reproduce. nice.
  • Formatter example - doesn't work yet due to this bug, which should be fixed in Eclipse 3.2 M6 (the current development version) - might not even require eclipse headless (sweet!)

[edit] jdt.core AST stuff

Using the jdt.core AST is described at [1].

This looks ideal for adding annotations, but unfortunately it seems that it's not possible to add blockcomments or linecomments to an AST, only Javadoc comments. Bah. We may be able, however, to use tagging instead.

[edit] Manipulating comments

In the IDE, you can comment out a block with AddBlockCommentAction.

There are currently two ways to add these kind of comment in a compilation unit:

  • insert the comment in the source as a string and parse again the compilation unit (probably like here, doesn't seem very suitable.
  • use ASTRewrite Looks successful!
    • .. But prints everything indented (though indentation oddities otherwise remain)
Personal tools