0

I have a Eclipse project. I am searching for a way to generate code-templates that will appear automatically when I am adding a file to the project. For example, I want to add a documentation code-template (eclipse's template is-

/**
 ** 
 ** @author:
 **/)

such that it will automatically appear in each java class file I add to the project, without making it manually.

Is there a good way to do so?

2 Answers 2

2

You're able to change this behavior in

Window -> Preferences -> Java -> Code Style -> Code templates -> Comments -> Files
Sign up to request clarification or add additional context in comments.

3 Comments

Hi, this one I know, just to be more clearer - I aim that the auto- documentation shown above will appear automatically every time any of the project's programmers (has the git repository) creates a new file, not just in my local eclipse
@shakedsapir In the mentioned preference page follow the link in the upper right corner Configure Project Specific Settings... for that (or go directly to Project > Properties: Java Code Style > Code Templates).
@howlger Thank you very much! it is exactly what I was needed. also thank you wiomoc for your answer
0

Sharing @howlger answer: In eclipse - Window>Preferences>Configure Project Specific Settings> choose project and then ok , then add any code-template you want.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.