32
32
import org .jabref .model .study .Study ;
33
33
import org .jabref .model .study .StudyDatabase ;
34
34
import org .jabref .model .study .StudyQuery ;
35
- import org .jabref .preferences .PreferencesService ;
35
+ import org .jabref .preferences .WorkspacePreferences ;
36
36
37
37
import org .slf4j .Logger ;
38
38
import org .slf4j .LoggerFactory ;
@@ -61,15 +61,15 @@ public class ManageStudyDefinitionViewModel {
61
61
62
62
private final DialogService dialogService ;
63
63
64
- private final PreferencesService preferencesService ;
64
+ private final WorkspacePreferences workspacePreferences ;
65
65
66
66
/**
67
67
* Constructor for a new study
68
68
*/
69
69
public ManageStudyDefinitionViewModel (ImportFormatPreferences importFormatPreferences ,
70
70
ImporterPreferences importerPreferences ,
71
- DialogService dialogService ,
72
- PreferencesService preferencesService ) {
71
+ WorkspacePreferences workspacePreferences ,
72
+ DialogService dialogService ) {
73
73
databases .addAll (WebFetchers .getSearchBasedFetchers (importFormatPreferences , importerPreferences )
74
74
.stream ()
75
75
.map (SearchBasedFetcher ::getName )
@@ -82,7 +82,7 @@ public ManageStudyDefinitionViewModel(ImportFormatPreferences importFormatPrefer
82
82
})
83
83
.toList ());
84
84
this .dialogService = Objects .requireNonNull (dialogService );
85
- this .preferencesService = Objects .requireNonNull (preferencesService );
85
+ this .workspacePreferences = Objects .requireNonNull (workspacePreferences );
86
86
}
87
87
88
88
/**
@@ -95,8 +95,8 @@ public ManageStudyDefinitionViewModel(Study study,
95
95
Path studyDirectory ,
96
96
ImportFormatPreferences importFormatPreferences ,
97
97
ImporterPreferences importerPreferences ,
98
- DialogService dialogService ,
99
- PreferencesService preferencesService ) {
98
+ WorkspacePreferences workspacePreferences ,
99
+ DialogService dialogService ) {
100
100
// copy the content of the study object into the UI fields
101
101
authors .addAll (Objects .requireNonNull (study ).getAuthors ());
102
102
title .setValue (study .getTitle ());
@@ -117,7 +117,7 @@ public ManageStudyDefinitionViewModel(Study study,
117
117
118
118
this .directory .set (Objects .requireNonNull (studyDirectory ).toString ());
119
119
this .dialogService = Objects .requireNonNull (dialogService );
120
- this .preferencesService = Objects .requireNonNull (preferencesService );
120
+ this .workspacePreferences = Objects .requireNonNull (workspacePreferences );
121
121
}
122
122
123
123
public StringProperty getTitle () {
@@ -226,7 +226,7 @@ public void deleteQuery(String item) {
226
226
}
227
227
228
228
public void initializeSelectedCatalogs () {
229
- List <String > selectedCatalogs = preferencesService . getWorkspacePreferences () .getSelectedSlrCatalogs ();
229
+ List <String > selectedCatalogs = workspacePreferences .getSelectedSlrCatalogs ();
230
230
for (StudyCatalogItem catalog : databases ) {
231
231
catalog .setEnabled (selectedCatalogs .contains (catalog .getName ()));
232
232
}
@@ -238,6 +238,6 @@ public void updateSelectedCatalogs() {
238
238
.map (StudyCatalogItem ::getName )
239
239
.collect (Collectors .toList ());
240
240
241
- preferencesService . getWorkspacePreferences () .setSelectedSlrCatalogs (selectedCatalogsList );
241
+ workspacePreferences .setSelectedSlrCatalogs (selectedCatalogsList );
242
242
}
243
243
}
0 commit comments