Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Advanced (Unorthodox?) Formatting in Eclipse(Source Code Formatting)
Advanced (Unorthodox?) Formatting in Eclipse [message #766649] Fri, 16 December 2011 07:36 Go to next message
David Illescas is currently offline David IllescasFriend
Messages: 1
Registered: December 2011
Junior Member

Although I am a newcomer to this forum I am not a newcomer to Eclipse. I have, however, failed to make use of its powerful source code formatting features because, well, the way I format my code is rather idiosyncratic.

Consider the following snippet:

package source;

import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;

public class 
extends SomeClass
implements SomeInterface
	 * @param args
	public static void 
	(String[] args) 
		("Hello World from Java 1.7");
		List<Integer> complicated_object =
			new LinkedList<Integer>( Arrays.asList(new Integer[]{5,6,7,8,9}) );


	private static void 
	(String string) 
					"You entered some other number, and yes, I know this" +
					"\"error\" message could be more helpful."

As you can see there are a number of odd things happening above, and I am not sure that the range of settings on the source code formatter permits my code to look this way(I could be mistaken about this). For instance, I break the linked list declaration at the assignment operator; I also put the class name on its own line, and the method name on its own line; I put short argument lists on the same line as the method name, medium length argument lists on their own line, and multi-line argument lists using a traditional function brace arrangement.

I am wondering if anyone knows of any "low-level" interface for configuring the source code formatter, so that the formatting and clean-up can be made completely consistent and automatic.

Thank you.

[Updated on: Fri, 16 December 2011 08:15]

Report message to a moderator

Re: Advanced (Unorthodox?) Formatting in Eclipse [message #766989 is a reply to message #766649] Fri, 16 December 2011 19:58 Go to previous message
Deepak Azad is currently offline Deepak AzadFriend
Messages: 545
Registered: July 2009
Senior Member
Nope, you cannot set the formatter to place method arguments on a new line.

Deepak Azad
Previous Topic:Finding class declarations in workspace
Next Topic:Special Characters not displayed in text editor
Goto Forum:

Current Time: Tue Jun 19 10:24:49 GMT 2018

Powered by FUDForum. Page generated in 0.03197 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top