Changeset 16489 in josm


Ignore:
Timestamp:
2020-05-23T22:03:33+02:00 (2 weeks ago)
Author:
GerdP
Message:

fix #19275: Relation list: Direct option for history viewer
Enable Ctrl+H and add History to right click popup menu for member list.

File:
1 edited

Legend:

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

    r16438 r16489  
    1414import javax.swing.AbstractAction;
    1515import javax.swing.DropMode;
     16import javax.swing.JComponent;
    1617import javax.swing.JPopupMenu;
    1718import javax.swing.JTable;
     
    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;
     
    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;
     
    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);
     
    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    }
Note: See TracChangeset for help on using the changeset viewer.