class DragNDropFrameAdapter {

    private static final String GEPHI_EXTENSION = "gephi";

    public static void register() {<FILL_FUNCTION_BODY>}
}

        JFrame frame = (JFrame) WindowManager.getDefault().getMainWindow();
        frame.setTransferHandler(new TransferHandler() {

            @Override
            public boolean canImport(TransferHandler.TransferSupport support) {
                return support.isDataFlavorSupported(DataFlavor.javaFileListFlavor);
                //Due to bug 6759788 - http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6759788
                //Impossible to get data here and look if compatible format
            }

            @Override
            public boolean importData(TransferHandler.TransferSupport support) {
                if (!canImport(support)) {
                    return false;
                }
                try {
                    List data = (List) support.getTransferable().getTransferData(DataFlavor.javaFileListFlavor);
                    File file = (File) data.get(0);
                    FileObject fileObject = FileUtil.toFileObject(file);
                    if (!file.exists()) {
                        return false;
                    }
                    if (fileObject.hasExt(GEPHI_EXTENSION)) {
                        Actions.forID("File", "org.gephi.desktop.project.actions.OpenFile").actionPerformed(
                            new ActionEvent(file, 0, null));
                    } else {
                        ImportControllerUI importController = Lookup.getDefault().lookup(ImportControllerUI.class);
                        if (importController.getImportController().isFileSupported(FileUtil.toFile(fileObject))) {
                            importController.importFile(fileObject);
                        } else {
                            return false;
                        }
                    }
                    return true;
                } catch (UnsupportedFlavorException ex) {
                    Exceptions.printStackTrace(ex);
                } catch (IOException ex) {
                    Exceptions.printStackTrace(ex);
                }
                return false;
            }
        });
    
<no_super_class>