Skip to content
Lukas Schmelzeisen edited this page Jan 11, 2015 · 3 revisions

These are the Eclipse settings we use for this project.

Editor

Window -> Preferences -> General -> Editors -> Text Editors

Set Displayed tab width to 4.

Set Insert spaces for tabs.

Formatter

Download our formatter.xml and import it into Eclipse with:

Window -> Preferences -> Java -> Code Style -> Formatter -> Import

Cleanup

Download our clean_up.xml and import it into Eclipse with:

Windows -> Preferences -> Java -> Code Style -> Clean Up -> Import

Save Actions

Unfortunately Eclipse does not allow to import/export Save Actions, but these are identical with Clean Up Settings anyway, so set them like them.

In Detail:

Windows -> Preferences -> Java -> Editor -> Save Actions

The page should read:

[x] Perform the selected actions on save
    [x] Format source code
        [x] Format all lines
        [ ] Format edited lines
    [x] Organize Iports
    [x] Additional actions

To configure the Additional actions click Configure... on the the same page:

Code Organizing:
    [x] Remove trailing whitespace
        [x] All lines                [ ] Ignore empty lines
    [x] Correct indentation
    [ ] Sort members

Code Style:
    [x] Use blocks in if/while/for/do statements
        [ ] Always
        [ ] Always except for single 'return' or 'throw' statements
        [x] Only if necessary
    [ ] Convert 'for' loops to enhanced

    [ ] Use parentheses in expressions

    [ ] Use modifier 'final' where possible

    [ ] Convert functional interface instances

Member Accesses:
    [x] Use 'this' qualifier for field accesses
        [ ] Always                   [x] Only if necessary
    [x] Use 'this' qualifier for method accesses
        [ ] Always                   [x] Only if necessary

    [ ] Use declaring class as qualifier

Missing Code:
    [x] Add missing Annotations
        [x] '@Override'
            [x] Implementations of interface methods (1.6 or higher)
        [x] '@Deprecated'

Unnecessary Code Tab:
    [x] Remove unused imports
    [ ] Remove unused private members
    [ ] Remove unused local variables

    [x] Remove unnecessary casts
    [x] Remove unnecessary '$NON-NLS$' tags