5

Most of the IDE gives some templates or insert code options. In netbeans IDE option like "right click in any java source page" then "insert code or (alt+insert)" then we can choose like "constructor","getter setter method" or "tostring method"...etc and if a user does not fulfill it's requirement. For example my requirement is like generated constructor, it's data member must be final or if i want to add some extra code at the generation time. i was going through following steps below

  1. File -> New Project -> NetBeans Modules -> Module
  2. New -> Other -> Module Development -> Code Generator.

it is available in this link.

Then run the project. It will open a new netbeans window -->new project-->java application --> create a classfile--> right click on page --> it will show new option like sample generator. Then will generate a method. So my requirement is when i click sample generator, it will generate a constructor according to my specification and requirement.

let me show you what i am getting. some screen shoot.

First:

first,

Second:

second

1 Answers1

0

A little difficult to follow what you are asking but if I understand you correctly you are asking how to create a custom template file for Netbeans?

There is a tutorial here that describes how to do that. It may be a little out of date though but hopefully close enough to the version of Netbeans you are using.

D-Dᴙum
  • 7,689
  • 8
  • 58
  • 97
  • question can not be an answer – vels4j Apr 20 '18 at 07:00
  • It's not a question alone. It gives a link to to a potential answer. – D-Dᴙum Apr 20 '18 at 07:03
  • 1
    But the question already mentions that the template for constructors can not be customized –  Apr 20 '18 at 07:08
  • 1
    And as I stated 'A little difficult to follow what you are asking'. Plus I don't see in the question where it states in clear English that the constructor cannot be customised. Not sure why someone felt the need to downvote an attempt to provide a *possible* solution but I'm sure it made them feel better :-) – D-Dᴙum Apr 20 '18 at 08:22
  • @Kerry you are sharing a tutorial link. Is it working for netbeans 8.2 ? – Bimal Kumar Dalei Apr 20 '18 at 10:39