idea to add annotations custom template

1 IDEA custom shortcut (for comment)

1.1 to create custom shortcuts groups

1.1.1 Adding custom shortcuts groups

 

 

 

 

1.1.2 Packet name to

 

1.1.3 you've created and then create member groups (our custom shortcut keys) in the group

 

 

 

 

PS: Abbreviation for example, we should be in lowercase "a", then this group is the custom shortcut keys - to enter in a press the Enter key (Enter);

Shortcuts can also be defined as the Tab key with the spacebar.

 

2 IDEA comment template

2.1 template settings

2.1.1 file header

 

1, the template

/**  
 * 
 * @author: XXX
 * @date: ${YEAR}-${MONTH}-${DAY} ${TIME}
 */

 

 

2, the example of FIG.

 

 

 

 

5.1.2 Class comment tags

1, create a class will automatically add annotations;

2, the template (can be copied)

/ **   
 * {forth action class} 
 * @author : XXX 

 * @date: $ {YEAR} - {MONTH} $ - $ {$ {the TIME DAY}} 
 * /

3, the example of FIG.

 

4, ditto Interface

 

 

 

 

5.1.3 Fields (Fields) comment tags

Field annotation tags directly: / ** + Enter key

2.1.4 Constructors label

 

1, all of the functions described are written at the top

 

2, the template (can be copied)

**
 *
$params$
 **/

 

 

3, the example of FIG.

 

 

 

 

 

 

 

 

 

4, Edit variables configuration

Edit variables are used to configure our template contents $ Name $ (eg: $ title $), what is the value to be displayed yes.

 

 

 

 

Params中Default value的值为: groovyScript("def result=''; def params=\"${_1}\".replaceAll('[\\\\[|\\\\]|\\\\s]', '').split(',').toList(); for(i = 0; i < params.size(); i++) {result+=' * @param ' + params[i] + ((i < params.size() - 1) ? '\\n' : '')}; return result", methodParameters())

(Ps :: Do not use eclipse myeclipse or methods (such as: Time: $ {DATE}) to write format, idea comments are not the same way with them .Template content within the text content is inconsistent with the provisions of the idea, then Figure Edit variables will not be clickable.)

5, how to operate

 

 

 

 

       Text Description: First, the constructor above the input / c, and then press ENTER

 

 

 

2.1.5 Method (Methods) tab

1, the template (can be copied)

**
$params$
 * @return: $return_tpye$
 * @author: bz
 * @date: $date$  $time$ 
 **/

2, the example of FIG.

 

 

   

3, Edit variables configuration

     

 

 

  a)、Params中Default value的值为: groovyScript("def result=''; def params=\"${_1}\".replaceAll('[\\\\[|\\\\]|\\\\s]', '').split(',').toList(); for(i = 0; i < params.size(); i++) {result+=' * @param ' + params[i] + ((i < params.size() - 1) ? '\\n' : '')}; return result", methodParameters())

 

       b), date of Expression To do this: first selection system to the date (), and save. Into the modified date () into date ( "yyyy-MM-dd") to time formatted

5, how to operate

 

 

 

Text Description: first input / m in the above method, and then press ENTER

 

6, annotation content

 

 

 

 

2.1.6 Other Notes

Idea comes directly defined shortcut method Notes ===== "/ ** + Enter key

             

3 comments show

Note the mouse over the display method or field 3.1

3.1.1 Configuration icon

 

 

PS : Please place the required one-line comment annotations are on top, use // . Multi-line annotations using the / * * / annotate. Never allow the end of the line annotations appear!

 

Guess you like

Origin www.cnblogs.com/buzheng/p/12500023.html