Changeset 18293 in josm
- Timestamp:
- 2021-10-27T17:07:48+02:00 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java
r18276 r18293 112 112 import org.openstreetmap.josm.gui.widgets.PopupMenuLauncher; 113 113 import org.openstreetmap.josm.spi.preferences.Config; 114 import org.openstreetmap.josm.spi.preferences.PreferenceChangedListener;115 114 import org.openstreetmap.josm.spi.preferences.PreferenceChangeEvent; 116 115 import org.openstreetmap.josm.tools.AlphanumComparator; … … 142 141 */ 143 142 public class PropertiesDialog extends ToggleDialog 144 implements DataSelectionListener, ActiveLayerChangeListener, DataSetListenerAdapter.Listener, PreferenceChangedListener, TaggingPresetListener { 143 implements DataSelectionListener, ActiveLayerChangeListener, DataSetListenerAdapter.Listener, TaggingPresetListener { 144 private final BooleanProperty PROP_DISPLAY_DISCARDABLE_KEYS = new BooleanProperty("display.discardable-keys", false); 145 145 146 146 /** … … 304 304 editHelper.loadTagsIfNeeded(); 305 305 306 Config.getPref().addKeyPreferenceChangeListener("display.discardable-keys", this);307 306 TaggingPresets.addListener(this); 308 307 } … … 618 617 membershipTable.removeMouseListener(popupMenuLauncher); 619 618 super.destroy(); 620 Config.getPref().removeKeyPreferenceChangeListener("display.discardable-keys", this);621 619 TaggingPresets.removeListener(this); 622 620 Container parent = pluginHook.getParent(); … … 651 649 tagData.setRowCount(0); 652 650 653 final boolean displayDiscardableKeys = Config.getPref().getBoolean("display.discardable-keys", false);651 final boolean displayDiscardableKeys = PROP_DISPLAY_DISCARDABLE_KEYS.get(); 654 652 final Map<String, Integer> keyCount = new HashMap<>(); 655 653 final Map<String, String> tags = new HashMap<>(); … … 769 767 770 768 /** 771 * Re -load data when display preference change769 * Reloads data when the {@code display.discardable-keys} preference changes 772 770 */ 773 771 @Override 774 772 public void preferenceChanged(PreferenceChangeEvent e) { 775 if (MainApplication.getLayerManager().getActiveData() != null) { 776 updateSelection(); 777 } 778 } 779 773 super.preferenceChanged(e); 774 if (PROP_DISPLAY_DISCARDABLE_KEYS.getKey().equals(e.getKey())) { 775 if (MainApplication.getLayerManager().getActiveData() != null) { 776 updateSelection(); 777 } 778 } 779 } 780 780 781 781 /* ---------------------------------------------------------------------------------- */
Note:
See TracChangeset
for help on using the changeset viewer.