Changeset 18276 in josm for trunk/src/org
- Timestamp:
- 2021-10-17T06:08:14+02:00 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java
r17775 r18276 100 100 import org.openstreetmap.josm.gui.tagging.presets.TaggingPreset; 101 101 import org.openstreetmap.josm.gui.tagging.presets.TaggingPresetHandler; 102 import org.openstreetmap.josm.gui.tagging.presets.TaggingPresetListener; 102 103 import org.openstreetmap.josm.gui.tagging.presets.TaggingPresetType; 104 import org.openstreetmap.josm.gui.tagging.presets.TaggingPresets; 103 105 import org.openstreetmap.josm.gui.util.AbstractTag2LinkPopupListener; 104 106 import org.openstreetmap.josm.gui.util.HighlightHelper; … … 111 113 import org.openstreetmap.josm.spi.preferences.Config; 112 114 import org.openstreetmap.josm.spi.preferences.PreferenceChangedListener; 115 import org.openstreetmap.josm.spi.preferences.PreferenceChangeEvent; 113 116 import org.openstreetmap.josm.tools.AlphanumComparator; 114 117 import org.openstreetmap.josm.tools.GBC; … … 139 142 */ 140 143 public class PropertiesDialog extends ToggleDialog 141 implements DataSelectionListener, ActiveLayerChangeListener, DataSetListenerAdapter.Listener {144 implements DataSelectionListener, ActiveLayerChangeListener, DataSetListenerAdapter.Listener, PreferenceChangedListener, TaggingPresetListener { 142 145 143 146 /** … … 239 242 + tr("Select objects for which to change tags.") + "</p></html>"); 240 243 241 private final PreferenceChangedListener preferenceListener = e -> {242 if (MainApplication.getLayerManager().getActiveData() != null) {243 // Re-load data when display preference change244 updateSelection();245 }246 };247 248 244 private final transient TaggingPresetHandler presetHandler = new TaggingPresetCommandHandler(); 249 245 … … 308 304 editHelper.loadTagsIfNeeded(); 309 305 310 Config.getPref().addKeyPreferenceChangeListener("display.discardable-keys", preferenceListener); 306 Config.getPref().addKeyPreferenceChangeListener("display.discardable-keys", this); 307 TaggingPresets.addListener(this); 311 308 } 312 309 … … 621 618 membershipTable.removeMouseListener(popupMenuLauncher); 622 619 super.destroy(); 623 Config.getPref().removeKeyPreferenceChangeListener("display.discardable-keys", preferenceListener); 620 Config.getPref().removeKeyPreferenceChangeListener("display.discardable-keys", this); 621 TaggingPresets.removeListener(this); 624 622 Container parent = pluginHook.getParent(); 625 623 if (parent != null) { … … 767 765 768 766 /* ---------------------------------------------------------------------------------- */ 767 /* PreferenceChangedListener */ 768 /* ---------------------------------------------------------------------------------- */ 769 770 /** 771 * Re-load data when display preference change 772 */ 773 @Override 774 public void preferenceChanged(PreferenceChangeEvent e) { 775 if (MainApplication.getLayerManager().getActiveData() != null) { 776 updateSelection(); 777 } 778 } 779 780 781 /* ---------------------------------------------------------------------------------- */ 782 /* TaggingPresetListener */ 783 /* ---------------------------------------------------------------------------------- */ 784 785 /** 786 * Updates the preset list when Presets preference changes. 787 */ 788 @Override 789 public void taggingPresetsModified() { 790 if (MainApplication.getLayerManager().getActiveData() != null) { 791 updateSelection(); 792 } 793 } 794 795 /* ---------------------------------------------------------------------------------- */ 769 796 /* ActiveLayerChangeListener */ 770 797 /* ---------------------------------------------------------------------------------- */
Note:
See TracChangeset
for help on using the changeset viewer.