• 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

Question about code style

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, everybody,

i would like to use the code style described in http://www.javaranch.com/styleLong.jsp
(not sun's code style)

and how can i use this code style in Eclipse?

sofar i konw that in eclipse there is a fomatter tool, through that i can also import code style xml in eclipse.

Then, i want to know, if there is any available code style definition xml which differs from sun's ?

Thanks in advance !
 
author
Posts: 3285
13
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi there,

Sun's and JavaRanch's don't differ too greatly, you'd probably be quickest using Eclipse's option to start a new formatter 'based off sun stds' and tweak the one or two options as needed.

Cheers,
Martijn
 
Marshal
Posts: 79177
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You should really be on the IDEs forum, but . . .
  • Start Eclipse as usual
  • Click Window
  • Click Options
  • Click Java at the left of the new window
  • Click Formatter
  • Underneath active settings click New
  • Set a name for the new settings
  • Click Edit
  • You get a window with about 8 tabs. Each tab gives you dozens of options you can set.
  • For "Braces" you can decide which sort of brace goes on a new line. Etc etc
  • Click OK once, back to Preferences
  • I suggest you go to compiler
  • then errors and warnings
  • Go through the list of possible errors and take "ignore" off as many as possible.
  • OK, OK until you are back in the IDE
  • I like to have all the warnings in fusspot mode; that reduces the risk of a silly little error like these:CR
    [edit]You want lots of potential errors set to "warning," then you get a yellow mark against them and can correct them.[/edit]
    [ December 12, 2007: Message edited by: Campbell Ritchie ]
     
    Don't get me started about those stupid light bulbs.
    reply
      Bookmark Topic Watch Topic
    • New Topic