How to add custom alert to Java files in Eclipse?

I would like to add a custom warning message (i.e. add an entry to the "Alerts" section of the "Problems" tab) for .javafiles in Eclipse.

So far, I have found information (here and elsewhere) about creating plugins and using markers, I have not yet found anything that speaks of expanding the process of finding problems. Most of the articles I have found do not discuss when to create markers, just like those that really suggest that I am interested in attaching them to a custom build step or custom editor, none of which seem appropriate for what I I'm trying to do.

How to create a warning that functions as accessible through Window> Preferences> Java> Compiler> Errors / Warnings?

+5
source share
1 answer

I think a builder may be suitable for what you want to do. There is a template in the new plugin wizard that creates everything you need for the builder (for example, business logic). Since the builder starts every time the file changes, you can clear the old warning (code created for you) and add a new warning (code generated for you), if applicable. This also applies when a file is first created.

You can even scan the code and find hardcoded strings and mark them with warnings if you want.

, , NLS (, , ). , , . , , .

+3

All Articles