Changeset 15108 in josm


Ignore:
Timestamp:
2019-05-25T09:52:11+02:00 (5 months ago)
Author:
GerdP
Message:

simplify code (see #15558):
also removes side-effect: The order of the list searchExpressionHistory is no longer reversed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/dialogs/SearchDialog.java

    r15090 r15108  
    1313import java.awt.event.MouseEvent;
    1414import java.util.Arrays;
    15 import java.util.Collections;
    1615import java.util.List;
    1716
     
    9493        hcbSearchString.setToolTipText(tooltip);
    9594
    96         // we have to reverse the history, because ComboBoxHistory will reverse it again in addElement()
    97         Collections.reverse(searchExpressionHistory);
    98         hcbSearchString.setPossibleItems(searchExpressionHistory);
     95        hcbSearchString.setPossibleItemsTopDown(searchExpressionHistory);
    9996        hcbSearchString.setPreferredSize(new Dimension(40, hcbSearchString.getPreferredSize().height));
    10097        label.setLabelFor(hcbSearchString);
     
    327324                .addKeyword("id:", "id:", tr("objects with given ID"),
    328325                        trc("search string example", "id:0 (new objects)"))
    329                 .addKeyword("version:", "version:", tr("objects with given version"), 
     326                .addKeyword("version:", "version:", tr("objects with given version"),
    330327                        trc("search string example", "version:0 (objects without an assigned version)"))
    331328                .addKeyword("changeset:", "changeset:", tr("objects with given changeset ID"),
Note: See TracChangeset for help on using the changeset viewer.