Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsFormatting jet-generated java sources according to Eclipse formatting rules ?
https://www.eclipse.org/forums/index.php/mv/msg/17246/55255/#msg_55255
Eclipse formatting rules ?
sure I could manually select the files and invoke the formatter, but
since they are scattered acorss my projects and packages it's too long
and error-prone, so I'd rather have it done as part of the one-click
code generation ...]]>Edoardo Comar2009-01-12T15:20:13-00:00Re: Formatting jet-generated java sources according to Eclipse formatting rules ?
https://www.eclipse.org/forums/index.php/mv/msg/17246/55362/#msg_55362
A quick look at the JDT APIs reveals CodeFormatter.format:
So, a basic code format could be implemented as a function tag that called
this. It gets a little tricky, as format returns a TextEdit, the the Java
doc shows how to turn this into a modified string:
So, all this suggests you could implement a tag such as:
<x:javaFormat project="foo.bar">
..... Java code to format ...
</x:javaFormat>
I'd be interested in adding such a tag to JET. Would you be interested in
implementing it (and getting your masters to agree to its contribution)?
Paul
"Edoardo Comar" <ecomar@uk.ibm.com> wrote in message
news:gkfn3e$5an$1@build.eclipse.org...
> How can I get the jet-generated java sources formatted according to
> Eclipse formatting rules ?
>
> sure I could manually select the files and invoke the formatter, but since
> they are scattered acorss my projects and packages it's too long and
> error-prone, so I'd rather have it done as part of the one-click code
> generation ...]]>Paul Elder2009-01-14T13:21:01-00:00