Using Branded Layers

As mentioned on the NetBeans website at http://www.netbeans.org/i18n/, it is possible to customize a NetBeans builds to a "branded" appearance or behavior, in many cases without touching the original source or binaries, but simply by adding a set of branded customization JARs to its installation.

When branding layers, the IDE automatically gathers both the base version of the layer (e.g. supplied by the NetBeans project) and any applicable branded variants, and merges them together file-by-file, with more specific variants being able to override generic contents. Branded layers can change the contents of existing files, add new files, or remove ("mask") existing files.

The API Support provides special support for helping you edit the branded layer. If you have mounted in Filesystems both a base layer and a branded (or localized) variant with matching packages, the variant will show two subnodes instead of one. For example, you may have mounted NetBeans sources (section core/src/) containing the file org/netbeans/core/resources/mf-layer.xml which is the core layer providing much of the basic IDE menus, and so on. In a different filesystem, make a corresponding package org/netbeans/core/resources/ and make a layer called e.g. mf-layer_brand.xml to represent the branding brand.

Expand the new layer in the Explorer. As usual you will see <root folder> representing this layer's contents. You will also see mf-layer + mf-layer_brand which represents the merged contents of the base and branded layers. You may edit either of these, or the base layer, and watch the effects. Edit the merged contents to correspond to what you would like to see in the brand branding; mf-layer_brand.xml will be generated for you as a kind of diff from the base layer.

If it is inconvenient to mount all of the base layers, or you have already created the branded layer, or just want more control over the process: you may see a merged view under any layer by right-clicking the layer node and choosing Add Branding View... from the context menu. You will be asked to select one or more base layers. The resulting view will show the result of composing those base layers (in the order you selected them) and finally this branded layer. Edits to the merged view will produce the appropriate diffs in this branded layer.