Eclipse Tips and Tricks
Generating constructors
- Right click in the editor window. Select Source → Generate constructors using fields.
- Select the fields to be initialised in the constructor.
- Click the checkbox to Omit the 'super' call to parent class.
- Click finish.
Code Formatting
- Go to Window→Preferences→Java→Code Style→Formatter
- Click on 'New' button to create a new customized profile. Enter the profile name.
- Check the general settings under the indentation tab. You can set a tab policy and Tab size.
- Under the 'Braces' tab, you can select the brace positions such as on the same line, the next line, etc. for various declarations, including method declaration, constructor declaration etc.