Changeset 15958 in josm for trunk/src/org
- Timestamp:
- 2020-02-29T00:28:12+01:00 (5 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/MainMenu.java
r15655 r15958 129 129 import org.openstreetmap.josm.gui.mappaint.MapPaintMenu; 130 130 import org.openstreetmap.josm.gui.preferences.imagery.ImageryPreference; 131 import org.openstreetmap.josm.gui.preferences.map.TaggingPresetPreference;132 131 import org.openstreetmap.josm.gui.tagging.presets.TaggingPresetSearchPrimitiveDialog; 133 132 import org.openstreetmap.josm.spi.preferences.Config; … … 839 838 ExpertToggleAction.getInstance().addButtonModel(expertItem.getModel()); 840 839 841 add(presetsMenu, presetSearchAction);842 add(presetsMenu, presetSearchPrimitiveAction);843 add(presetsMenu, PreferencesAction.forPreferenceSubTab(tr("Preset preferences"),844 tr("Click to open the tagging presets tab in the preferences"), TaggingPresetPreference.class));845 presetsMenu.addSeparator();846 847 840 add(imageryMenu, reorderImageryLayersAction); 848 841 add(imageryMenu, PreferencesAction.forPreferenceTab(tr("Imagery preferences..."), -
trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresets.java
r15582 r15958 1 1 // License: GPL. For details, see LICENSE file. 2 2 package org.openstreetmap.josm.gui.tagging.presets; 3 4 import static org.openstreetmap.josm.tools.I18n.tr; 3 5 4 6 import java.util.ArrayList; … … 14 16 import javax.swing.JSeparator; 15 17 18 import org.openstreetmap.josm.actions.PreferencesAction; 16 19 import org.openstreetmap.josm.data.osm.IPrimitive; 17 20 import org.openstreetmap.josm.gui.MainApplication; 21 import org.openstreetmap.josm.gui.MainMenu; 18 22 import org.openstreetmap.josm.gui.MenuScroller; 19 23 import org.openstreetmap.josm.gui.preferences.ToolbarPreferences; 24 import org.openstreetmap.josm.gui.preferences.map.TaggingPresetPreference; 20 25 import org.openstreetmap.josm.gui.tagging.presets.items.CheckGroup; 21 26 import org.openstreetmap.josm.gui.tagging.presets.items.KeyedItem; … … 61 66 */ 62 67 public static void initialize() { 68 MainMenu mainMenu = MainApplication.getMenu(); 69 JMenu presetsMenu = mainMenu.presetsMenu; 70 if (presetsMenu.getComponentCount() == 0) { 71 MainMenu.add(presetsMenu, mainMenu.presetSearchAction); 72 MainMenu.add(presetsMenu, mainMenu.presetSearchPrimitiveAction); 73 MainMenu.add(presetsMenu, PreferencesAction.forPreferenceSubTab(tr("Preset preferences"), 74 tr("Click to open the tagging presets tab in the preferences"), TaggingPresetPreference.class)); 75 presetsMenu.addSeparator(); 76 } 77 63 78 readFromPreferences(); 64 79 for (TaggingPreset tp: taggingPresets) { … … 68 83 } 69 84 if (taggingPresets.isEmpty()) { 70 MainApplication.getMenu().presetsMenu.setVisible(false);85 presetsMenu.setVisible(false); 71 86 } else { 72 87 Map<TaggingPresetMenu, JMenu> submenus = new HashMap<>(); 73 88 for (final TaggingPreset p : taggingPresets) { 74 JMenu m = p.group != null ? submenus.get(p.group) : MainApplication.getMenu().presetsMenu;89 JMenu m = p.group != null ? submenus.get(p.group) : presetsMenu; 75 90 if (m == null && p.group != null) { 76 91 Logging.error("No tagging preset submenu for " + p.group); … … 98 113 } 99 114 if (Config.getPref().getBoolean("taggingpreset.sortmenu")) { 100 TaggingPresetMenu.sortMenu( MainApplication.getMenu().presetsMenu);115 TaggingPresetMenu.sortMenu(presetsMenu); 101 116 } 102 117 listeners.forEach(TaggingPresetListener::taggingPresetsModified);
Note:
See TracChangeset
for help on using the changeset viewer.