Ticket #19275: 19275.2.patch
File 19275.2.patch, 2.4 KB (added by , 4 years ago) |
---|
-
src/org/openstreetmap/josm/gui/dialogs/RelationListDialog.java
33 33 import javax.swing.event.PopupMenuEvent; 34 34 import javax.swing.event.PopupMenuListener; 35 35 36 import org.openstreetmap.josm.actions.AbstractShowHistoryAction; 36 37 import org.openstreetmap.josm.actions.ExpertToggleAction; 38 import org.openstreetmap.josm.actions.IPrimitiveAction; 37 39 import org.openstreetmap.josm.actions.relation.AddSelectionToRelations; 38 40 import org.openstreetmap.josm.actions.relation.DeleteRelationsAction; 39 41 import org.openstreetmap.josm.actions.relation.DuplicateRelationAction; … … 72 74 import org.openstreetmap.josm.gui.SideButton; 73 75 import org.openstreetmap.josm.gui.dialogs.relation.RelationEditor; 74 76 import org.openstreetmap.josm.gui.dialogs.relation.RelationPopupMenus; 77 import org.openstreetmap.josm.gui.history.HistoryBrowserDialogManager; 75 78 import org.openstreetmap.josm.gui.layer.LayerManager.LayerAddEvent; 76 79 import org.openstreetmap.josm.gui.layer.LayerManager.LayerChangeListener; 77 80 import org.openstreetmap.josm.gui.layer.LayerManager.LayerOrderChangeEvent; … … 408 411 } 409 412 } 410 413 414 static class ShowHistoryAction extends AbstractShowHistoryAction implements IPrimitiveAction { 415 private Collection<? extends IPrimitive> primitives; 416 417 @Override 418 public void actionPerformed(ActionEvent e) { 419 if (primitives != null && !primitives.isEmpty()) { 420 HistoryBrowserDialogManager.getInstance().showHistory(primitives); 421 } 422 } 423 424 @Override 425 public void setPrimitives(Collection<? extends IPrimitive> primitives) { 426 this.primitives = primitives; 427 } 428 } 429 411 430 /** 412 431 * The list model for the list of relations displayed in the relation list dialog. 413 432 */ … … 616 635 List<JMenuItem> checkDisabled = new ArrayList<>(); 617 636 618 637 RelationPopupMenus.setupHandler(popupMenuHandler, SelectInRelationListAction.class); 638 popupMenuHandler.addSeparator(); 639 popupMenuHandler.addAction(new ShowHistoryAction()); 619 640 620 641 // -- export relation to gpx action 621 642 popupMenuHandler.addSeparator();