Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » java source code formatting
java source code formatting [message #257309] Mon, 10 November 2008 21:58 Go to next message
Eclipse UserFriend
Originally posted by: paul.news.magma.ca

Hi
Does anyone know of a way to format the java source code as below in
eclipse?
Many thanks,
Paul

I want to format as below where method is a single line for 1 or 2 lines
statements:

public class ABC {
public String getName() { return "jason"; }
}



but it keeps formatting as below which I don't like:

public class ABC {
public String getName() {
return "jason";
}
}
Re: java source code formatting [message #257312 is a reply to message #257309] Tue, 11 November 2008 09:03 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mauro.molinari.cardinis.com

news.eclipse.org ha scritto:
> Hi
> Does anyone know of a way to format the java source code as below in
> eclipse?
> Many thanks,

Try to play with Window | Preferences | Java | Code Style | Formatter,
creating your own profile.

Mauro.
Re: java source code formatting [message #257316 is a reply to message #257312] Tue, 11 November 2008 09:41 Go to previous message
Eclipse UserFriend
I have tried many times (and hours) with Window | Preferences | Java |
Code Style | Formatter to create my own profile, but still unable to
prevent the line wrap on the methods.
Can someone help with the below problem?
Thanks


I want to format as below where method is a single line for 1 or 2 lines
statements:

public class ABC {
public String getName() { return "jason"; }
}



but it keeps formatting as below which I don't like:

public class ABC {
public String getName() {
return "jason";
}
}
Previous Topic:Java source folder as a subfolder in hierarchy
Next Topic:Is there a widget to display diffs for ASTNodes?
Goto Forum:
  


Current Time: Mon Apr 28 02:17:00 EDT 2025

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

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

Back to the top