()
| 307 | } |
| 308 | |
| 309 | private void paste() { |
| 310 | String s; |
| 311 | s = textArea.getSelectedText(); |
| 312 | Clipboard clipboard = getToolkit( ). getSystemClipboard(); |
| 313 | Transferable clipData = clipboard.getContents(s); |
| 314 | try { |
| 315 | s = (String)(clipData.getTransferData(DataFlavor.stringFlavor)); |
| 316 | } catch (Exception e) { |
| 317 | s = e.toString( ); |
| 318 | } |
| 319 | int start = textArea.getSelectionStart( ); |
| 320 | int end = textArea.getSelectionEnd( ); |
| 321 | textArea.replaceRange(s, start, end); |
| 322 | if (IJ.isMacOSX()) |
| 323 | textArea.setCaretPosition(start+s.length()); |
| 324 | } |
| 325 | |
| 326 | public void lostOwnership (Clipboard clip, Transferable cont) {} |
| 327 |
no test coverage detected