* different classes to handle info
*/
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
ISelection selection = (ISelection) event.data;
if (selection instanceof TreeSelection) {
TreeSelection treeSelection = (TreeSelection) selection;
IAdaptable firstElement = (IAdaptable) treeSelection.getFirstElement();
IFile file = (IFile) firstElement.getAdapter(IFile.class);
if (file != null && file.isAccessible()) {
File dropped = file.getLocation().toFile();
String currentpath = ((IResource) ((FileEditorInput) editor.getEditorInput()).getFile()).getParent().getLocation()
.toString();
File target = new File(currentpath);
String relPath = "";
relPath = file.getProjectRelativePath().toString();
RelativePath relpather = new RelativePath();
relPath = relpather.getRelativePath(target, dropped);
// System.out.println("Dropped File: " +
// dropped.getAbsolutePath());
// System.out.println("Target File: " +
// target.getAbsolutePath());
// System.out.println("Relative path:" + relPath);
InsertFileLink ifl = new InsertFileLink(dropped, relPath, editor);
ifl.run();
}
System.err.println(treeSelection.getPaths()[0].toString());
}
// Object result =
// localSelectionTransfer.nativeToJava(event.currentDataType);
}