Menu

eclipse Settings

Jiří Daniel

Nastavení formátování kódu v Eclipse

V projektu spl-tools-code jsme se domluvili na jednotném formátování kódu.
Je ale nutné jej nastravit.

V Project prooperties (Alt + Enter):

Java Code Style:

- Clean up: import SPLsaveactions.xml
- Code Templates: import SPLcodetemplates.xml
- Formatter: import SPLformatter.xml
- Organize imports: import SPL.importorder

Java Editor > Save Actions:

- zaškrtnout všechny checkboxy
- radio button Format all lines
- v Aditional Actions > Configure postupně nastavit tak, aby ve výsledku bylo zobrazeno nálsedující:
    - Convert control statement bodies to block
    - Add final modifier to private fields
    - Remove unused imports
    - Add missing '@Override' annotations
    - Add missing '@Override' annotations to implementations of interface methods
    - Add missing '@Deprecated' annotations
    - Remove unnecessary casts
    - Remove trailing white spaces on all lines
    - Correct indentation

Related

Wiki: ProjectNotes

MongoDB Logo MongoDB