Menu

NetBeans

Anders Widell
Attachments
Duplicate.png (20087 bytes)
Header.png (65035 bytes)
IgnoreEmptyFunctions.png (65847 bytes)
IndentNamespaces.png (66324 bytes)
IndentSize.png (63234 bytes)
Linux.png (66452 bytes)
Manage.png (62545 bytes)
MultilineAlignment.png (69521 bytes)
Options.png (29857 bytes)
OptionsOk.png (68152 bytes)
SelectOpenSAF.png (66342 bytes)
StyleName.png (10420 bytes)
StyleOk.png (19746 bytes)
TrailingWhitespace.png (47360 bytes)

Here you will find instructions for how to set up the Google C++ code style in Netbeans.

Step-by-step instructions

1) Open the Options dialog in Netbeans:

Options

2) Select the Editor->On Save category and change the Trailing Whitespace From: setting to Modified Lines Only:

Trailing Whitespace

3) Select the Editor->Formatting category, change Language: to C, and change the Style: setting to Linux:

Linux

4) On the same page, change Language: to C++, and click the Manage button:

Manage

5) In the new window named "Manage Styles" that popped up, select NetBeans and click Duplicate:

Duplicate

6) In the new window named "Style Name" that popped up, write "OpenSAF" in the Name: field, and then press the OK button:

Style Name

7) In "Options" window, change the Style: setting to OpenSAF:

OpenSAF Style

8) Check the Override Global Options check box:

Override Global Options

9) Change Indent Size to 2, Statement Continuation to 4, and Constructor Continuation to 4:

Indent Size

10) Change Indent Namespaces to false, Absolute Label Indentation to false, and Indent Visibility to Half Indent:

Indent Namespaces

11) Change Ignore Empty Functions to true:

Ignore Empty Functions

12) Change all Multiline Alignment check boxes to true:

Multiline Alignment

13) Change Language: to C/C++ Header, and repeat steps 4) to 12):

C/C++ Header

14) Click the OK button in the "Options" window:

Options OK


Related

Wiki: Coding Rules
Wiki: Home
Wiki: development tools