36
36
import org .jabref .model .database .BibDatabaseContext ;
37
37
import org .jabref .model .entry .BibEntryTypesManager ;
38
38
39
- import com .airhacks .afterburner .injection .Injector ;
40
-
41
39
public class StyleSelectDialogViewModel {
42
40
43
41
private final DialogService dialogService ;
@@ -49,6 +47,8 @@ public class StyleSelectDialogViewModel {
49
47
private final FilePreferences filePreferences ;
50
48
private final OpenOfficePreferences openOfficePreferences ;
51
49
50
+ private final BibEntryTypesManager bibEntryTypesManager ;
51
+
52
52
private final ObjectProperty <Tab > selectedTab = new SimpleObjectProperty <>();
53
53
54
54
private final ListProperty <JStyleSelectViewModel > jStyles = new SimpleListProperty <>(FXCollections .observableArrayList ());
@@ -73,6 +73,8 @@ public StyleSelectDialogViewModel(DialogService dialogService,
73
73
this .filePreferences = preferences .getFilePreferences ();
74
74
this .openOfficePreferences = preferences .getOpenOfficePreferences ();
75
75
76
+ this .bibEntryTypesManager = bibEntryTypesManager ;
77
+
76
78
jStyles .addAll (loadJStyles ());
77
79
78
80
OOStyle currentStyle = openOfficePreferences .getCurrentStyle ();
@@ -198,7 +200,7 @@ public void addCslStyleFile() {
198
200
199
201
List <CitationStyle > allStyles = CSLStyleLoader .getStyles ();
200
202
List <CitationStylePreviewLayout > updatedLayouts = allStyles .stream ()
201
- .map (style -> new CitationStylePreviewLayout (style , Injector . instantiateModelOrService ( BibEntryTypesManager . class ) ))
203
+ .map (style -> new CitationStylePreviewLayout (style , bibEntryTypesManager ))
202
204
.toList ();
203
205
204
206
availableCslLayouts .setAll (updatedLayouts );
0 commit comments