Ignore:
Timestamp:
2020-06-11T11:32:21+02:00 (4 years ago)
Author:
simon04
Message:

see #19369 - TaginfoAction.withTaginfoUrl: simplify construction of custom instances, share Consumer objects

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java

    r16596 r16597  
    192192    private final HelpAction helpTagAction = new HelpTagAction(tagTable, editHelper::getDataKey, editHelper::getDataValues);
    193193    private final HelpAction helpRelAction = new HelpMembershipAction(membershipTable, x -> (IRelation<?>) membershipData.getValueAt(x, 0));
    194     private final TaginfoAction taginfoAction = new TaginfoAction(tr("Go to Taginfo"),
     194    private final TaginfoAction taginfoAction = new TaginfoAction(
    195195            tagTable, editHelper::getDataKey, editHelper::getDataValues,
    196             membershipTable, x -> (IRelation<?>) membershipData.getValueAt(x, 0), null);
     196            membershipTable, x -> (IRelation<?>) membershipData.getValueAt(x, 0));
    197197    private final TaginfoAction tagHistoryAction = taginfoAction.toTagHistoryAction();
    198198    private final Collection<TaginfoAction> taginfoNationalActions = new ArrayList<>();
     
    375375            final LatLon center = newSel.iterator().next().getBBox().getCenter();
    376376            Territories.getRegionalTaginfoUrls(center).stream()
    377                     .map(taginfo -> new TaginfoAction(tr("Go to Taginfo ({0})", taginfo.toString()),
    378                             tagTable, editHelper::getDataKey, editHelper::getDataValues,
    379                             membershipTable, x -> (IRelation<?>) membershipData.getValueAt(x, 0), taginfo.getUrl())
     377                    .map(taginfo -> taginfoAction.withTaginfoUrl(tr("Go to Taginfo ({0})", taginfo.toString()), taginfo.getUrl())
    380378                    ).forEach(taginfoNationalActions::add);
    381379            taginfoNationalActions.stream().map(membershipMenu::add).forEach(membershipMenuTagInfoNatItems::add);
Note: See TracChangeset for help on using the changeset viewer.