Changeset 18683 in josm for trunk/src/org
- Timestamp:
- 2023-03-06T23:28:55+01:00 (19 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetMenu.java
r15231 r18683 11 11 import java.io.Serializable; 12 12 import java.util.ArrayList; 13 import java.util.Arrays; 13 14 import java.util.Comparator; 14 15 import java.util.List; … … 21 22 import javax.swing.JSeparator; 22 23 24 import org.openstreetmap.josm.actions.JosmAction; 23 25 import org.openstreetmap.josm.gui.MainApplication; 24 26 import org.openstreetmap.josm.gui.MainFrame; 27 import org.openstreetmap.josm.gui.MainMenu; 25 28 import org.openstreetmap.josm.tools.AlphanumComparator; 26 29 import org.openstreetmap.josm.tools.Logging; … … 38 41 @Override 39 42 public int compare(JMenuItem o1, JMenuItem o2) { 40 if (MainApplication.getMenu().presetSearchAction.equals(o1.getAction())) 41 return -1; 42 else if (MainApplication.getMenu().presetSearchAction.equals(o2.getAction())) 43 return 1; 44 else 45 return AlphanumComparator.getInstance().compare(o1.getText(), o2.getText()); 43 final MainMenu menu = MainApplication.getMenu(); 44 // This is needed to keep the order of the search actions -> preferences 45 for (JosmAction action : Arrays.asList(menu.presetSearchAction, menu.presetSearchPrimitiveAction)) { 46 if (action.equals(o1.getAction())) { 47 return -1; 48 } else if (action.equals(o2.getAction())) { 49 return 1; 50 } 51 } 52 return AlphanumComparator.getInstance().compare(o1.getText(), o2.getText()); 46 53 } 47 54 }
Note:
See TracChangeset
for help on using the changeset viewer.