Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Best way to add warnings
Best way to add warnings [message #718392] Wed, 24 August 2011 08:06
Missing name Missing name is currently offline Missing name Missing nameFriend
Messages: 1
Registered: August 2011
Junior Member
I'm currently trying to to add a custom warning to the Java Editor. Specifically I introduced a Javadoc tag which should be a hint that method is expected to be overridden and if a tagged method is final an appropriate warning should be generated. I'm developing on Eclipse Helios and Indigo.

Obviously there are 2 ways to implement that in general:

1. Contribute a builder

The problem here is, that my builder is never called unless I link it to a custom project nature and add that nature to the Java project. But that is not what I want to do. I'm interested in the Java project nature as the JDT Builder is.


2. Contribute a compilation participant

This seems to work well in the first place. I have implemented the reconcile() method and performed my checks on the CU working copy provided by the given context.

Generating the problem markers can obviously also be done in two ways:


2.1. Creating instances of CategorizedProblem and adding them using ReconcileContext.putProblems()

The problem here is that the problems are not being added to the problems view. Further I could not manage that the quick fixes for this warning appear by just hovering with mouse over the marked source code (for the IMarker approach below this works).


2.2. Creating actual IMarker instances using createMarker() on the resource of the given working copy

This causes me to remove all these markers manually before performing my checks which seems to be a little ugly. Further I observed a very strange behavior when more than one of the Javadoc tag warnings are generated. reconcile() is called again and again (likely because I have just added the markers) and so the warnings start to "blink".


So I guess I missed something very basical. Does anyone have any hints what is the best way to perform this task?

Thanks in advance

[Updated on: Wed, 24 August 2011 08:06]

Report message to a moderator

Previous Topic:JUnit 4.9 is out - how can I upgrade JDT
Next Topic:start a new Java project with an existing package??
Goto Forum:
  


Current Time: Fri Sep 20 23:38:50 GMT 2024

Powered by FUDForum. Page generated in 0.03759 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top