Solved

eclipse formatting

Posted on 2016-11-05
6
92 Views
Last Modified: 2016-11-14
Hi,
In eclipse when i write code and to format i press Control+Shift+F keys together. it is formatting as attached on contl1 attachment where
for(){//here i want { in next line 

Open in new window


But i want formatting as in attachment contl2 so that
 { is in next line which is same vertical line as closing } 

Open in new window

so that i understand easily where control block starting and ending. how to achieve this custom formatting in eclipse please advise
contl1.png
contl2.png
0
Comment
Question by:gudii9
  • 3
  • 2
6 Comments
 
LVL 21

Accepted Solution

by:
Amitkumar Panchal earned 250 total points
ID: 41875922
Hi,

I found that code in both the images are of same formatting.

However, you can control the formatting through the option under Window->Preferences->Java->Code Style->Formatter, then click the "Edit.." button.

Refer : http://www.wikihow.com/Change-the-Default-Format-Settings-in-Eclipse
0
 
LVL 35

Assisted Solution

by:mccarl
mccarl earned 250 total points
ID: 41876447
And to add to Amit's answer, because it can be a little hard to find. Once, you click the Edit button as above, then go to the "Braces" tab and change all the options from "Same line" to... "Next line"
0
 
LVL 7

Author Comment

by:gudii9
ID: 41876494
oops i missed right screenshot. I attached actual screenshot on how i want my formatting. If you see line 8 you see there is no { instead it moved to line 9 which makes more appealing to my eyes. please advise
pyramidFormat.png
0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
LVL 35

Expert Comment

by:mccarl
ID: 41876578
please advise

We already did!! Did you miss the rest of Amit's post or my post?
0
 
LVL 7

Author Comment

by:gudii9
ID: 41879313
I found that code in both the images are of same formatting.

However, you can control the formatting through the option under Window->Preferences->Java->Code Style->Formatter, then click the "Edit.." button.

Refer : http://www.wikihow.com/Change-the-Default-Format-Settings-in-Eclipse

after changing if i want go back to original default how to do that?
0
 
LVL 35

Expert Comment

by:mccarl
ID: 41880479
Just change it back
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
What is the Best Editor for PHP Development ? 5 75
Arrays.asList  VS  ArrayList 4 60
Tomcat: Unable to run tomcat service. 2 20
Html Table Looping (part 2) 5 11
Programmer's Notepad is, one of the best free text editing tools available, simply because the developers appear to have second-guessed every weird problem or issue a programmer is likely to run into. One of these problems is selecting and deleti…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question