Customize Java Editor in Eclipse

I was wondering if there was an easy way to extend the capabilities of the Java editor in Eclipse for some kind of custom project.

Example: When I write in eclipse:

@Deprecated public void foo(); 

foo will be automatically crossed out and therefore easy to notice. In some projects, I would like to do the same with custom annotations like @Untested or @Verified in order to have a better development environment (but, of course, such examples are enough (special colors of classes, etc.).

I wanted to create a simple eclipse suite that extends such rules, but I cannot find an adequate extension point for this. Do I need to create a new text editor from scratch?

Thanks for any help or comments,

+6
source share
1 answer

You will probably need to subclass and modify the JDT editor. Look at the JDT source (org.eclipse.jdt.ui. * Packages). You can easily work with them using the classic Eclipse SDK, as JDT sources are provided. Use the Plugins view to bring these projects to the workspace so you can edit them. I don’t think there is a lot of documentation on working with the JDT source. However, look at the Eclipse help parts related to JDT.

+1
source

Source: https://habr.com/ru/post/920972/


All Articles