Ticket #21499: 21499-minimal.patch

File 21499-minimal.patch, 2.3 KB (added by GerdP, 4 years ago)

minimal patch to get rid of deprecation warnings

  • build.xml

     
    44    <!-- enter the SVN commit message -->
    55    <property name="commit.message" value="[josm_utilsplugin2]: select boundary by double-click; multitagger table highlights"/>
    66    <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
    7     <property name="plugin.main.version" value="17199"/>
     7    <property name="plugin.main.version" value="18173"/>
    88
    99    <property name="plugin.author" value="Kalle Lampila, Upliner, Zverik, akks, joshdoe and others"/>
    1010    <property name="plugin.class" value="org.openstreetmap.josm.plugins.utilsplugin2.UtilsPlugin2"/>
  • src/org/openstreetmap/josm/plugins/utilsplugin2/multitagger/MultiTagDialog.java

     
    145145        List<String> cmtHistory = new LinkedList<>(
    146146                Config.getPref().getList(HISTORY_KEY, Arrays.asList(defaultHistory)));
    147147        Collections.reverse(cmtHistory);
    148         cbTagSet.setPossibleItems(cmtHistory);
     148        cbTagSet.getModel().addAllElements(cmtHistory);
    149149        String s = cmtHistory.get(cmtHistory.size()-1);
    150150        cbTagSet.setText(s);
    151151        specifyTagSet(s);
     
    282282        public void actionPerformed(ActionEvent e) {
    283283            String txt = cbTagSet.getText();
    284284            Logging.debug(txt);
    285             List<String> history = cbTagSet.getHistory();
     285            List<String> history = cbTagSet.getModel().asStringList();
    286286            history.remove(txt);
    287287            if (history.isEmpty()) {
    288288                history = Arrays.asList(defaultHistory);
     
    320320            if (s == null || s.isEmpty() || s.equals(oldTags)) return;
    321321            oldTags = s;
    322322            cbTagSet.addCurrentItemToHistory();
    323             Config.getPref().putList(HISTORY_KEY, cbTagSet.getHistory());
     323            Config.getPref().putList(HISTORY_KEY, cbTagSet.getModel().asStringList());
    324324            specifyTagSet(s);
    325325        }
    326326    }