|
10 | 10 | import java.util.Map;
|
11 | 11 | import java.util.Objects;
|
12 | 12 | import java.util.Optional;
|
13 |
| -import java.util.Set; |
14 | 13 | import java.util.stream.Collectors;
|
15 | 14 |
|
16 | 15 | import javax.swing.undo.CannotRedoException;
|
|
35 | 34 | import org.jabref.gui.cleanup.CleanupAction;
|
36 | 35 | import org.jabref.gui.collab.DatabaseChangeMonitor;
|
37 | 36 | import org.jabref.gui.collab.DatabaseChangePane;
|
38 |
| -import org.jabref.gui.desktop.JabRefDesktop; |
39 | 37 | import org.jabref.gui.edit.CopyBibTeXKeyAndLinkAction;
|
40 | 38 | import org.jabref.gui.edit.ReplaceStringAction;
|
41 | 39 | import org.jabref.gui.entryeditor.EntryEditor;
|
42 | 40 | import org.jabref.gui.exporter.SaveDatabaseAction;
|
43 | 41 | import org.jabref.gui.externalfiles.DownloadFullTextAction;
|
44 |
| -import org.jabref.gui.externalfiletype.ExternalFileType; |
45 | 42 | import org.jabref.gui.externalfiletype.ExternalFileTypes;
|
46 | 43 | import org.jabref.gui.importer.actions.AppendDatabaseAction;
|
47 | 44 | import org.jabref.gui.journals.AbbreviateAction;
|
48 | 45 | import org.jabref.gui.journals.AbbreviationType;
|
49 | 46 | import org.jabref.gui.journals.UnabbreviateAction;
|
50 | 47 | import org.jabref.gui.maintable.MainTable;
|
51 | 48 | import org.jabref.gui.maintable.MainTableDataModel;
|
52 |
| -import org.jabref.gui.mergeentries.MergeEntriesAction; |
53 |
| -import org.jabref.gui.mergeentries.MergeWithFetchedEntryAction; |
54 | 49 | import org.jabref.gui.preview.CitationStyleToClipboardWorker;
|
55 | 50 | import org.jabref.gui.specialfields.SpecialFieldDatabaseChangeListener;
|
56 | 51 | import org.jabref.gui.specialfields.SpecialFieldValueViewModel;
|
|
70 | 65 | import org.jabref.logic.pdf.FileAnnotationCache;
|
71 | 66 | import org.jabref.logic.search.SearchQuery;
|
72 | 67 | import org.jabref.logic.util.UpdateField;
|
73 |
| -import org.jabref.logic.util.io.FileFinder; |
74 |
| -import org.jabref.logic.util.io.FileFinders; |
75 |
| -import org.jabref.logic.util.io.FileUtil; |
76 | 68 | import org.jabref.model.FieldChange;
|
77 | 69 | import org.jabref.model.database.BibDatabase;
|
78 | 70 | import org.jabref.model.database.BibDatabaseContext;
|
|
84 | 76 | import org.jabref.model.database.shared.DatabaseLocation;
|
85 | 77 | import org.jabref.model.database.shared.DatabaseSynchronizer;
|
86 | 78 | import org.jabref.model.entry.BibEntry;
|
87 |
| -import org.jabref.model.entry.FileFieldParser; |
88 |
| -import org.jabref.model.entry.LinkedFile; |
89 | 79 | import org.jabref.model.entry.event.EntriesEventSource;
|
90 | 80 | import org.jabref.model.entry.event.EntryChangedEvent;
|
91 | 81 | import org.jabref.model.entry.field.Field;
|
92 | 82 | import org.jabref.model.entry.field.FieldFactory;
|
93 | 83 | import org.jabref.model.entry.field.SpecialField;
|
94 | 84 | import org.jabref.model.entry.field.SpecialFieldValue;
|
95 |
| -import org.jabref.model.entry.field.StandardField; |
96 | 85 | import org.jabref.preferences.JabRefPreferences;
|
97 | 86 |
|
98 | 87 | import com.google.common.eventbus.Subscribe;
|
@@ -281,7 +270,7 @@ private void setupActions() {
|
281 | 270 | // The action for cleaning up entry.
|
282 | 271 | actions.put(Actions.CLEANUP, cleanUpAction);
|
283 | 272 |
|
284 |
| - actions.put(Actions.MERGE_ENTRIES, () -> new MergeEntriesAction(frame, Globals.stateManager).execute()); |
| 273 | + // actions.put(Actions.MERGE_ENTRIES, () -> new MergeEntriesAction(frame, Globals.stateManager).execute()); |
285 | 274 |
|
286 | 275 | // The action for copying the selected entry's key.
|
287 | 276 | actions.put(Actions.COPY_KEY, this::copyKey);
|
@@ -311,9 +300,9 @@ private void setupActions() {
|
311 | 300 | dbmsSynchronizer.pullChanges();
|
312 | 301 | });
|
313 | 302 |
|
314 |
| - actions.put(Actions.OPEN_URL, new OpenURLAction()); |
| 303 | + // actions.put(Actions.OPEN_URL, new OpenURLAction()); |
315 | 304 |
|
316 |
| - actions.put(Actions.MERGE_WITH_FETCHED_ENTRY, new MergeWithFetchedEntryAction(this, frame.getDialogService())); |
| 305 | + // actions.put(Actions.MERGE_WITH_FETCHED_ENTRY, new MergeWithFetchedEntryAction(this, frame.getDialogService())); |
317 | 306 |
|
318 | 307 | actions.put(Actions.REPLACE_ALL, () -> (new ReplaceStringAction(this)).execute());
|
319 | 308 |
|
@@ -1112,60 +1101,6 @@ public void action() {
|
1112 | 1101 | }
|
1113 | 1102 | }
|
1114 | 1103 |
|
1115 |
| - private class OpenURLAction implements BaseAction { |
1116 |
| - |
1117 |
| - @Override |
1118 |
| - public void action() { |
1119 |
| - final List<BibEntry> bes = mainTable.getSelectedEntries(); |
1120 |
| - if (bes.size() == 1) { |
1121 |
| - Field field = StandardField.DOI; |
1122 |
| - Optional<String> link = bes.get(0).getField(StandardField.DOI); |
1123 |
| - if (bes.get(0).hasField(StandardField.URL)) { |
1124 |
| - link = bes.get(0).getField(StandardField.URL); |
1125 |
| - field = StandardField.URL; |
1126 |
| - } |
1127 |
| - if (link.isPresent()) { |
1128 |
| - try { |
1129 |
| - JabRefDesktop.openExternalViewer(bibDatabaseContext, link.get(), field); |
1130 |
| - output(Localization.lang("External viewer called") + '.'); |
1131 |
| - } catch (IOException ex) { |
1132 |
| - output(Localization.lang("Error") + ": " + ex.getMessage()); |
1133 |
| - } |
1134 |
| - } else { |
1135 |
| - // No URL or DOI found in the "url" and "doi" fields. |
1136 |
| - // Look for web links in the "file" field as a fallback: |
1137 |
| - |
1138 |
| - List<LinkedFile> files = bes.get(0).getFiles(); |
1139 |
| - |
1140 |
| - Optional<LinkedFile> linkedFile = files.stream() |
1141 |
| - .filter(file -> (StandardField.URL.getName().equalsIgnoreCase(file.getFileType()) |
1142 |
| - || StandardField.PS.getName().equalsIgnoreCase(file.getFileType()) |
1143 |
| - || StandardField.PDF.getName().equalsIgnoreCase(file.getFileType()))) |
1144 |
| - .findFirst(); |
1145 |
| - |
1146 |
| - if (linkedFile.isPresent()) { |
1147 |
| - |
1148 |
| - try { |
1149 |
| - |
1150 |
| - JabRefDesktop.openExternalFileAnyFormat(bibDatabaseContext, |
1151 |
| - linkedFile.get().getLink(), |
1152 |
| - ExternalFileTypes.getInstance().fromLinkedFile(linkedFile.get(), true)); |
1153 |
| - |
1154 |
| - output(Localization.lang("External viewer called") + '.'); |
1155 |
| - } catch (IOException e) { |
1156 |
| - output(Localization.lang("Could not open link")); |
1157 |
| - LOGGER.info("Could not open link", e); |
1158 |
| - } |
1159 |
| - } else { |
1160 |
| - output(Localization.lang("No URL defined") + '.'); |
1161 |
| - } |
1162 |
| - } |
1163 |
| - } else { |
1164 |
| - output(Localization.lang("This operation requires exactly one item to be selected.")); |
1165 |
| - } |
1166 |
| - } |
1167 |
| - } |
1168 |
| - |
1169 | 1104 | private class RedoAction implements BaseAction {
|
1170 | 1105 |
|
1171 | 1106 | @Override
|
|
0 commit comments