Changeset 15769 in josm for trunk/src


Ignore:
Timestamp:
2020-01-26T15:43:41+01:00 (5 years ago)
Author:
simon04
Message:

see #17688 - TagInfoViewer: allow to select/copy multiple values

Location:
trunk/src/org/openstreetmap/josm/gui/history
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/history/SelectionSynchronizer.java

    r12615 r15769  
    5252        DefaultListSelectionModel referenceModel = (DefaultListSelectionModel) e.getSource();
    5353        int i = referenceModel.getMinSelectionIndex();
     54        int j = referenceModel.getMaxSelectionIndex();
    5455        for (ListSelectionModel model : participants) {
    5556            if (model == e.getSource()) {
    5657                continue;
    5758            }
    58             model.setSelectionInterval(i, i);
     59            model.setSelectionInterval(i, j);
    5960        }
    6061        preventRecursion = false;
  • trunk/src/org/openstreetmap/josm/gui/history/TagInfoViewer.java

    r15768 r15769  
    7171        TagTableModel tagTableModel = model.getTagTableModel(pointInTime);
    7272        JTable table = new JTable(tagTableModel, new TagTableColumnModel());
    73         table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
     73        table.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
    7474        selectionSynchronizer.participateInSynchronizedSelection(table.getSelectionModel());
    7575        table.setTransferHandler(new TagInfoTransferHandler());
     
    8888
    8989        tagMenu.add(trackJosmAction(new CopyValueAction(table, tagKeyFn, objectSp)));
    90         tagMenu.add(trackJosmAction(new CopyKeyValueAction(table, tagKeyFn, objectSp)));
     90        final CopyKeyValueAction copyKeyValueAction = new CopyKeyValueAction(table, tagKeyFn, objectSp);
     91        tagMenu.add(trackJosmAction(copyKeyValueAction));
     92        tagMenu.addPopupMenuListener(copyKeyValueAction);
    9193        tagMenu.add(trackJosmAction(new CopyAllKeyValueAction(table, tagKeyFn, objectSp)));
    9294        tagMenu.addSeparator();
Note: See TracChangeset for help on using the changeset viewer.