• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

How to format all java files as per Sun's or Eclipse Standards ?  RSS feed

 
Ranch Hand
Posts: 423
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Please advice on how to change all/ java related files in my project to Sun's or Eclipse Standards ?
 
Bartender
Posts: 19731
92
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's a very nice app called Jalopy that can do bulk pretty-printing according to a very customizable set of rules, including the Sun ones. It can be run stand-alone from the command line or as a plug-in to Eclipse (and IntelliJ, for that matter).

However, I believe that if you right (menu) click in the Explorer view on the directory that contains the Java files of interest, select Source/Format, all of the Java files in that directory and its children will be run through the formatter. I do recommend making a backup first, though.
 
Ranch Hand
Posts: 1179
Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Before using the "Source->Format" option, you need to be sure that it is set-up as you want it to be, and maybe you need to run the "Source->Clean Up..." options first - and then maybe you also want to perform a "Save Actions" each time you save your code....
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!