• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

IDE auto generated code...

 
Ranch Hand
Posts: 264
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is there a way to change (In Eclipse and Netbeans, using/playing with both at the moment) to change the way the autogenerated code is formatted?

I really dislike having the { at the end of the line and not the start of a new line. I know the different styles have names (can't think of them off the top of my head) but is there an easy way to switch the style used by the ide?

-Tad
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In Eclipse look at Preferences>Java>Code Style>Code Formatter. Set the style you like there and format classes via Source>Format or CTRL+SHIFT+F. Don't know about NetBeans, sorry.
 
Saloon Keeper
Posts: 27763
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The original Eclipse formatter was (IMHO) pretty awful. More recent ones do better, but I like the Jalopy plugin, which comes about as close to being able to format things exactly the way I like as mindless software can get.
 
reply
    Bookmark Topic Watch Topic
  • New Topic