idea custom shortcuts

A method of generating comments

1. File -> Settings...

 

 2. Editor -> Live Templates, click the rightmost +

 

 3. The situation according to their own choice, I choose here Live Template

 

 4. Set the shortcut key here is ( "/" + "a" + space three key combination), Expand With me is the middle of the right choice of Space spacebar, according to their own habits to set

 

5. Click on the top right of the Edit variables, not to determine the meaning of the corresponding excerpt online

 

 6. Click the OK button, and then point to Apply

 

 Ultimately Template text:

**
* @Description: $description$
* @Param: $params$
* @return: $returns$
* @Author: Wicher
* @Date: $date$
*/

 

II. Generation template code, do not bother to knock on every time the same

  Step 4 same as before, except to their own template code input shortcut keys ( "t" + space two key combination)

 

 

{the try

}
the catch (MyAccessException E) {
MyRetEntity.setRetcode ( "-. 1");
MyRetEntity.setRetmsg ( "data storage anomaly");
return MyRetEntity;
}
the catch (MyDataUnknowException E) {
MyRetEntity.setRetcode ( ". 9");
MyRetEntity .setRetmsg ( "exception data storage (unknown error)");
return MyRetEntity;
}

Pay attention to tips:

 

Guess you like

Origin www.cnblogs.com/Wicher-lsl/p/11463152.html