@Override
  public void preferenceChange(PreferenceChangeEvent evt) {
    // This is probably never null, but why not check
    if (null == evt || null == evt.getKey()) return;

    String k = evt.getKey();

    Function<PreferenceChangeEvent, ?> consumer = prefChangeConsumers.get(k);

    if (null == consumer) {
      log.debug("Ignoring preference key {} (no consumer registered)", k);
      return;
    }

    log.debug("Invoking consumer {} for key {}", consumer, k);

    consumer.apply(evt); // TODO uncaught exception handling?
  }
 @Override
 public void preferenceChange(PreferenceChangeEvent evt) {
   if (evt.getKey()
       .equals(
           internalProperties.get(
               InternalProperties.InternalPropertyKey.HIDE_PROPERTY_WARNING_PREFERENCE))) {
     view.getReenableWarningsButton().setVisible(Boolean.parseBoolean(evt.getNewValue()));
     view.getHideFutureWarningPopupCheckbox().setSelected(Boolean.parseBoolean(evt.getNewValue()));
   }
 }
Пример #3
0
 public void preferenceChange(PreferenceChangeEvent evt) {
   String settingName = evt == null ? null : evt.getKey();
   if (settingName == null || SimpleValueNames.TOOLBAR_VISIBLE_PROP.equals(settingName)) {
     refreshToolbarButtons();
   }
 }
 public void preferenceChange(PreferenceChangeEvent evt) {
   if (evt.getKey().equals("filter_parameters")) {
     recalculateKeys();
   }
 }