From 30443500d56657d79456dfe89edfc8dc9f8d6bc7 Mon Sep 17 00:00:00 2001 From: Oliver Kopp Date: Sun, 3 Jun 2018 23:56:50 +0200 Subject: [PATCH] Compile fixes --- src/main/java/org/jabref/gui/exporter/ExportCommand.java | 6 +++--- .../org/jabref/gui/exporter/ExportToClipboardAction.java | 2 +- src/main/java/org/jabref/gui/importer/ImportCommand.java | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/jabref/gui/exporter/ExportCommand.java b/src/main/java/org/jabref/gui/exporter/ExportCommand.java index 21bd5051feb..a407dcbce9c 100644 --- a/src/main/java/org/jabref/gui/exporter/ExportCommand.java +++ b/src/main/java/org/jabref/gui/exporter/ExportCommand.java @@ -87,7 +87,7 @@ private void export(Path file, FileChooser.ExtensionFilter selectedExtensionFilt // Make sure we remember which filter was used, to set // the default for next time: - Globals.prefs.put(JabRefPreferences.LAST_USED_EXPORT, format.getDescription()); + Globals.prefs.put(JabRefPreferences.LAST_USED_EXPORT, format.getName()); Globals.prefs.put(JabRefPreferences.EXPORT_WORKING_DIRECTORY, file.getParent().toString()); final List finEntries = entries; @@ -120,7 +120,7 @@ public void run() { public void update() { // No error message. Report success: if (errorMessage == null) { - frame.output(Localization.lang("%0 export successful", format.getDisplayName())); + frame.output(Localization.lang("%0 export successful", format.getName())); } // ... or show an error dialog: else { @@ -141,7 +141,7 @@ public void update() { private static FileDialogConfiguration createExportFileChooser(ExporterFactory exportFactory, String currentDir) { List fileTypes = exportFactory.getExporters().stream().map(Exporter::getFileType).collect(Collectors.toList()); return new FileDialogConfiguration.Builder() - .addExtensionFilters(fileTypes) + .addExtensionFilter(fileTypes.toArray(new FileType[fileTypes.size()])) .withDefaultExtension(Globals.prefs.get(JabRefPreferences.LAST_USED_EXPORT)) .withInitialDirectory(currentDir) .build(); diff --git a/src/main/java/org/jabref/gui/exporter/ExportToClipboardAction.java b/src/main/java/org/jabref/gui/exporter/ExportToClipboardAction.java index f2989a7cb10..a55b40e50c8 100644 --- a/src/main/java/org/jabref/gui/exporter/ExportToClipboardAction.java +++ b/src/main/java/org/jabref/gui/exporter/ExportToClipboardAction.java @@ -50,7 +50,7 @@ public void run() { } List exporters = Globals.exportFactory.getExporters().stream() - .sorted(Comparator.comparing(Exporter::getDisplayName)) + .sorted(Comparator.comparing(Exporter::getName)) .collect(Collectors.toList()); Optional selectedExporter = frame.getDialogService().showChoiceDialogAndWait(Localization.lang("Export"), Localization.lang("Select export format"), diff --git a/src/main/java/org/jabref/gui/importer/ImportCommand.java b/src/main/java/org/jabref/gui/importer/ImportCommand.java index a5ee6ac3cc4..ab9fc7a3275 100644 --- a/src/main/java/org/jabref/gui/importer/ImportCommand.java +++ b/src/main/java/org/jabref/gui/importer/ImportCommand.java @@ -51,7 +51,7 @@ public void execute() { FileDialogConfiguration fileDialogConfiguration = new FileDialogConfiguration.Builder() .addExtensionFilter(anyFile) .addExtensionFilter(allImports) - .addExtensionFilters(extensions) + .addExtensionFilter(extensions.toArray(new FileType[extensions.size()])) .withInitialDirectory(Globals.prefs.get(JabRefPreferences.IMPORT_WORKING_DIRECTORY)) .build(); DefaultTaskExecutor.runInJavaFXThread(() -> {