Sunday, June 12, 2011

How to do auto source formatting in eclipse (RCP) on Save button

Click to download src
Click to download plugin jar

JDK and eclipse compatibility

JDK version 1.6 with eclipse 3.3 is the minimum requirement.

Preamble

Download using the download link. Drop the jar in eclipse's plugin folder and restart for changes to take affect.

Overview of plugin

The plugin provides two functionalities, Save and Save all.

The default is the save option, i.e when Ctrl+S is pressed or clicked through menu or toolbar. The code will be automatically saved in the current view.

In the case of save all, when Ctrl+Shift+S is pressed or clicked through menu or toolbar. The code will be automatically saved in all the dirty editors and the current view is preserved.

Change of Settings

The settings can be changed by going to "Auto Code Formatter" option in Window->Preferences section.

Enjoy, if you like it please appreciate!

No comments:

Post a Comment