Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Code Headers
Code Headers [message #191400] Thu, 01 February 2007 14:02 Go to next message
Eclipse UserFriend
Originally posted by: erick.p.heberling.lmco.com

I'm trying to set up a code comment header that my team can use throughout
our projects through Rational Clearcase. The catch is that it this must
be generated as the first line of the source file, prior to package
declaration and import statements. I've tried using the Eclipse built in
file comment, but then whenever I package the source file, the package
shows before the header. Is there anything I can do get the header before
the package declarations?

Thank you,
Re: Code Headers [message #191424 is a reply to message #191400] Thu, 01 February 2007 14:15 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: csae7511.uibk.ac.at

Hi,

See:
Window --> Preferences --> Java --> Code Style --> Code Templates.
Select "New Java files" from "Code".

Here it should be possible to enter your header.

Hope that helps,
Stefan

Erick schrieb:
> I'm trying to set up a code comment header that my team can use
> throughout our projects through Rational Clearcase. The catch is that
> it this must be generated as the first line of the source file, prior to
> package declaration and import statements. I've tried using the Eclipse
> built in file comment, but then whenever I package the source file, the
> package shows before the header. Is there anything I can do get the
> header before the package declarations?
>
> Thank you,
>
Re: Code Headers [message #191478 is a reply to message #191424] Thu, 01 February 2007 19:45 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: erick.p.heberling.lmco.com

Stefan,

Thank you for your answer.

I am able to generate a header, however I have some very specific rules to
follow about the header being set before the package declarations.

When I try to set this through the preferences it places the package prior
to the header.

Thanks,
Re: Code Headers [message #191495 is a reply to message #191478] Thu, 01 February 2007 20:41 Go to previous message
Eclipse UserFriend
Originally posted by: csae7511.uibk.ac.at

Hmm ... strange - I tried following template for "New Java files":

/*preheader*/
${filecomment}
${package_declaration}

${typecomment}
${type_declaration}



Results to following java file:

/*preheader*/
package core;

import java.util.List;

public class Test
{
....
}

Wasn't this you wanted to have or did I misunderstand you?

Regards,
Stefan


Erick schrieb:
> Stefan,
>
> Thank you for your answer.
> I am able to generate a header, however I have some very specific rules
> to follow about the header being set before the package declarations.
> When I try to set this through the preferences it places the package
> prior to the header.
>
> Thanks,
>
Previous Topic:Souce not found -- I had source -- now I don't...
Next Topic:Eclipse Classpath default packages
Goto Forum:
  


Current Time: Thu Apr 18 06:13:51 GMT 2024

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

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

Back to the top