pixeloverflow
pixeloverflow

Reputation: 579

How to make the Eclipse code template like this?

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.

Upvotes: 7

Views: 1207

Answers (1)

Emmanuel Demey
Emmanuel Demey

Reputation: 2228

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!

Upvotes: 9

Related Questions