code: public static void setPreference( String preferenceKey, String value ) {
          if (preferencesDb != null) {
              preferencesDb.setPreference(preferenceKey, value);
              return;
          }
  
          Preferences preferences = Preferences.userRoot().node(GuiBridgeHandler.PREFS_NODE_NAME);
          if (value != null) {
              preferences.put(preferenceKey, value);
          } else {
              preferences.remove(preferenceKey);
          }
      }
docs: Set a preference.
  
  @param preferenceKey
  the preference key.
  @param value
  the value to set.