netbeans 修改php的注释方法,如何更改NetBeans 8.2代码模板的默认@author值

本文概述

通常, 当你在NetBeans中使用Java或PHP时, 自动创建的类将在类的注释中包含@author文档, 例如, 如果在NetBeans上没有配置用户来更改此内容, 则该类将如下所示:

/*

* To change this license header, choose License Headers in Project Properties.

* To change this template file, choose Tools | Templates

* and open the template in the editor.

*/

package sandbox;

/**

*

* @author sdkca

*/

public class Sandbox {

/**

* @param args the command line arguments

*/

public static void main(String[] args) {

System.out.println("Hello World!");

}

}

如你所见, 通常NetBeans将使用计算机的用户名, 或者只是不将@author标记添加到文档中。你可以使用自定义模板自动更改在创建此类文件期间由NetBeans设置的默认文本。在本文中, 我们将向你介绍如何在NetBeans 8.2中轻松配置它。

1.打开NetBeans模板管理器

要打开NetBeans的模板管理器, 请访问顶部栏菜单上的”工具”按钮, 然后单击”模板”选项:

547ef64ea53b26518d325c52753f478a.png

单击模板后, 将出现一个新窗口, 即模板管理器窗口。出现此窗口后, 单击”设置”:

59c01e5ed010af863137c8c5884e09cf.png

2.修改User.properties文件

在上一个对话框中单击”设置”后, NetBeans将在新选项卡中打开IDE的User.properties文件。默认情况下, 此文件包含以下文本:

#

# Here, or in other properties files in this directory, you can define

# various properties that you want to make available to the template

# processor while creating various templates.

#

# uncomment the next line and specify your user name to be used in new templates

# user=Your Name

作者的属性是用户, 因此将要显示在包含此变量的新类或代码模板上的文本定义为值。例如, 我们将使用下一个值修改我们的值:

#

# Here, or in other properties files in this directory, you can define

# various properties that you want to make available to the template

# processor while creating various templates.

#

# uncomment the next line and specify your user name to be used in new templates

user=Carlos Delgado

将更改保存到文件后, 如果继续创建使用该值的新文件, 则会找到新的作者文本:

15ecf6cf191f9228964184fa33dc523e.png

编码愉快!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值