Changeset 5221 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2012-05-08T01:59:53+02:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/Utils.java
r5159 r5221 23 23 import java.util.Iterator; 24 24 import java.util.List; 25 import org.openstreetmap.josm.data.osm.OsmPrimitive;26 25 27 26 /** … … 327 326 */ 328 327 public static String getClipboardContent() { 329 Transferable t = Toolkit.getDefaultToolkit().getSystemClipboard().getContents(null); 328 Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard(); 329 Transferable t = null; 330 for (int tries = 0; t == null && tries < 10; tries++) { 331 try { 332 t = clipboard.getContents(null); 333 } catch (IllegalStateException e) { 334 // Clipboard currently unavailable. On some platforms, the system clipboard is unavailable while it is accessed by another application. 335 try { 336 Thread.sleep(1); 337 } catch (InterruptedException ex) { 338 } 339 } 340 } 330 341 try { 331 342 if (t != null && t.isDataFlavorSupported(DataFlavor.stringFlavor)) {
Note:
See TracChangeset
for help on using the changeset viewer.