MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / paste

Method paste

ij/src/main/java/ij/plugin/frame/Fitter.java:309–324  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers 1

actionPerformedMethod · 0.95

Calls 6

isMacOSXMethod · 0.95
lengthMethod · 0.65
getTransferDataMethod · 0.45
toStringMethod · 0.45
getSelectionStartMethod · 0.45
getSelectionEndMethod · 0.45

Tested by

no test coverage detected