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

二次信任 提交于 2020-01-02 01:35:08

问题


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.


回答1:


  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"


来源:https://stackoverflow.com/questions/14348385/how-to-add-override-deprecate-and-static-modifiers-to-methods-automatically-f

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!