Wednesday, October 28, 2009

Section 14.4.  Branding Features










14.4. Branding Features


Since an Eclipse-based system is a composition of features and plug-ins from different sources, the standard About dialog exposes branding for individual features. This allows feature vendors to have a user-visible presence in the system. For example, after following the steps below, the Hyperbola feature branding seen via Help > About Hyperbola > Feature Details displays as shown in Figure 14-8.



Figure 14-8. Hyperbola feature branding







The branding images and text are supplied by a branding plug-in defined in the Overview > General Information > Branding Plug-in field of the feature editor. The branding plug-in can be any plug-in included in the feature. Use the Browse... button and select org.eclispercp.hyperbola as the branding plug-in.


The branding information is contained in a set of files, as shown below. The about.ini defines two properties: one for the informational About text and one for the feature image.


org.eclipsercp.hyperbola/about.ini
# Property "aboutText" contains blurb for feature details in the "About"
# dialog (translated). Maximum 15 lines and 75 characters per line.
aboutText=%blurb

# Property "featureImage" contains path to feature image (32x32)
featureImage=icons/32h.bmp


The aboutText property gives the text that is displayed when the feature is selected in the feature details dialog. The main reason for this information being in a plug-in is to enable translation. As such, the value %blurb is defined in an associated about.properties file, which is shown here:


org.eclipsercp.hyperbola/about.properties
blurb=Hyperbola Chat Client Product\n\
Version: {featureVersion}\n\
Build id: {0}\n\
(c) Copyright Jean-Michel Lemieux and Jeff McAffer. All rights reserved.\n\
Visit http://eclipsercp.org/hyperbola


Translations of this value are then supplied in language-specific files in fragments of the Hyperbola plug-in as discussed in Section 8.4, "Splash Screen." The About text for features can be specialized for particular builds as described in Section 8.5, "About Information." That is, the "{0}" in the about blurb can be replaced by values in an about.mappings file in the branding plug-in.


org.eclipsercp.hyperbola/about.mappings
0=1.0.0


Warning



Feature branding information is separate from the product branding that is defined in org.eclipsercp.hyperbola. That branding is specified in the product extension and is displayed on the main About dialog. Due to a naming overlap, however, the about.mappings files are shared between the two. Care should be taken when assigning and using properties from this file.




Add these files as described and update the Build page in the Hyperbola plug-in editor to have all the about.* files checked in the Binary Build list. Re-export Hyperbola, then run it and check that your feature branding worked.












No comments: