netbeans and code reformatter

Discussion in 'Java' started by lallous@lgwm.org, Aug 10, 2006.

  1. Guest

    Hello

    1)
    When I press ctrl+shift+f to reformat the code, it goes like that:

    void method() {
    for (...) {
    }
    }

    I prefer to have it reformatted as:
    void method()
    {
    for (...)
    {
    }
    }

    How can I set this up?

    2)
    Does netbeans editor support virtual spaces?
    Like when you move the cursor freely w/o the need to have characters at
    that line.
    Cause the IDE will move the cursor to the last character in a line if
    you scroll from a longer line to a shorter line

    Regards,
    Elias
    , Aug 10, 2006
    #1
    1. Advertising

  2. On 10.08.2006 09:38 wrote:
    > I prefer to have it reformatted as:
    > void method()
    > {
    > for (...)
    > {
    > }
    > }
    >
    > How can I set this up?
    >

    Tools -> Options -> Editor, then click on the "Indention" tab

    Thomas
    Thomas Kellerer, Aug 10, 2006
    #2
    1. Advertising

  3. Guest

    Hello Thomas

    Can you be more specific on that option?

    There's an option that reads: "Insert new line before braces", it works
    but with I press ctrl+shift+f to reformat, the old identing still
    applies.

    Hope someone can suggest something that works.

    Regards,
    Elias
    Thomas Kellerer wrote:
    > On 10.08.2006 09:38 wrote:
    > > I prefer to have it reformatted as:
    > > void method()
    > > {
    > > for (...)
    > > {
    > > }
    > > }
    > >
    > > How can I set this up?
    > >

    > Tools -> Options -> Editor, then click on the "Indention" tab
    >
    > Thomas
    , Aug 10, 2006
    #3
  4. bugbear Guest

    wrote:
    > Hello
    >
    > 1)
    > When I press ctrl+shift+f to reformat the code, it goes like that:
    >
    > void method() {
    > for (...) {
    > }
    > }
    >
    > I prefer to have it reformatted as:
    > void method()
    > {
    > for (...)
    > {
    > }
    > }


    Whilst indenting in 'C' was matter of local
    preference, habit or taste, indenting in
    Java has a documented standard.
    http://java.sun.com/docs/codeconv/html/CodeConvTOC.doc.html

    And (IMHO) (almost...) any standard is better
    than a free for all, especially in the era
    of shared and/or open source.

    BugBear
    bugbear, Aug 10, 2006
    #4
  5. Hi,

    which Version of NetBeans do you use ?
    In the moment I use NetBeans 5.0 and 5.5dev (Java 1.5.0_07) and it
    work's fine.
    It do the thinks that do you want.

    Regards
    Michael

    --
    German Netbeans, GlassFish and Java-Forum
    http://www.netbeans-forum.de
    Kroll, Michael, Aug 10, 2006
    #5
  6. Guest

    Hello Michael,

    I am using 4.1, what options specifically you set so that you change
    the code formatting as per the original thread?

    --
    Elias
    Kroll, Michael wrote:
    > Hi,
    >
    > which Version of NetBeans do you use ?
    > In the moment I use NetBeans 5.0 and 5.5dev (Java 1.5.0_07) and it
    > work's fine.
    > It do the thinks that do you want.
    >
    > Regards
    > Michael
    >
    > --
    > German Netbeans, GlassFish and Java-Forum
    > http://www.netbeans-forum.de
    , Aug 14, 2006
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Brian L. Troutwine

    Pylint-like source code reformatter

    Brian L. Troutwine, Mar 31, 2006, in forum: Python
    Replies:
    0
    Views:
    300
    Brian L. Troutwine
    Mar 31, 2006
  2. Andrey Khavryuchenko
    Replies:
    0
    Views:
    619
    Andrey Khavryuchenko
    Jan 15, 2007
  3. Aaron Gray

    C++ code reformatter

    Aaron Gray, Aug 16, 2005, in forum: C++
    Replies:
    9
    Views:
    620
    Vijai Kalyan
    Aug 21, 2005
  4. Diez B. Roggisch
    Replies:
    0
    Views:
    319
    Diez B. Roggisch
    Apr 10, 2008
  5. James Mills

    automated pep8 reformatter ?

    James Mills, Apr 14, 2011, in forum: Python
    Replies:
    2
    Views:
    442
    James Mills
    Apr 14, 2011
Loading...

Share This Page