This guide lists the actions necessary in order to migrate the preferences system from BEAM to SNAP
Plug into NetBeans Preferences Dialog and extend it with a primary panel. See here for a tutorial. Anyway, the necessary actions are:
snap-gui
, create a controller class extending OptionsPanelController
OptionsPanelController.TopLevelRegistration
and org.openide.util.NbBundle.Messages
annotations.JComponent
. According to the tutorial, it makes sense to create the methods load()
, store()
, and valid()
, as described in the tutorial.load()
, store()
, valid()
-methods appropriatlyorg-netbeans-modules-options-api
in the group org.netbeans.api
snap-gui
-module in order to see the extensions in the GUI.somePreference
which the user edits in the component someTextField
, add a line similar to NbPreferences.forModule(YourPanel.class).put("somePreference", someTextField.getText())
to the store()
-methodsomeTextField.setText(NbPreferences.forModule(YourPanel.class).get("somePreference", "")
to the load()
-method in order to load the user preference somePreference
.Plug into NetBeans Preferences Dialog and extend it with a secondary panel. See here for a tutorial. Anyway, the necessary actions are:
snap-gui
, create a new package, and a file package-info.java
OptionsPanelController.ContainerRegistration
OptionsPanelController
OptionsPanelController.SubRegistration
location
use the id you set in step 2.If your code does not compile due to a Bundle.properties not found
error: remove the annotations, compile again, put the annotations in again.
Be sure to add the org.openide.util.NbBundle.Messages
annotation, especially when you are creating a secondary panel. This is not mentioned in the tutorial!
After adding a new panel, you'll need to do a mvn clean package
. Make is not sufficient, nor is an easy package; clean is mandatory.
Be sure that you don't have duplicate display names; see http://stackoverflow.com/q/27376939/2043113.