I have to program a fat client using NetBeans Platform and JavaFX 11. One of the requirements is to offer a default and dark theme mode for the whole application and to remove the option dialog category Keymaps and the sub category Look and Feel inside the Appearance category. I searched the web for the appropriate API, but found only an API to add new (sub) categories to the options dialog.
Like often in the Netbeans platform, customization is done by editing a layer.xml
file, where you can add stuff but also override the global configuration.
If you don't already have one, create a XML Layer file in one of your modules: right-click menu New > Module Development > XML Layer.
The file will appear in the Important Files folder of the module.
Expand the Layer.xml
node and you see <this layer> and <this layer in context>. The first one shows only the changes present in your file. The second one shows the same thing, but in the global context: the changes present in your file appear in bold, and the rest is the global configuration.
Expand OptionsDialog, and if you don't want the General panel, then select General and delete. This will replace the item with a "hidden" instance.
In the tutorial you mention, they use annotation in the code to add an entry in the layer.xml
file.
You'll see other nodes like Menu Bar, where it's the same principle: you can remove unwanted menu entries, or add new ones (directly in the layer.xml, but much preferably using annotations like ActionReference
).