This week's book giveaway is in the Spring forum.
We're giving away four copies of Spring in Action (5th edition) and have Craig Walls on-line!
See this thread for details.
Win a copy of Spring in Action (5th edition) this week in the Spring forum!
  • 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:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

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: 19986
95
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!