简体   繁体   中英

How do I set the value of ${user} in Netbeans 7.1.2?

I would like to replace the default value of ${user} in Netbeans. The help file says

To define a parameter:

  1. In the IDE's menu bar, choose Tools > Templates. The Template Manager opens.

  2. Expand the Other category. Double-click on Properties. The User.properties file opens in the editor.

  3. Define a parameter. For example, define the ${user} parameter for adding your name to templates you create. The syntax is 'user=LorumIpsum@mycompany.com'. When a code template is expanded, all occurrences of ${user} in that template are replaced with 'LorumIpsum@mycompany.com'.

  4. Add as many additional parameters as you want, with the syntax name=value.

On Step 2, double-clicking on Properties does nothing. I tried opening the Properties template in the editor and adding a 'user' property. I also tried adding a file, based on the Properties template, to a project. Neither of these changed the output when I created a new file.

How do I do this in Netbeans 7.1.2?

As I composed this question, I found the solution and want to post it here for others to reference. The instructions in the Netbeans helpfile is incorrect. Step 2 should be changed as follows:

  1. ...

  2. Expand the Other category. Click the Setting button. The User.properties file opens in the editor.

I hope this is useful to someone in the future.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM