- Timestamp:
- 2020-01-11T21:02:08+01:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/util/AbstractTag2LinkPopupListener.java
r15673 r15687 2 2 package org.openstreetmap.josm.gui.util; 3 3 4 import java.awt.Component; 4 5 import java.util.ArrayList; 5 6 import java.util.List; 6 7 7 import javax.swing.JMenuItem;8 8 import javax.swing.JPopupMenu; 9 9 import javax.swing.event.PopupMenuEvent; … … 17 17 public abstract class AbstractTag2LinkPopupListener implements PopupMenuListener { 18 18 19 private final List< JMenuItem> itemList;19 private final List<Component> itemList; 20 20 21 21 protected AbstractTag2LinkPopupListener() { … … 35 35 36 36 protected void addLinks(JPopupMenu popup, String key, String value) { 37 Tag2Link.getLinksForTag(key, value, (name, url) -> itemList.add(popup.add(new OpenBrowserAction(name, url)))); 37 Tag2Link.getLinksForTag(key, value, (name, url) -> { 38 if (itemList.isEmpty()) { 39 itemList.add(popup.add(new JPopupMenu.Separator())); 40 } 41 42 itemList.add(popup.add(new OpenBrowserAction(name, url))); 43 }); 38 44 } 39 45 }
Note:
See TracChangeset
for help on using the changeset viewer.