Idea Add live Template:
File->setting->editor->live Templates
Abbreviation:
*
Template text:
* * $context $ */
Set context content:
Edit variables->default Value
Groovyscript ("c:\\ideacommentlivetemplate.groovy", Currentpackage (), ClassName (), MethodName (), Jsmethodname (), Methodparameters (), Methodreturntype (), Date ("yyyy-mm-dd" ), Time ("HH:mm:ss"))
Ideacommentlivetemplate.groovy Script content:
def packagename = _1;def ClassName = _2;def MethodName = _3;def Jsmethodname = _4;def methodparameters = _5;def Methodretu Rntype = _6;def Date = _7;def time = _8;//fixed, the default is falsedef confirmeddatetime = false;def confirmeddatetimestring = "201 7-06-15 12:20:40 ";//Can be modified to its own relevant information def author =" YZ ";d ef projectName =" ";d EF Version =" V1.0.0 ";d ef copyright =" YZ All rig HTS reserved. "; def outputparams = ""; for (param in methodparameters) {outputparams + = "* @param" + param + ": \ n";} def outputreturntype = "", if (methodreturntype! = "void") {outputreturntype = "* @return:" + methodreturntype + "\ n ";} def outputmethodname = "* @Method:" + methodName + "\ n";d ef outputdesc = "* @Description: \ n" ;d EF outputauthor = "* @author:" + author + "\ n";d ef outputdatetime = "* @CreateDate:" + Date + "" + Time + "\ n", if (confirmeddatetime) {outputdatetime = "* @CreateDate:" + confirmeddatetimestring + "\ n";} def OutputproJectname = "* @Project:" + projectName + "\ n";d ef outputpackagename = "* @Package:" + PackageName + "\ N ";d EF outputclass =" * @Class: "+ className +" \ n ";d ef outputversion =" * @version: "+ ve Rsion + "\ n";d ef outputclassotherinfo = "* @Copyright:" + Copyright + "\ n"; Outputclassotherinfo + = "* @Review Ed: "+" \ n "; Outputclassotherinfo + =" * @UpateLog: Name Date reason/contents\n "; outputclassotherinfo + = "*---------------------------------------\ n"; Outputclassotherinfo + = * * * * * * * \ n ";d ef outputjsmethodname =" * @Method: "+ jsmethodname +" \ n ";d ef outputjsparams =" * @param \ n ";d ef outputjsreturntype =" * @return: \ n ";d ef result ="; result + = "\ n"; if (methodName) {result + = Outputmethodname; result + = Outputdesc; result + = Outputparams; result + = Outputreturntype; result + = Outputauthor; Result + = outPutdatetime;} else if (jsmethodname) {result + = Outputjsmethodname; result + = Outputdesc; result + = Outputjsparams; result + = Outputjsreturntype; result + = Outputauthor; result + = Outputdatetime;} else {result + = Outputprojectname; result + = Outputpackagename; result + = Outputclass; result + = Outputdesc; result + = Outputauthor; result + = Outputdatetime; result + = Outputversion; result + = Outputclassotherinfo;} Result + = "*"; return result;
Set up Apps
Content reprinted from: http://www.cnblogs.com/xzjxylophone/p/7060035.html
Idea uses live template to add groovy scripts to methods, classes, JS methods to add comments (reproduced)