In eclipse you can click Ctrl+I at any line, and it\'ll automatically indent the line or group of lines according to the indentation scheme you chose i
Ctrl+Shift+F will do a format of all the code in the page.
Ctrl
Shift
F