- Timestamp:
- 2020-05-28T14:46:30+02:00 (4 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/HistoryInfoAction.java
r16505 r16512 7 7 import java.awt.event.ActionEvent; 8 8 import java.awt.event.KeyEvent; 9 import java.util. HashSet;9 import java.util.LinkedHashSet; 10 10 import java.util.Set; 11 import java.util.stream.Collectors; 11 12 13 import javax.swing.JList; 12 14 import javax.swing.JTable; 13 15 … … 44 46 public void actionPerformed(ActionEvent ae) { 45 47 // Generic handling of tables displaying OSM primitives 48 Set<PrimitiveId> sel = new LinkedHashSet<>(); 46 49 if (ae.getSource() instanceof JTable) { 47 50 JTable table = (JTable) ae.getSource(); 48 Set<PrimitiveId> sel = new HashSet<>();49 51 for (int row : table.getSelectedRows()) { 50 52 for (int col = 0; col < table.getModel().getColumnCount(); col++) { … … 56 58 } 57 59 } 58 if (!sel.isEmpty()) { 59 HistoryBrowserDialogManager.getInstance().showHistory(sel); 60 return; 61 } 60 } else if (ae.getSource() instanceof JList) { 61 JList<?> list = (JList<?>) ae.getSource(); 62 sel = list.getSelectedValuesList() 63 .stream().filter(v -> v instanceof PrimitiveId) 64 .map(v -> (PrimitiveId) v) 65 .collect(Collectors.toCollection(LinkedHashSet::new)); 66 } 67 if (!sel.isEmpty()) { 68 HistoryBrowserDialogManager.getInstance().showHistory(sel); 69 return; 62 70 } 63 71 // Otherwise show history for currently selected objects -
trunk/src/org/openstreetmap/josm/gui/dialogs/RelationListDialog.java
r16438 r16512 35 35 36 36 import org.openstreetmap.josm.actions.ExpertToggleAction; 37 import org.openstreetmap.josm.actions.HistoryInfoAction; 37 38 import org.openstreetmap.josm.actions.relation.AddSelectionToRelations; 38 39 import org.openstreetmap.josm.actions.relation.DeleteRelationsAction; … … 199 200 displaylist.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_C, PlatformManager.getPlatform().getMenuShortcutKeyMaskEx()), "copy"); 200 201 202 HistoryInfoAction historyAction = MainApplication.getMenu().historyinfo; 203 displaylist.getActionMap().put("historyAction", historyAction); 204 displaylist.getInputMap().put(historyAction.getShortcut().getKeyStroke(), "historyAction"); 205 201 206 updateActionsRelationLists(); 202 207 }
Note:
See TracChangeset
for help on using the changeset viewer.