Intercept Build Request in Eclipse - Before Compilation
I was wondering in Eclipse if it's possible to intercept when a user hits save or 'ctrl + s' via some sort of listener. What I want to do is determine when a file in a project changes and receive this notification before the file is actually compiled, so that I can update a property in the class. Afterwards, I would like the file to be compiled as per normal. Is this at all possible? Similar to the idea of a database 开发者_高级运维trigger I suppose.
I would look at org.eclipse.jdt.core.compilationParticipant
. From the description:
This extension point allows clients to participate in the compilation process by receiving notifications at various stages of build and reconcile, via a org.eclipse.jdt.core.compiler.CompilationParticipant.
精彩评论