Changeset 16067 in josm for trunk/src/org
- Timestamp:
- 2020-03-08T09:03:32+01:00 (5 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java
r15913 r16067 373 373 final LatLon center = newSel.iterator().next().getBBox().getCenter(); 374 374 Territories.getRegionalTaginfoUrls(center).stream() 375 .map(taginfo -> new TaginfoAction( 375 .map(taginfo -> new TaginfoAction(tr("Go to Taginfo ({0})", taginfo.toString()), 376 376 tagTable, editHelper::getDataKey, editHelper::getDataValues, 377 membershipTable, x -> (IRelation<?>) membershipData.getValueAt(x, 0), taginfo.getUrl(), 378 String.join("/", taginfo.getIsoCodes()) + (taginfo.getSuffix() == null ? "" : " (" + taginfo.getSuffix() + ")")) 377 membershipTable, x -> (IRelation<?>) membershipData.getValueAt(x, 0), taginfo.getUrl()) 379 378 ).forEach(taginfoNationalActions::add); 380 379 taginfoNationalActions.stream().map(membershipMenu::add).forEach(membershipMenuTagInfoNatItems::add); -
trunk/src/org/openstreetmap/josm/gui/dialogs/properties/TaginfoAction.java
r15565 r16067 44 44 public TaginfoAction(JTable tagTable, IntFunction<String> tagKeySupplier, IntFunction<Map<String, Integer>> tagValuesSupplier, 45 45 JTable membershipTable, IntFunction<IRelation<?>> memberValueSupplier) { 46 this(t agTable, tagKeySupplier, tagValuesSupplier, membershipTable, memberValueSupplier, TAGINFO_URL_PROP.get(), null);46 this(tr("Go to Taginfo"), tagTable, tagKeySupplier, tagValuesSupplier, membershipTable, memberValueSupplier, TAGINFO_URL_PROP.get()); 47 47 } 48 48 49 49 /** 50 50 * Constructs a new {@code TaginfoAction} with a given URL and optional name suffix. 51 * @param name the action's text as displayed on the menu (if it is added to a menu) 51 52 * @param tagTable The tag table. Cannot be null 52 53 * @param tagKeySupplier Finds the key from given row of tag table. Cannot be null … … 55 56 * @param memberValueSupplier Finds the parent relation from given row of membership table. Can be null 56 57 * @param taginfoUrl Taginfo URL. Cannot be null 57 * @param suffix Optional name suffix, can be null58 58 * @since 15565 59 59 */ 60 public TaginfoAction( JTable tagTable, IntFunction<String> tagKeySupplier, IntFunction<Map<String, Integer>> tagValuesSupplier,61 JTable membershipTable, IntFunction<IRelation<?>> memberValueSupplier, String taginfoUrl, String suffix) {62 super( tr("Go to Taginfo") + (suffix != null ? " " + suffix : ""), "dialogs/taginfo",60 public TaginfoAction(String name, JTable tagTable, IntFunction<String> tagKeySupplier, IntFunction<Map<String, Integer>> tagValuesSupplier, 61 JTable membershipTable, IntFunction<IRelation<?>> memberValueSupplier, String taginfoUrl) { 62 super(name, "dialogs/taginfo", 63 63 tr("Launch browser with Taginfo statistics for selected object"), null, false); 64 64 this.taginfoUrl = taginfoUrl.endsWith("/") ? taginfoUrl : taginfoUrl + '/'; -
trunk/src/org/openstreetmap/josm/tools/TaginfoRegionalInstance.java
r15876 r16067 62 62 return suffix; 63 63 } 64 65 @Override 66 public String toString() { 67 return (suffix == null ? "" : suffix + " ") + String.join("/", isoCodes); 68 } 64 69 }
Note:
See TracChangeset
for help on using the changeset viewer.