Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add preselect last used export format in export to clipboard dialog #4533

Merged
merged 8 commits into from
Dec 14, 2018
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
import org.jabref.logic.l10n.Localization;
import org.jabref.logic.util.OS;
import org.jabref.model.entry.BibEntry;

import org.jabref.preferences.JabRefPreferences;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -66,23 +66,18 @@ public void execute() {

//Iterate through exporters looking for match
for (Exporter e: exporters) {
if(e.getName().equals(Globals.prefs.get(JabRefPreferences.LAST_USED_EXPORT))) {
if (e.getName().equals(Globals.prefs.get(JabRefPreferences.LAST_USED_EXPORT))) {
Siedlerchr marked this conversation as resolved.
Show resolved Hide resolved
defaultChoice = e;
}
}


Optional<Exporter> selectedExporter = dialogService.showChoiceDialogAndWait(Localization.lang("Export"), Localization.lang("Select export format"),
Localization.lang("Export"),defaultChoice, exporters);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please insert a space:

Suggested change
Localization.lang("Export"),defaultChoice, exporters);
Localization.lang("Export"), defaultChoice, exporters);



selectedExporter.ifPresent(exporter -> BackgroundTask.wrap(() -> exportToClipboard(exporter))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The indent seems to be wrong here (it was correct before)

.onSuccess(this::setContentToClipboard)
.executeWith(Globals.TASK_EXECUTOR));




}

private String exportToClipboard(Exporter exporter) {
Expand Down