Ticket #19275: 19275.patch

File 19275.patch, 2.4 KB (added by GerdP, 6 years ago)

Enable Ctrl+H and add History to right click popup menu for member list. The tabs "Parent relations" and "Child Relations" would require more work..

  • src/org/openstreetmap/josm/gui/dialogs/relation/MemberTable.java

     
    1313
    1414import javax.swing.AbstractAction;
    1515import javax.swing.DropMode;
     16import javax.swing.JComponent;
    1617import javax.swing.JPopupMenu;
    1718import javax.swing.JTable;
    1819import javax.swing.ListSelectionModel;
     
    2223
    2324import org.openstreetmap.josm.actions.AutoScaleAction;
    2425import org.openstreetmap.josm.actions.AutoScaleAction.AutoScaleMode;
     26import org.openstreetmap.josm.actions.HistoryInfoAction;
    2527import org.openstreetmap.josm.actions.ZoomToAction;
    2628import org.openstreetmap.josm.data.osm.OsmPrimitive;
    2729import org.openstreetmap.josm.data.osm.Relation;
     
    3032import org.openstreetmap.josm.gui.MainApplication;
    3133import org.openstreetmap.josm.gui.dialogs.relation.sort.WayConnectionType;
    3234import org.openstreetmap.josm.gui.dialogs.relation.sort.WayConnectionType.Direction;
     35import org.openstreetmap.josm.gui.history.HistoryBrowserDialogManager;
    3336import org.openstreetmap.josm.gui.layer.LayerManager.LayerAddEvent;
    3437import org.openstreetmap.josm.gui.layer.LayerManager.LayerChangeListener;
    3538import org.openstreetmap.josm.gui.layer.LayerManager.LayerOrderChangeEvent;
     
    6972        setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);
    7073        setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
    7174        putClientProperty("terminateEditOnFocusLost", Boolean.TRUE);
     75        HistoryInfoAction historyAction = MainApplication.getMenu().historyinfo;
     76        getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(historyAction.getShortcut().getKeyStroke(), "historyAction");
     77        getActionMap().put("historyAction", historyAction);
    7278
    7379        installCustomNavigation(0);
    7480        initHighlighting();
     
    99105        menu.addSeparator();
    100106        menu.add(new SelectPreviousGapAction());
    101107        menu.add(new SelectNextGapAction());
     108        menu.add(new HistoryInfoAction() {
     109            @Override
     110            public void actionPerformed(ActionEvent ae) {
     111                Collection<OsmPrimitive> sel = getMemberTableModel().getSelectedChildPrimitives();
     112                HistoryBrowserDialogManager.getInstance().showHistory(sel);
     113            }
     114        });
    102115        return menu;
    103116    }
    104117