Time for action – branding features

Features generally don't show up in the About dialog of Eclipse, as there is only space for a handful of features to show there. Only top-level features which have branding information associated with them are shown in the dialog.

  1. Go to Help | About (or Eclipse | About Eclipse on macOS) and there will be a number of icons present, consisting of the top-level branded features that have been installed. These features have an associated branding plug-in, which contains a file called about.ini that supplies the information:
    Time for action – branding features
  2. First, set up an association between the feature and its branding plug-in, by re-using the com.packtpub.e4.clock.ui plug-in from before. Open the feature.xml file, go to the Overview tab, and add the name of the branding plug-in as com.packtpub.e4.clock.ui:
    Time for action – branding features
  3. Now, create a file in the com.packtpub.e4.clock.ui plug-in called about.ini with the following content:
    featureImage=icons/sample.gif
    aboutText=
    Clock UI plug-in
    
    
    
    Example of how to use plug-ins to modularise applications
    
  4. Build the update site, and install the plug-in into Eclipse. After restarting, go to the Help | About menu. Unfortunately, the about text won't be present. That's because despite the about.ini file being part of the plug-in, Eclipse doesn't bundle it into the plug-in's JAR. There is another change which is required in the build.properties file in the com.packtpub.e4.clock.ui plug-in to include the about.ini file explicitly:
    bin.includes = plugin.xml,
      META-INF/,
      .,
      icons/,
      about.ini,
      ...

    Export the update site, and the plug-in JAR now has the about.ini included.

  5. Reload the update site from the Window | Preferences | Install/Update | Available Update Sites window and do a reload on the exported repository.
  6. Run Help | Check for Updates to pick up the changes, and restart Eclipse.
  7. Go into the About screen to show the generic icon used by the feature:
    Time for action – branding features

What just happened?

A feature is associated with a branding plug-in, which contains a section of text and an icon. This feature branding consists of an about.ini file, which is included in the associated branding plug-in, and optionally a 32 x 32 icon.

The icon generated by the same wizard is 16 x 16, so it shows up as a quarter of the size of other icons in this list. A feature icon should be of 32 x 32 size, as otherwise an inconsistent size will be seen. Supplying a 32 x 32 feature icon is left as an exercise for the reader.

Have a go hero – publishing the content remotely

Since update sites can be served on websites, upload the update content to a remote web server and install it from there. Alternatively use a web server such as Apache or those built into the operating system to serve the content via a local web server.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.221.187.207