MCPcopy Index your code
hub / github.com/OpenSourcePhysics/osp / drop

Method drop

src/test/LoaderTest.java:175–190  ·  view source on GitHub ↗
(DropTargetDropEvent e)

Source from the content-addressed store, hash-verified

173 public void dropActionChanged(DropTargetDragEvent e){}
174
175 public void drop(DropTargetDropEvent e){
176 try{
177 // Accept the drop first, important!
178 e.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE);
179
180 // Get the files that are dropped as java.util.List
181 java.util.List list=(java.util.List) e.getTransferable().getTransferData(DataFlavor.javaFileListFlavor);
182
183 // Now get the first file from the list,
184 File file=(File)list.get(0);
185 String path=file.getAbsolutePath();
186 //jt.read(new FileReader(file),null);
187 loadIntoEditor(path);
188
189 }catch(Exception ex){}
190 }
191 });
192 }
193

Callers

nothing calls this directly

Calls 4

loadIntoEditorMethod · 0.95
getTransferDataMethod · 0.80
getMethod · 0.65
getAbsolutePathMethod · 0.45

Tested by

no test coverage detected