Question

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.

Was it helpful?

Solution

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!

OTHER TIPS

In fact, there's no references to layer.xml in the latest refcard at all, nor to those tutorials that have been updated.

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top