Ctrl+Shift+F to invoke the Auto Formatter
Ctrl+I to indent the selected part (or all) of you code.
To format it automatically when you save the file, then Goto Window > Preferences > Java > Editor > Save Actions and configure your save actions. Along with saving, you can format, Organize imports,add modifier ‘final’ where possible etc
Eclipse auto indent, auto formatting, auto alignment shortcut
Thanks for the useful information. Need to add your blog to bookmarks