Community
Participate
Working Groups
To help ensure code consistency and standards, it would be very useful if the source formatter could be invoked in batch. Although a large majority of our developers are using Eclipse 3.0, some use WSAD (based on 2.1, which does not support all the 3.0 format options), others use other IDE, Emacs etc. If the formatter could be invoked via the command line, then we could have consistent formatting across users, which will result in fewer diffs in our CVS commits. An important part of a command line formatter would be command line options to refer to a saved set of format parameters/options. Although other command line tools exist (jalopy, etc.) the Eclipse formatter is the most convenient for the widest set of our internal users, so rather than force Eclipse users to replace the Eclipse formatter with an outside tool, exposing the Eclipse formatter to other users is our preference. A separate feature request addresses invoking the formatter via an API ( 46398 ) as well as 12144 to reformat multiple files in a project, but I suspect those only work within an active Eclipse session.
Post 3.0
According to New&Noteworthy <http://download.eclipse.org/eclipse/downloads/drops/S-3.2M5-200602171115/eclipse-news-M5.html>, this feature has been added in 3.2M5. On the other hand, when I tried it, I got an error, with the log message: java.lang.RuntimeException: Application "org.eclipse.jdt.core.JavaCodeFormatter" could not be found in the registry. N&N mentions a section in the user guide which seems to be missing. Thus I have the feeling that the feature didn't really make it after all.
Changes got released for M5. See bug 75333
olivier - pls instruct how to use standalone formatter.
*** This bug has been marked as a duplicate of 75333 ***
I just discovered that I was in the 3.2M4 directory, not M5 as I thought. Sorry!