93
93
import org .jabref .gui .help .AboutAction ;
94
94
import org .jabref .gui .help .HelpAction ;
95
95
import org .jabref .gui .importer .ImportCommand ;
96
- import org .jabref .gui .importer .ImportInspectionDialog ;
96
+ import org .jabref .gui .importer .ImportEntriesDialog ;
97
97
import org .jabref .gui .importer .actions .OpenDatabaseAction ;
98
98
import org .jabref .gui .integrity .IntegrityCheckAction ;
99
99
import org .jabref .gui .keyboard .KeyBinding ;
107
107
import org .jabref .gui .search .GlobalSearchBar ;
108
108
import org .jabref .gui .specialfields .SpecialFieldMenuItemFactory ;
109
109
import org .jabref .gui .undo .CountingUndoManager ;
110
+ import org .jabref .gui .util .BackgroundTask ;
110
111
import org .jabref .gui .util .DefaultTaskExecutor ;
111
112
import org .jabref .logic .autosaveandbackup .AutosaveManager ;
112
113
import org .jabref .logic .autosaveandbackup .BackupManager ;
@@ -179,7 +180,6 @@ public class JabRefFrame extends BorderPane implements OutputPrinter {
179
180
private SidePaneManager sidePaneManager ;
180
181
private TabPane tabbedPane ;
181
182
private PushToApplications pushApplications ;
182
- private final CountingUndoManager undoManager = new CountingUndoManager ();
183
183
private final DialogService dialogService ;
184
184
private SidePane sidePane ;
185
185
@@ -785,7 +785,7 @@ private MenuBar createMenu() {
785
785
if (Globals .prefs .getBoolean (JabRefPreferences .SPECIALFIELDSENABLED )) {
786
786
boolean menuItemAdded = false ;
787
787
if (Globals .prefs .getBoolean (JabRefPreferences .SHOWCOLUMN_RANKING )) {
788
- edit .getItems ().add (SpecialFieldMenuItemFactory .createSpecialFieldMenuForActiveDatabase (SpecialField .RANKING , factory , undoManager ));
788
+ edit .getItems ().add (SpecialFieldMenuItemFactory .createSpecialFieldMenuForActiveDatabase (SpecialField .RANKING , factory , Globals . undoManager ));
789
789
menuItemAdded = true ;
790
790
}
791
791
@@ -805,12 +805,12 @@ private MenuBar createMenu() {
805
805
}
806
806
807
807
if (Globals .prefs .getBoolean (JabRefPreferences .SHOWCOLUMN_PRIORITY )) {
808
- edit .getItems ().add (SpecialFieldMenuItemFactory .createSpecialFieldMenuForActiveDatabase (SpecialField .PRIORITY , factory , undoManager ));
808
+ edit .getItems ().add (SpecialFieldMenuItemFactory .createSpecialFieldMenuForActiveDatabase (SpecialField .PRIORITY , factory , Globals . undoManager ));
809
809
menuItemAdded = true ;
810
810
}
811
811
812
812
if (Globals .prefs .getBoolean (JabRefPreferences .SHOWCOLUMN_READ )) {
813
- edit .getItems ().add (SpecialFieldMenuItemFactory .createSpecialFieldMenuForActiveDatabase (SpecialField .READ_STATUS , factory , undoManager ));
813
+ edit .getItems ().add (SpecialFieldMenuItemFactory .createSpecialFieldMenuForActiveDatabase (SpecialField .READ_STATUS , factory , Globals . undoManager ));
814
814
menuItemAdded = true ;
815
815
}
816
816
@@ -1204,21 +1204,16 @@ private boolean readyForAutosave(BibDatabaseContext context) {
1204
1204
}
1205
1205
1206
1206
/**
1207
- * This method does the job of adding imported entries into the active database, or into a new one. It shows the
1208
- * ImportInspectionDialog if preferences indicate it should be used. Otherwise it imports directly.
1207
+ * Opens the import inspection dialog to let the user decide which of the given entries to import.
1209
1208
*
1210
1209
* @param panel The BasePanel to add to.
1211
1210
* @param entries The entries to add.
1212
1211
*/
1213
1212
private void addImportedEntries (final BasePanel panel , final List <BibEntry > entries ) {
1214
- SwingUtilities .invokeLater (() -> {
1215
- ImportInspectionDialog diag = new ImportInspectionDialog (JabRefFrame .this , panel ,
1216
- Localization .lang ("Import" ), false );
1217
- diag .addEntries (entries );
1218
- diag .entryListComplete ();
1219
- diag .setVisible (true );
1220
- diag .toFront ();
1221
- });
1213
+ BackgroundTask <List <BibEntry >> task = BackgroundTask .wrap (() -> entries );
1214
+ ImportEntriesDialog dialog = new ImportEntriesDialog (panel .getBibDatabaseContext (), task );
1215
+ dialog .setTitle (Localization .lang ("Import" ));
1216
+ dialog .showAndWait ();
1222
1217
}
1223
1218
1224
1219
public FileHistoryMenu getFileHistory () {
@@ -1389,7 +1384,7 @@ public GlobalSearchBar getGlobalSearchBar() {
1389
1384
}
1390
1385
1391
1386
public CountingUndoManager getUndoManager () {
1392
- return undoManager ;
1387
+ return Globals . undoManager ;
1393
1388
}
1394
1389
1395
1390
public DialogService getDialogService () {
0 commit comments