In order to format a selected region of code or an entire file, use the Format Source action.
Press Ctrl+Shift+F or use editor’s right click menu Source ‣ Format Source.
All code formatting preferences are available at menu Window ‣ Preferences ‣ DVT ‣ PSS ‣ Editor ‣ Formatting.