升 C 音的“#region” & “#endregion”在Java中?
Possible Duplicate:
Java equivalent to #region in c#
Is there something in Java that would allow for structuring the source code as it is done in C# with the pre-processor directives
#region
and
#endregion
?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
不,没有什么可以等同的。
代码折叠是 IDE 功能,而不是语言功能。
当 Java 文件加载到 Eclipse 中时,Eclipse 会对类和成员进行代码折叠。它可以扩展(例如)以在精心设计的注释行上添加代码折叠。
No, there is nothing equivalent.
Code folding is an IDE feature, not a language feature.
Eclipse has code folding for classes and members when Java files are loaded in it. It may be extended (for example) to add code folding on carefully crafted comment lines.
不,没有内置的解决方案。
然而,有一些 Java IDE 支持某些注释模式的折叠。当然,所有 IDE 都支持按类、方法等折叠代码。
No, there's no built-in solution to that.
However there are some Java IDE's which support folding for certain comment-patterns. And of course all IDE's support folding the code by classes, methods etc.
区域是一种语言功能,而不是 IDE 功能。具体来说,它是 C# 编程语言的一部分,Visual Studio 知道如何解释它。
region is a language feature and NOT an IDE feature. Specifically, it is part of the C# programming language and Visual Studio knows how to interpret it.
不是这样的。请记住,这些预处理器指令更多的是为了 VS 的利益,而不是 C# 或 VB 语言规范的一部分。 Java 中的预处理器指令将由 IDE 负责。
Not as such. Bear in mind that these preprocessor directives are more for VS's benefit than they are a part of the C# or VB language spec. Preprocessor directives in Java would be the IDE's business.