Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » JavaCodeFormatter does not do the line wrapping
JavaCodeFormatter does not do the line wrapping [message #249906] Sat, 01 December 2007 05:03 Go to next message
Eclipse UserFriend
I tried JavaCodeFormatter from command line. But it does not do the line
wrapping.
I use the same formatter in Eclipse. It works. Any ideas? Thanks a lot.
Re: JavaCodeFormatter does not do the line wrapping [message #249909 is a reply to message #249906] Sat, 01 December 2007 05:18 Go to previous messageGo to next message
Eclipse UserFriend
It wraps lines for Java source code. But it does not wrap lines for
Javadoc. I use the same formatter in Eclipse. It works.
Re: JavaCodeFormatter does not do the line wrapping [message #249913 is a reply to message #249909] Sat, 01 December 2007 06:15 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

This is a multi-part message in MIME format.
--------------090408040305020703010803
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Jing,

Most likely this has to do with the preferences in your config file. I
can't say I actually could find the information in the help
documentation for how to generate the file though but I suppose you'd
export your formatter profile and use that.

$ eclipsec.exe -application org.eclipse.jdt.core.JavaCodeFormatter
No configuration file specified.

Usage: eclipse -application org.eclipse.jdt.core.JavaCodeFormatter [
OPTIONS ] -config <configFile> <files>

<files> Java source files and/or directories to format.
Only files ending with .java will be formatted in the
given directory.
-config <configFile> Use the formatting style from the specified
properties file.
Refer to the help documentation to find out
how to generate this file.

OPTIONS:

-help Display this message.
-quiet Only print error messages.
-verbose Be verbose about the formatting job.


Jing Guo Yao wrote:
> It wraps lines for Java source code. But it does not wrap lines for
> Javadoc. I use the same formatter in Eclipse. It works.
>


--------------090408040305020703010803
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Jing,<br>
<br>
Most likely this has to do with the preferences in your config file.
Re: JavaCodeFormatter does not do the line wrapping [message #249930 is a reply to message #249913] Sun, 02 December 2007 05:48 Go to previous messageGo to next message
Eclipse UserFriend
Hi, Ed

Thanks a lot for your help. I really like this eclipse feature.

I generated my config file refering to the Eclipse document "Generating a
config file for the formatter application". I does all the things as the
document specifies.
I issue the following command to run JavaCodeFormatter.

D:\gnu\eclipse-java-europa-fall2\eclipsec.exe -nosplash -application
org.eclipse.jdt.core.JavaCodeFormatter -config org.eclipse.jdt.core.prefs
-verbose Person.java

I use the following java file as input.

/**
* Comment for the java class. It is a long long long long description for
the class. It should be wrapped.
*
* @author Administrator
*
*/
public class Person {
private String name;

/**
* Returns the name. It is a long long long long long long description
It should be wrapped.
*
*
* @return The name. It is a long long long long long description for the
parameter.
*/
public String getName() {
return name;
}

}

It only formats the java code. It does not do line wrapping from javadocs.
The output is the same as the input.
I got java comments wrapped when I press Ctrl+Shift+F in eclipse.

/**
* Comment for the java class. It is a long long long long description for
the
* class. It should be wrapped.
*
* @author Administrator
*
*/
public class Person {
private String name;

/**
* Returns the name. It is a long long long long long long description .It
* should be wrapped.
*
*
* @return The name. It is a long long long long long description for the
* parameter.
*/
public String getName() {
return name;
}

}

I have tried it on Eclipse 3.2.2 and eclipse europa fall2.

Are there any things I have done wrong?
Re: JavaCodeFormatter does not do the line wrapping [message #249934 is a reply to message #249930] Sun, 02 December 2007 05:52 Go to previous messageGo to next message
Eclipse UserFriend
I formatted the java source code in the previous post. Sorry for that.

Thanks a lot for your help. I really like this eclipse feature.

I generated my config file referring to the Eclipse document "Generating a
config file for the formatter application". I does all the things as the
document specifies.
I issue the following command to run JavaCodeFormatter.

D:\gnu\eclipse-java-europa-fall2\eclipsec.exe -nosplash -application
org.eclipse.jdt.core.JavaCodeFormatter -config org.eclipse.jdt.core.prefs
-verbose Person.java

I use the following java file as input.

/**
* Comment for the java class. It is a long long long long description for
the class. It should be wrapped.
*
* @author Administrator
*
*/
public class Person {
private String name;

/**
* Returns the name. It is a long long long long long long description
It should be wrapped.
*
*
* @return The name. It is a long long long long long description for the
parameter.
*/
public String getName() {
return name;
}

}

It only formats the java code. It does not do line wrapping from javadocs.
The output is the same as the input.
I got java comments wrapped when I press Ctrl+Shift+F in eclipse.

/**
* Comment for the java class. It is a long long long long description for
the class. It should be wrapped.
*
* @author Administrator
*
*/
public class Person {
private String name;

/**
* Returns the name. It is a long long long long long long description .It
* should be wrapped.
*
*
* @return The name. It is a long long long long long description for the
* parameter.
*/
public String getName() {
return name;
}

}


I have tried it on Eclipse 3.2.2 and eclipse europa fall2. Are there any
things I have done wrong?
Re: JavaCodeFormatter does not do the line wrapping [message #249938 is a reply to message #249934] Sun, 02 December 2007 07:45 Go to previous message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Jing,

If the problem appears to be a legitimate bug, then I'd suggest opening
a bugzilla report with a test file to be formatted as well as your
formatting preferences that include a preference for doing comment line
breaking. Check specifically that "Comments" section of the preferences
have "Enable ..." checked and have a look if changing these settings
affect the preference file that's generated for you. Perhaps the
problem is that the preference choices aren't being saved properly in
the preference file. If you open a bugzilla someone will try it and if
it's broken their fix it and if there's a user error, they'll explain
what it is...


Jing Guo Yao wrote:
> I formatted the java source code in the previous post. Sorry for that.
>
> Thanks a lot for your help. I really like this eclipse feature.
>
> I generated my config file referring to the Eclipse document
> "Generating a config file for the formatter application". I does all
> the things as the document specifies.
> I issue the following command to run JavaCodeFormatter.
>
> D:\gnu\eclipse-java-europa-fall2\eclipsec.exe -nosplash -application
> org.eclipse.jdt.core.JavaCodeFormatter -config
> org.eclipse.jdt.core.prefs -verbose Person.java
>
> I use the following java file as input.
>
> /**
> * Comment for the java class. It is a long long long long description
> for the class. It should be wrapped.
> * * @author Administrator
> * */
> public class Person {
> private String name;
>
> /**
> * Returns the name. It is a long long long long long long
> description It should be wrapped.
> * * * @return The name. It is a long long long long
> long description for the parameter.
> */
> public String getName() {
> return name;
> }
>
> }
>
> It only formats the java code. It does not do line wrapping from
> javadocs. The output is the same as the input.
> I got java comments wrapped when I press Ctrl+Shift+F in eclipse.
> /**
> * Comment for the java class. It is a long long long long description
> for the class. It should be wrapped.
> * * @author Administrator
> * */
> public class Person {
> private String name;
>
> /**
> * Returns the name. It is a long long long long long long
> description .It
> * should be wrapped.
> * * * @return The name. It is a long long long long
> long description for the
> * parameter.
> */
> public String getName() {
> return name;
> }
>
> }
>
>
> I have tried it on Eclipse 3.2.2 and eclipse europa fall2. Are there
> any things I have done wrong?
>
Previous Topic:Attaching comments to programatically generated AST
Next Topic:Junit Classpath
Goto Forum:
  


Current Time: Mon Apr 21 04:19:20 EDT 2025

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

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

Back to the top