Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make the Eclipse code template like this?

Tags:

java

eclipse

In some Eclipse project, I can see the every code file(.java) has a code template like this:

public class AClass {
  // ===========================================================
  // Constants
  // ===========================================================

  // ===========================================================
  // Fields
  // ===========================================================

  // ===========================================================
  // Constructors
  // ===========================================================
  // ===========================================================
  // Getter & Setter
  // ===========================================================

  // ===========================================================
  // Methods for/from SuperClass/Interfaces
  // ===========================================================

  // ===========================================================
  // Methods
  // ===========================================================

  // ===========================================================
  // Inner and Anonymous Classes
  // ===========================================================
}

I want to generate these comments automatically when create a new java class, so how do I do?

I try to set the code templates in Eclipse preferences, but didn't success.

like image 773
pixeloverflow Avatar asked Jan 09 '11 17:01

pixeloverflow


1 Answers

You have to go to the Eclipse Preferences, to the Java/Code Style/Code Template and choose for example New Java File or Class body, and edit it!

like image 161
Gillespie59 Avatar answered Sep 24 '22 07:09

Gillespie59