Solved

eclipse formatting

Posted on 2016-11-05
6
36 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 20

Accepted Solution

by:
Amitkumar Panchal earned 250 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 35

Expert Comment

by:mccarl
Comment Utility
please advise

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

Author Comment

by:gudii9
Comment Utility
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
Comment Utility
Just change it back
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
strCount chalenge 3 50
json format text only 4 64
wordmultiple challenge 12 87
backtracking recursion  code 19 39
Here is a helpful source code for C++ Builder programmers that allows you to manage and manipulate HTML content from C++ code, while also handling HTML events like onclick, onmouseover, ... Some objects defined and used in this source include: …
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

728 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now