PDA

View Full Version : eclipse file formatting



keeler1
October 18th, 2007, 12:27 AM
I was wondering if there was a way to make eclipse go through a java file and make all the indentations and newlines, and bracket locations conform to the user preferences.

I do a lot of projects where code is given to me and would like to read it in the way I do mine.

I tried use the Source -> Clean Up but that doesnt fix it.

Oh and does anyone know when eclipse 3.3 will be available in the repositories

andyrobo60
October 18th, 2007, 02:53 AM
If you go Window -> Preferences -> Java -> Code Style -> Formatter

You will need to make a new profile, I don't think you can edit the built in profiles. Then if you click the button 'Show' it will give you options for how the code clean up arranges your code. Just change them to your liking, then go source -> clean up again.

As for Eclipse 3.3 I think it may be in Gutsy's repos, and thats out later today (it is for me in the UK). If not then its wait until Hardy or you can download it off the website and install it your self.