Changeset 16326 in josm for trunk/src/org
- Timestamp:
- 2020-04-17T21:27:31+02:00 (5 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/datatransfer
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/datatransfer/AbstractStackTransferHandler.java
r12636 r16326 35 35 public boolean canImport(TransferSupport support) { 36 36 // import everything for now, only support copy. 37 for (AbstractOsmDataPaster df : getSupportedPasters()) { 38 if (df.supports(support)) { 39 return true; 40 } 41 } 42 return false; 37 return getSupportedPasters().stream() 38 .anyMatch(df -> df.supports(support)); 43 39 } 44 40 -
trunk/src/org/openstreetmap/josm/gui/datatransfer/OsmTransferHandler.java
r14500 r16326 91 91 try { 92 92 Collection<DataFlavor> available = Arrays.asList(ClipboardUtils.getClipboard().getAvailableDataFlavors()); 93 for (AbstractOsmDataPaster s : SUPPORTED) { 94 if (s.supports(available)) { 95 return true; 96 } 97 } 93 return SUPPORTED.stream() 94 .anyMatch(s -> s.supports(available)); 98 95 } catch (IllegalStateException e) { 99 96 Logging.debug(e); -
trunk/src/org/openstreetmap/josm/gui/datatransfer/PrimitiveTransferable.java
r14500 r16326 62 62 public boolean isDataFlavorSupported(DataFlavor flavor) { 63 63 DataFlavor[] flavors = getTransferDataFlavors(); 64 for (DataFlavor f : flavors) { 65 if (flavor.equals(f)) { 66 return true; 67 } 68 } 69 return false; 64 return Arrays.stream(flavors) 65 .anyMatch(flavor::equals); 70 66 } 71 67
Note:
See TracChangeset
for help on using the changeset viewer.