Netbeans Platform Branding and version info

August 6th, 2007 | by Tonny Kohar |

By default Netbeans Platform based application automatically insert the version information by using the platform build number (the first or last 4 digits, correct me if I am wrong). And currently there is no easy ways to set or update this version info, unless you want to dig through the branding folder and change the value manually.

Fortunately, the flexibility of Netbeans IDE (ant based build system) allow us to automate this stuff. Below is how I automate it

  • in the project properties add the the following properties eg:
    app.version=5.0
  • in your build xml add the following
    <!-- override build to add update branding -->
    <target name="build" depends="build-brand,suite.build"/>
     
    <target name="build-brand" depends="-init">
        <propertyfile
            file="${basedir}/branding/core/core.jar/org/netbeans/core/startup/Bundle.properties" 
            comment="Updated by build script">
            <entry key="currentVersion" value="${app.title} ${app.version} " />
        </propertyfile>
     
        <propertyfile
            file="${basedir}/branding/modules/org-netbeans-core-windows.jar/org/netbeans/core/windows/view/ui/Bundle.properties"
            comment="Updated by build script">
            <entry key="CTL_MainWindow_Title" value="${app.title} ${app.version}" />
            <entry key="CTL_MainWindow_Title_No_Project" value="${app.title} ${app.version}" />
        </propertyfile>
     
        <propertyfile
            file="${basedir}/branding/modules/org-netbeans-core.jar/org/netbeans/core/ui/Bundle.properties" 
            comment="Updated by build script">
            <entry key="LBL_ProductInformation" value="${app.title}" />
        </propertyfile>
     
    </target>

Finish, so everytime you do build, it automatically update the version info using whatever value your put in your projects properties.

Note: Tested on Netbeans 5.5.1 and 6.0M10

  1. 3 Responses to “Netbeans Platform Branding and version info”

  2. By emilio on Aug 21, 2007 | Reply

    Good! I’ve a question. How branding standard menu item? (I’d like see “Salva” and not “Save”)
    thank!

  3. By Tonny Kohar on Aug 21, 2007 | Reply

    To make “Salva” instead of “Save”, you need to localize/internatiolize the Netbeans Platform. Please see this other blog entry, I write about localize Netbeans Platform default menu at http://blogs.kiyut.com/tonny/index.php/2007/08/04/netbeans-platform-i18n-and-localization/

    Basically just
    1) edit layer.xml file (menu section), to add pointer to your bundle properties
    2) edit/create the bundle_xx.properties to add your localized menu text

  4. By krishna on Dec 27, 2007 | Reply

    Can you Please Provide more information with detailed steps on how to achieve the same?

    Thanks in advance

You must be logged in to post a comment.