Hi Geoffrey,<br><br>I'm an absolute dummy when confronted with Eclipse. Thanks to your detailed recipe, I found all the right buttons, tabs and what not, exactly as described by you, but tabbing didn't go away until I established a "project specific setting" for Java -> CodeStyle -> Formatter, giving it a new name ("Drools" - what else), etc. Idiots like me might need an additional hint to that effect.<br>
<br>-W<br><br><br><div class="gmail_quote">On 13 September 2010 14:43, Geoffrey De Smet <span dir="ltr"><<a href="mailto:ge0ffrey.spam@gmail.com">ge0ffrey.spam@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I've documented a checklist for configuring eclipse and/or IntelliJ in<br>
the trunk/README.txt file. Feel free to change or expand it as you see fit.<br>
<br>
Please take a moment of your time to check this stuff, so you can avoid<br>
the following headaches:<br>
- tabs VS spaces (not just in java but also in XML): merge problems<br>
- encoding: wierd bugs (especially with translated text that contains ë,<br>
ç or €) + merge problems<br>
- line endings: wierd bugs (with regex find/replaces, ...) + merge problems<br>
- license correctly: legally<br>
<br>
Configuring Eclipse<br>
===================<br>
<br>
Code style<br>
----------<br>
<br>
Correct number of spaces for tabs:<br>
- Open menu "Window", menu item "Preferences".<br>
- Open tree item "Java", tree item "Code Style", tree item "Formatter".<br>
-- If you imported the trunk/eclipse-formatter.xml file,<br>
you don't need to set it here,<br>
but you do need to set it for XML anyway!<br>
-- Click button "Edit" of the active profile<br>
-- Tab "Indentation"<br>
--- Combobox "Tab policy": spaces only<br>
--- Indentation size: 4<br>
--- Tab size: 4<br>
-- If it is a build in profile, you need to change its name with the<br>
textfield on top<br>
- Open tree item "XML", tree item "XML Files", tree item "Editor".<br>
-- Radio button "Indent using space": on<br>
-- Indentation size: 2<br>
<br>
Correct file encoding (UTF-8 except for properties files) and EOL (unix):<br>
- Open menu "Window", menu item "Preferences".<br>
- Open tree item "General", tree item "Workspace".<br>
-- Label "Text file encoding", radiobutton "Other", combobox "UTF-8"<br>
-- Label "New text file delimiter", radiobutton "Other", combobox "Unix"<br>
- Open tree item "XML", tree item "XML Files".<br>
-- Combobox "Encoding": ISO 10646/Unicode(UTF-8)<br>
- Open tree item "CSS", tree item "CSS Files".<br>
-- Combobox "Encoding": ISO 10646/Unicode(UTF-8)<br>
- Open tree item "HTML", tree item "HTML Files".<br>
-- Combobox "Encoding": ISO 10646/Unicode(UTF-8)<br>
- Note: i18n properties files must be in ISO-8859-1 as specified by the<br>
java ResourceBundle contract.<br>
<br>
License header<br>
--------------<br>
<br>
Eclipse JEE Helios currently has no build-in support of license headers,<br>
but you can configure it for new files.<br>
- Open menu "Window", menu item "Preferences".<br>
- Open tree item "Java", tree item "Code Style", tree item "Copy templates".<br>
-- Open tree item "Comments", tree item "Files".<br>
-- Replace the text area with this:<br>
/*<br>
* Copyright 2010 JBoss Inc<br>
*<br>
* Licensed under the Apache License, Version 2.0 (the "License");<br>
* you may not use this file except in compliance with the License.<br>
* You may obtain a copy of the License at<br>
*<br>
* <a href="http://www.apache.org/licenses/LICENSE-2.0" target="_blank">http://www.apache.org/licenses/LICENSE-2.0</a><br>
*<br>
* Unless required by applicable law or agreed to in writing, software<br>
* distributed under the License is distributed on an "AS IS" BASIS,<br>
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.<br>
* See the License for the specific language governing permissions and<br>
* limitations under the License.<br>
*/<br>
-- Do not start or end with a newline character<br>
-- Update the year (2010) every year.<br>
<br>
Configuring IntelliJ<br>
====================<br>
<br>
Code style<br>
----------<br>
<br>
Correct number of spaces for tabs:<br>
- Open menu "File", menu item "Settings".<br>
- Open tree item "Code Style", tree item "General".<br>
- Open tab "Java"<br>
-- Checkbox "Use tab character": off<br>
-- Textfield "Tab size": 4<br>
-- Textfield "Indent": 4<br>
-- Textfield "Continuation indent": 8<br>
- Open tab "XML"<br>
-- Checkbox "Use tab character": off<br>
-- Textfield "Tab size": 2<br>
-- Textfield "Indent": 2<br>
-- Textfield "Continuation indent": 4<br>
<br>
Correct file encoding (UTF-8 except for properties files) and EOL (unix):<br>
- Open menu "File", menu item "Settings".<br>
- Open tree item "Code Style", tree item "General".<br>
-- Combobox "Line seperator (for new files)": Unix<br>
- Open tree item "File Encodings".<br>
-- Combobox "IDE Encoding": "UTF-8"<br>
-- Combobox "Default encoding for properties files": ISO-8859-1<br>
<br>
License header<br>
--------------<br>
<br>
- Open menu "File", menu item "Settings".<br>
- Open tree item "Copyright", tree item "Copyright profiles".<br>
- Add Copyright profile<br>
-- Textfield name: JBoss Inc<br>
-- Fill this into the text area:<br>
Copyright $today.year JBoss Inc<br>
<br>
Licensed under the Apache License, Version 2.0 (the "License");<br>
you may not use this file except in compliance with the License.<br>
You may obtain a copy of the License at<br>
<br>
<a href="http://www.apache.org/licenses/LICENSE-2.0" target="_blank">http://www.apache.org/licenses/LICENSE-2.0</a><br>
<br>
Unless required by applicable law or agreed to in writing, software<br>
distributed under the License is distributed on an "AS IS" BASIS,<br>
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.<br>
See the License for the specific language governing permissions and<br>
limitations under the License.<br>
-- Do not start or end with a newline character<br>
- Open tree item "Copyright"<br>
-- Combobox "Default project copyright": JBoss Inc<br>
<font color="#888888"><br>
--<br>
With kind regards,<br>
Geoffrey De Smet<br>
<br>
_______________________________________________<br>
rules-dev mailing list<br>
<a href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-dev</a><br>
</font></blockquote></div><br>