+
+ Resource selectedResource = null;
+ try {
+ if(selection instanceof StructuredSelection) {
+ StructuredSelection structuredSelection = (StructuredSelection)selection;
+ Object elem = structuredSelection.getFirstElement();
+ IAdaptable a = (IAdaptable)elem;
+ selectedResource = a.getAdapter(Resource.class);
+ }
+ } catch(NullPointerException | ClassCastException npe) {
+ LOGGER.warn("Failed to find selection, passing null to file importer", npe);
+ }
+
+ FileImportService.performFileImport(Paths.get(fileName), Optional.of(selectedResource), Optional.of((Consumer<Throwable>) t -> {