Code Style

barbeau edited this page Aug 3, 2012 · 5 revisions

Eclipse Configuration

If you are using Eclipse for development, we have a number of files to help you maintain consistent project code styling.

All settings files can be checked out from the GitHub repository:

git://github.com/OneBusAway/onebusaway.git

Specifically:

https://github.com/OneBusAway/onebusaway/tree/master/eclipse

We will also provide direct links to files where applicable.

Code style/formatting

Project -> Properties -> Java Code Style -> Formatter -> Import...

eclipse/code-style/org.onebusaway-format.xml

Or download:

https://raw.github.com/OneBusAway/onebusaway/master/eclipse/code-style/org.onebusaway-format.xml

XML style/formatting

Unfortunately, you have to manually configure XML formatting under Window->Preferences->XML->XML Files->Editor:

  • Line width: 120
  • Indent using spaces
  • Indentation size: 2

XML style/formatting

Import organization

Project -> Properties -> Java Code Style -> Organize Imports -> Import...

eclipse/code-style/org.onebusaway.importorder

Or download:

https://raw.github.com/OneBusAway/onebusaway/master/eclipse/code-style/org.onebusaway.importorder

Class Member Sort Order

Class Member Sort Order

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.