Search code examples
javaeclipseindentation

Different tab/space policy for different Eclipse Java projects


I have my own projects which I like to see indented with tabs. I also downloaded a third party project which uses spaces, and I want to customize it. I want to preserve the coding style of the third party lib, but I still want to use my favorite one tab = one depth style for the projects that are entirely my own.

I browsed through many Eclipse setting, but I still cannot see my way out. I'm using Eclipse Juno SR1 with Windows 7 64 bit.


Solution

  • Easily done. In Windows > Preferences > Java > Code Style > Formatter you can define the various formatters you'd like to use.

    Then, each project can be adjusted to use a different one, by right-clicking on the project and adjusting the preferences there.