From Project to Scenario
By Geertjan-Oracle on May 16, 2014
One of the powerful features of the NetBeans Platform is its project system. You can include NetBeans modules in your application that let the user choose File | New Project and then the user can begin creating a new project:
The dialog below then opens, where sample templates of your project type can be listed so that the user can get started with it easily:
However, what if we don't like the word "Project"? Instead, we want the word to be "Scenario", throughout all the UI of our application, in each menu item and dialog? Simply right-click the application and choose Branding:
In the Branding dialog, go to "Internationalization Resource Bundles" and then search for the word/s that you want to brand, e.g., "New Project":
Then a search is done through all the strings in the NetBeans Platform, which are all found in properties files. Each matching string can be right-clicked, as shown above, at which point you can type in a different word.
All changes you make are shown in bold:
After you click OK in the dialog above, open the Files window, expand the 'branding' folder of your application, and you will find that new properties files have been created, in a folder structure matching the folder structure where the original key/value pairs are found.
When you build the application, you'll find that a JAR is added for each NetBeans module that you have overridden with your branded words:
And now your words will override those from the NetBeans Platform. For example, you'll see "Scenario" everywhere, instead of "Project".
One small 'gotcha' is to be aware of the ampersands:
In other words, if you search for "New Project", you will not find your words if they have an ampersand (for quick access via accelerator keys that are created for them by the NetBeans Platform Action System).
And that's all, a very simple and effective mechanism for turning the Project system into a Scenario system.