Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipse-dev] Modifying default templates

Title: Modifying default templates

Hi,
  i would have prefered searching thru the the ML archives before asking, but there's no search engine (that would really be a usefull feature)...

i went thru the first 5 pages tho...

I've two questions.

First, i want to change the default code templates so that when an Ericsson employee installs Eclipse, he has our standard templates right away, without having to import our xml file manually.

At first, i thought that simply swaping the "eclipse-bin\plugins\org.eclipse.jdt.ui_3.0.1\templates\default-codetemplates.xml" would do the trick.

But it's not the case, that file is loaded only when pressing "restore defaults" even if there isn't any defined workspace yet (first time running eclipse).

Ain't that a weird behavior !?

I got to solve that issue, but in a way i don't like much...
by changing the file i talked about above (for consistency) AND changing the "eclipse-src\plugins\org.eclipse.jdt.ui\core extension\org\eclipse\jdt\internal\corext\template\java\default-codetemplates.xml". That said, i now have to compile our own version of eclipse.... argh...

isn't there another way of achieving this ?!

Secondly, i want a different code convention... we have our own. So far, we've made developpers import it manually.
How do i make ours default ? i haven't found anything similar to default-codetemplates.xml for code conventions...

Yes... i noticed "eclipse-src\plugins\org.eclipse.jdt.core\formatter\org\eclipse\jdt\core\formatter\DefaultCodeFormatterConstants.java".

But it would be a hell of a pain to keep that file in synch as it's not an xml file AND most and foremost, the information is stocked differently ( e.g. org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression = createAlignmentValue(false, WRAP_COMPACT, INDENT_DEFAULT) ).

-Pascal



Back to the top