找不到直接生成javadoc注释的快捷方式。 但是,如果在方法声明之前键入/**并按Enter键,则会自动生成javadoc注释块。
阅读更多的信息。
要发表评论,请在方法声明之前使用/**,然后按[上一步]键。 javadoc将自动包含在内。
示例:
/* * @ param a* @ paramb */public void add (inta,int b ) { //code here } ) ) ) ) ) ) ) 0
这是来自Oracle的JavaDoc注释的示例:
/* * returnsanimageobjectthatcanthenbepaintedonthescreen.* theurlargumentmustspecifyanabsolute { @ linkurl }.the name * are
* thismethodalwaysreturnsimmediately,whetherornotthe * image exists.whenthisappletattemptstodrawtheimageon * the screeeen, thedatawillbeloaded.thegraphicsprimitives * thatdrawtheimagewillincrementallypaintonthescreen.* @ paramurlanabsoluteurlgrlgen @ paramnamethelocationoftheimage,relativetotheurlargument * @ returntheimageatthespecifiedurl * @ see image */publicimagegege }
可以通过以下方法之一自动生成基本格式:
将光标悬停在方法上,然后输入/** Enter
将光标悬停在方法名称上,然后按Alt Enter键并单击JavaDoc进行添加
在“修改文档注释”中,可以使用从JavaDoc注释生成的eclipse样式。 首选项-打开键盘映射并将“修改文档注释”操作分配给所需的键。
可以从settings-plugin-browse repositories安装JavaDoc插件。
从以下链接获取插件文档
JavaDoc插件文件
在这里可以做这样的事。 可以在类/包/项目级别创建“缺省”注释,而不是快捷方式。 根据需要进行修改
* * * * installjavadocplugin * * *1. pressshifttwiceandgotoplugins.2.searchforjavadocsplugin3. install it.4.restartandandandottttttand packageandgotojavadocscreatejavadocsforallelementsitwillgeneratealldefaultcomments。
其优点是,all the methods at a time .可以为all the methods at a time .创建build注释块all the methods at a time。
Android Studio不需要插件。 在Mac上,只需打开Androidstudio即可。 在顶部栏中单击Androidstudio。 单击Prefrences -。 在列表中单击findfileandcodetemplatesselect includesbuild it以坚持所有项目
只需单击select=方法名称,然后按Alt Enter,select键“添加JavaDoc”
这假设没有向方法添加注释。 否则,将不会显示“添加JavaDoc”选项。
添加java文档注释的另一种方法是按Ctrl Shift A键以显示" popup "窗口input:Add javadocs Enter。
Ctrl Shirt A :搜索命令(自动完成命令名称) ) ) ) ) ) ) ) ) )。
我不知道您是否完全理解这个问题,但是您可以在这里查找键盘快捷键列表。 我希望这能有帮助。
在键盘映射设置中,只需要select键盘的Eclipse版本就可以了。 Android Studio包含Eclipse键映射。
ALT SHIFT G会在方法中创建build自动生成的注释。 将光标置于方法的开头。