Eclipse/MyEclipse的快捷键以及文档注释、多行注释的快捷键

您所在的位置:网站首页 eclipse注释快捷键多行 Eclipse/MyEclipse的快捷键以及文档注释、多行注释的快捷键

Eclipse/MyEclipse的快捷键以及文档注释、多行注释的快捷键

#Eclipse/MyEclipse的快捷键以及文档注释、多行注释的快捷键| 来源: 网络整理| 查看: 265

一、多行注释快捷键

  1.选中你要加注释的区域,用 Ctrl+Shift+C 或者 Ctrl+/ 会加上 // 注释,再重复按一下就会去掉 // 注释。(.js文件中只有 Ctrl+Shift+C 管用,.java文件中都管用)

  2.选中你要加注释的区域,用 Ctrl+shit+/  会加上 /*...*/ 注释,再用 Ctrl+shit+\  会去掉 /*...*/ 注释。(注意:正斜杠是加注释,反斜杠是去掉注释)

  3.要修改在eclispe中的命令的快捷键方式我们只需进入 Windows -> Preferences -> General -> keys 设置就行。

二、Eclipse中添加文档注释快捷键

  1.例如默认的文档注释:

    /**       * @author xxx    *     *     */

  2.快捷键为:Alt+Shift+J

  3.修改文档注释的注释格式内容,修改的方法有两种:

    A.直接在eclipse给的模板下进行修改

    打开Eclipse

    Window --> Preferences --> Java --> Code Style  --> Code Templates --> Comments --> types --> Edit...

    例如:

    /**       * 项目名称:${project_name}       * 类名称:${type_name}       * 类描述:       * 创建人:${user}       * 创建时间:${date} ${time}       * @version            */

    B.自己编写一个xml文档导入进去

    打开Eclipse

    Window --> Preferences --> Java --> Code Style --> Code Templates --> Comments --> types --> Import...

       选择你写好的模板.xml文件

Eclipse中默认的模板.xml文件如下:

/** * ${tags} *//** * @author ${user} * * ${tags} */ /** * *//** * @param ${param} the ${bare_field_name} to set *//** * *//** * @return the ${bare_field_name} *//** * ${tags} *//** * ${tags} * ${see_to_target} *//* (non-Javadoc) * ${see_to_overridden} */

自己写好的模板.xml文件如下:

/** * Description: * @author hp DateTime ${date} ${time} * ${tags} */ /** * Description: * @author hp DateTime ${date} ${time} * ${tags} */ /** * Description: * @author hp DateTime ${date} * */ /** * Class Name: ${file_name} * Description: * @author hp DateTime ${date} ${time} * @company bvit * @email [email protected] * @version 1.0 * ${tags} */ /** * @return get ${bare_field_name} */ /** * Description: * @author hp DateTime ${date} ${time} * ${tags} */ /** * Description: * @author hp DateTime ${date} * ${tags} * ${see_to_target} */ /** * @param ${param} set ${bare_field_name} */

参考博客链接:https://my.oschina.net/u/590763/blog/70166



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3