The following instructions cover how to configure eclipse to use files and conventions to comply with JBoss coding standards.
(version 3.7 used)
(Ctrl+Shift+F by default)
- Download the jboss-java-formatter.xml file in this directory.
- In Eclipse preferences go to Java -> Code Style -> Formatter
- Click Import
- Select the formatting file you downloaded in step (1)
(not bound by default, use of Ctrl+Shift+O recommended)
- Download the jboss-java-cleanup.xml file in this directory.
- In Eclipse preferences for to Java -> Code Style -> Clean-up
- Click Import
- Select the clean-up file you downloaded in step (1)
Map the Clean-up Rules to Ctrl+Shift+O
- You may have to unbind Ctrl+Shift+O from "Organise imports" action first
- In Eclipse preferences go to General -> Keys
- Type "clean" into filter input ("type filter text")
- Select Clean-up
- Setup Binding: focus the input and type Ctrl+Shift+O as individual keys (or any other preferred shortcut)
Will create proper JBoss copyright headers for new Java class files.
- Download the jboss-java-templates.xml file in this directory.
- In Eclipse preferences for to Java -> Code Style -> Code Templates
- Click Import
- Select the clean-up file you downloaded in step (1)
(Ctrl+Shift+F by default)
- Download the jboss-js-formatter.xml file in this directory.
- In Eclipse preferences go to JavaScript -> Code Style -> Formatter
- Click Import
- Select the formatting file you downloaded in step (1)
(not bound by default, use of Ctrl+Shift+O recommended - see above)
- Download the jboss-js-cleanup.xml file in this directory.
- In Eclipse preferences for to JavaScript -> Code Style -> Clean-up
- Click Import
- Select the clean-up file you downloaded in step (1)
Will create proper JBoss copyright headers for new JavaScript files.
- Download the jboss-js-templates.xml file in this directory.
- In Eclipse preferences for to JavaScript -> Code Style -> Code Templates
- Click Import
- Select the clean-up file you downloaded in step (1)
- In Eclipse Preferences go to General -> Editors -> Text Editors
- Setup
- Insert spaces for tabs: YES
- Show print margin: YES
- Print margin column: 128
- In Eclipse Preferences go to XML -> XML Files -> Editor
- Setup
- Line width: 128
- Split multiple attributes each on new line: NO
- Align final bracked in multi-line element tags: NO
- Preserve whitespace in tags with PCDATA content: NO
- Clear all blank lines: NO
- Format comments: NO
- Insert whitespace before closing empty eng-tags: YES
- Indent using spaces
- Indentation size: 4
- In Eclipse Preferences go to -> Web -> HTML Files -> Editor
- Setup
- Line width: 128
- Split multiple attributes each on new line: NO
- Align final bracked in multi-line element tags: NO
- Clear all blank lines: NO
- Indent using spaces
- Indentation size: 4
- Tag names: Lowercase
- Attribute names: Lowercase
- In Eclipse Preferences go to Web -> CSS Files -> Editor
- Setup
- Line width: 128
- Insert line break between properties: YES
- Disable wrapping in style attribute of Html: YES
- Indent using spaces
- Indentation size: 4
- Capitalization style: all Lowercase
Will create proper JBoss copyright headers for new CSS files.
- Download the jboss-css-templates.xml file in this directory.
- In Eclipse preferences go to Web -> CSS Files -> Editor -> Templates
- Click Import
- Select the clean-up file you downloaded in step (1)