I come from MS Visual Studio background, there on entering a closing curly brace the IDE automatically indents all the code within the block which the curly brace closed. In eclipse I know that it is done by pressing Ctrl
+I
keys and I know how to change these shortcut keys. What I want to know is how to auto indent a block of code when closing the block by entering a closing curly brace.
Eclipse JDT does auto indentation on typing (i.e. it increases indentation after an opening brace and decreases after a closing brace), so there is normally no need to explicitly run auto indentation or auto formatting if you are just writing new code from top to bottom.
You should verify however, that Project -> Context menu -> Properties -> Java Code Style -> Formatter does have an active Formatter profile.
Besides that, the most common used semi automated tool for cleaning up your source in Eclipse is Project -> Context menu -> Properties -> Java Editor -> Save Actions, which is used to trigger formatting and minor code rewritings. I recommend getting used to that one and basically activate all of its possible options.