NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

IDE 6.5 Formatting

 
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Users
View previous topic :: View next topic  
Author Message
sidsewell



Joined: 20 Feb 2009
Posts: 2
Location: Hornchurch, UK

PostPosted: Fri Feb 20, 2009 7:58 am    Post subject: IDE 6.5 Formatting Reply with quote

Hi, Is there anyway to change the formatting to put the first curly brace in a block on the next line. ie. public class My Class
{
}

Rgds/Sid Question
Back to top
Thembile
Posted via mailing list.





PostPosted: Fri Feb 20, 2009 8:57 am    Post subject: IDE 6.5 Formatting Reply with quote

Netbeans has quite a flexible format customization facility:
On MacOSX

1. go to NetBeans -> Preferences
2. Click on Editor
3. Select "Formatting" tab
4. Where it says "Languages" choose "Java", the default is "All Languages"
5. Where it says "Category" choose "Braces", the default is "Tabs and Indents"
6. Change "Class Declaration" to "New Line", the default is "Same Line"

I'm sure there are better instructions with pictures somewhere on the wiki.


On Thu, Feb 19, 2009 at 11:58 PM, sidsewell <address-removed ([email]address-removed[/email])> wrote:
Quote:
Hi, Is there anyway to change the formatting to put the first curly brace in a block on the next line. ie. public class My Class

{

}



Rgds/Sid [Question]




Back to top
Pavel Pribyl
Posted via mailing list.





PostPosted: Fri Feb 20, 2009 8:58 am    Post subject: IDE 6.5 Formatting Reply with quote

Yes. It is possible.

Please go to Tools - Options, select "Editor" options and "Formatting" tab.
Select Language: Java, Category: Braces.

You can then modify the Braces placement.

But if you want the braces to be placed correctly in the moment you create
new class, you have to modify the Java Class template. (Tools - Templates -
Java - Java Class)

Hope that helps

Pavel

sidsewell wrote:
Quote:

Hi, Is there anyway to change the formatting to put the first curly brace
in a block on the next line. ie. public class My Class

{

}



Rgds/Sid [Question]







--
View this message in context: http://www.nabble.com/IDE-6.5-Formatting-tp22116322p22117077.html
Sent from the Netbeans IDE Users mailing list archive at Nabble.com.
Back to top
Jiri Prox
Posted via mailing list.





PostPosted: Fri Feb 20, 2009 8:59 am    Post subject: IDE 6.5 Formatting Reply with quote

Hi,

yes, you can customize formatting in Tools -> Options -> Editor ->
Formatting, here select language Java and category Braces

Regards
Jirka

sidsewell wrote:
Quote:
Hi, Is there anyway to change the formatting to put the first curly brace in a block on the next line. ie. public class My Class

{

}



Rgds/Sid [Question]




Back to top
sidsewell



Joined: 20 Feb 2009
Posts: 2
Location: Hornchurch, UK

PostPosted: Fri Feb 20, 2009 9:16 am    Post subject: Re: IDE 6.5 Formatting Reply with quote

sidsewell wrote:
Hi, Is there anyway to change the formatting to put the first curly brace in a block on the next line. ie. public class My Class
{
}

Rgds/Sid Question


Brilliant ! Very Happy Thanks for the quick response guys, I can read my code again now ;-
Back to top
Posted via mailing list.






PostPosted: Fri Feb 20, 2009 9:30 am    Post subject: Reply with quote

Hello every ,how can I unsubscript this email list? Thank you

Back to top
Jess Holle
Posted via mailing list.





PostPosted: Fri Feb 20, 2009 12:32 pm    Post subject: IDE 6.5 Formatting Reply with quote

One complaint here:

There are a variety of items in the IDE that do not obey the formatting
rules you set up here.

The reformat command does, but a lot of code insertion and addition
actions ignore these rules. This goes beyond "new class/interface",
though that's annoying as well in that you have to change a template in
addition to your formatting rules...

Jiri Prox wrote:
Quote:
Hi,

yes, you can customize formatting in Tools -> Options -> Editor ->
Formatting, here select language Java and category Braces

Regards
Jirka

sidsewell wrote:
Quote:
Hi, Is there anyway to change the formatting to put the first curly
brace in a block on the next line. ie. public class My Class

{

}

Rgds/Sid [Question]
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo