我正处于学习 NetBeans 平台的早期阶段。我注意到 NetBeans 7.0 广泛使用注释来注册类、指定窗口模式等。这是一个很好的功能,但我到目前为止找到的学习材料 (富客户端编程,权威指南、netbeans.org 上的教程以及最新的 refcard) 都对检查和编辑layer.xml 文件进行了广泛的参考。由于我仍处于学习曲线的低山麓,我发现很难同时使用带注释的代码和图层文件示例。
我正在考虑在学习时回退到 NetBeans 6.x 版本,以便与书籍和教程保持同步,至少在我掌握核心 API 和基本实践之前是这样。我很乐意听取经验丰富的 NetBeans 平台用户和开发人员的意见,了解从一开始就坚持使用 NetBeans 7 是否明智,或者从长远来看是否更好。
I am in the early stages of learning the NetBeans platform. I note that NetBeans 7.0 makes extensive use of annotations to register classes, specify window modes etc. This is a nice feature, but the learning materials that I've found so far (Rich Client Programming, The Definitive Guide, the tutorials at netbeans.org, and the latest refcard) all make extensive reference to inspecting and editing the layer.xml file. Since I'm still in the lower foothills of the learning curve I'm finding it hard to juggle annotated code with layer file examples.
I'm considering dropping back to a 6.x version of NetBeans while learning, to be in sync with the books and tutorials, at least until I get the core API and basic practices under my belt. I'd appreciate hearing from experienced NetBeans platform users and developers on whether that's sensible, or if it might be better, in the long term, to stick with NetBeans 7 from the beginning.
发布评论
评论(3)
使用注释在幕后实际发生的事情是为您创建一个layer.xml 条目。
因此,您不需要使用注释,如果您正在使用的教程完全处理图层条目,则只需使用图层条目。
我们的想法是,理解和查找注释比分层条目要容易得多。
这似乎是未来许多层条目(通过注释动态创建)将会发生的情况。
然而,当他们正在转变时,这肯定会引起混乱!
What actually happens behind the scenes with the annotations is that a layer.xml entry is created for you.
So you don't need to use the annotations, if the tutorial you are working with deals entirely with layer entries then just use layer entries.
The thinking is that it's a lot easier to understand and find annotations then layer entries.
This seems to be whats going to happen with a lot of the layer entries(dynamically created via annotations) going forward.
However while they are transitioning it definitely causes confusion!
事实上,最新的参考卡中根本没有对layer.xml 的引用,也没有对那些已更新的教程的引用。
In fact, there's no references to layer.xml in the latest refcard at all, nor to those tutorials that have been updated.
我最近开始使用 NetBeansPlataform 7.0,我认为 layer.xml 只需要自定义现有操作,因此,例如要隐藏现有条目或其他内容,您可以手动定义 layer.xml。
1)在模块中创建layer.xml。
2) 在清单文件 OpenIDE-Module-Layer 中注册:com/foo/mymodule/layer.xml。
如果您使用 Netbeans,则必须关闭并重新打开项目才能进行此更改。
胡安
I start too recently with NetBeansPlataform 7.0 and I think layer.xml only need to customize existing actions, so, for example to hide an existing entry or other thing, you can define by hand the layer.xml.
1) Create layer.xml in your module.
2) Register in manifest file OpenIDE-Module-Layer: com/foo/mymodule/layer.xml.
If you use Netbeans, you must close and reopen the project to take this changes.
Juan