Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-dev] [IDE TIP] Spaces for tabs within the Eclipse IDE


In the Eclipse IDE (using default settings), if "Insert Spaces for tabs" is selected within the "Text Editors" preference pane, tabs may still be inserted instead of 4 spaces when indenting code. This is because the default code formatter is configured to insert tabs for indented code.

Here are the steps to correct this issue within the IDE:

1) In the Eclipse IDE select the Window > Preferences menu
2) Select Java > Code Style > Formatter
3) Edit the selected profile
4) Set the Profile name to "Eclipse (spaces for tabs)" or whatever you prefer
5) Set the Tab policy to "Spaces only"
6) Ensure that Indentation size is 4 and tab size is 4
7) Click ok in the Formatter window, then ok in the Preferences window

This step needs to be done in every Eclipse workspace.

Hope this is useful to someone battling with tabs in EL source.

--
Oracle
David Minsky | Senior Member of Technical Staff
Phone: +1 613 2884605
Oracle Oracle Server Technologies Sustaining Engineering
ORACLE Canada | 45 O'Connor Street, Ottawa, Ontario | K1P 1A4

Green Oracle Oracle is committed to developing practices and products that help protect the environment

Back to the top