如何在Netbeans中更改toString()代码段的功能 [英] How to change functionality of toString() code snippet in Netbeans

查看:187
本文介绍了如何在Netbeans中更改toString()代码段的功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Netbeans IDE中,是否有可能从上下文菜单中更改"tototoString()..."(Alt + Shift + S)代码段功能的行为?

Is there in Netbeans IDE possibility how to change its behaviour in "into toString()..." (Alt+Shift+S) code snippet function from context menu?

我想在最终生成的toString()方法中包括从类及其超类中选择的方法(主要是吸气剂).

I would like to include into final generated toString() method selected methods (mostly getters) from class and its superclass.

推荐答案

我不知道是否可以覆盖" 生成(Alt +插入)的默认toString()行为.菜单,但您可以为自定义toString()方法创建自己的代码生成器.

I don't know if it's possible to "override" the default toString() behaviour of the Generate (Alt + Insert) menu, but you can create your own code generator for your custom toString() method.

您需要创建一个"Netbeans模块项目".在这里,您有完整的指南:

You need to create a "Netbeans Module Project". Here you have a complete guide:

代码生成器集成- http://platform .netbeans.org/tutorials/nbm-code-generator.html

这篇关于如何在Netbeans中更改toString()代码段的功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆