Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add @Override, @Deprecate and static modifiers to methods automatically for all project Java classes where necessary?

I need to insert @Override / @Deprecated annotations and static modifiers automatically where necessary to all Java files of concrete project is opened in Eclipse IDE.

Eclipse has a great ability to insert @Override/@Deprecate annotations and add static modifiers on Java files saving (Preferences -> Java -> Editor -> Save actions -> Additional actions). But Eclipse can apply these actions only on edited java file and only when saving it.

Sure, I can insert a tab or space into the each file using Eclipse as editor and save it to activate Eclipse refactoring tools on save action, but I have a very big code amount to process, so this is very nasty.

Maybe there is an Eclipse plugin which supports such type of code refactoring?

If there are no solutions, I`ll try to write my own Eclipse RCP plugin for that.

like image 470
daniilyar Avatar asked Jan 15 '13 22:01

daniilyar


1 Answers

  1. Right-click the project in the package explorer view -> a context menu appears
  2. In that menu, choose "Source" and then "Clean Up ..." -> the clean up dialog appears
  3. pick the desired actions, and click "Finish"
like image 167
meriton Avatar answered Oct 19 '22 17:10

meriton