Changeset 32691 in osm for applications/editors/josm/plugins/wikipedia/src/org
- Timestamp:
- 2016-07-21T14:25:51+02:00 (9 years ago)
- Location:
- applications/editors/josm/plugins/wikipedia/src/org/wikipedia
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/wikipedia/src/org/wikipedia/WikidataTagCellRenderer.java
r32610 r32691 13 13 import java.util.concurrent.ExecutionException; 14 14 import java.util.concurrent.Future; 15 import java.util.stream.Collectors; 15 16 16 17 import javax.swing.JLabel; … … 19 20 20 21 import org.openstreetmap.josm.Main; 21 import org.openstreetmap.josm.tools.Predicates;22 22 import org.openstreetmap.josm.tools.Utils; 23 23 … … 61 61 } else if (id.contains(";")) { 62 62 final List<String> ids = Arrays.asList(id.split("\\s*;\\s*")); 63 if ( Utils.forAll(ids, Predicates.stringMatchesPattern(WikipediaApp.WIKIDATA_PATTERN))) {63 if (ids.stream().allMatch(i -> WikipediaApp.WIKIDATA_PATTERN.matcher(i).matches())) { 64 64 return renderValues(ids, table, component); 65 65 } … … 94 94 texts.add(WikipediaApp.WikidataEntry.getLabelText(id, label)); 95 95 } 96 component.setText("<html>" + Utils.join("; ", texts));96 component.setText("<html>" + texts.stream().collect(Collectors.joining("; "))); 97 97 component.setToolTipText("<html>" + Utils.joinAsHtmlUnorderedList(texts)); 98 98 return component; -
applications/editors/josm/plugins/wikipedia/src/org/wikipedia/WikipediaApp.java
r32687 r32691 177 177 178 178 try { 179 final String requestBody = "articles=" + Utils.encodeUrl( Utils.join(",",articleNames));179 final String requestBody = "articles=" + Utils.encodeUrl(articleNames.stream().collect(Collectors.joining(","))); 180 180 try (final Scanner scanner = new Scanner( 181 181 HttpClient.create(new URL(url), "POST").setReasonForRequest("Wikipedia") -
applications/editors/josm/plugins/wikipedia/src/org/wikipedia/WikipediaCopyTemplate.java
r32424 r32691 100 100 protected Node getSelectedNode() { 101 101 DataSet ds = getLayerManager().getEditDataSet(); 102 if (ds == null || ds.getSelected() == null) {102 if (ds == null) { 103 103 return null; 104 104 } else { 105 Collection<Node> nodes = Utils.filteredCollection(ds.getSelected(), Node.class); 106 return nodes.isEmpty() ? null : nodes.iterator().next(); 105 return (Node) ds.getSelected().stream().filter(Node.class::isInstance).findFirst().orElse(null); 107 106 } 108 107 }
Note:
See TracChangeset
for help on using the changeset viewer.