7
7
import org .jabref .Globals ;
8
8
import org .jabref .gui .BasePanel ;
9
9
import org .jabref .gui .DialogService ;
10
+ import org .jabref .gui .SendAsEMailAction ;
10
11
import org .jabref .gui .StateManager ;
11
12
import org .jabref .gui .actions .ActionFactory ;
12
13
import org .jabref .gui .actions .Actions ;
18
19
import org .jabref .gui .menus .ChangeEntryTypeMenu ;
19
20
import org .jabref .gui .mergeentries .MergeEntriesAction ;
20
21
import org .jabref .gui .mergeentries .MergeWithFetchedEntryAction ;
22
+ import org .jabref .gui .preview .CopyCitationAction ;
21
23
import org .jabref .gui .specialfields .SpecialFieldMenuItemFactory ;
22
- import org .jabref .gui . worker . SendAsEMailAction ;
24
+ import org .jabref .logic . citationstyle . CitationStyleOutputFormat ;
23
25
import org .jabref .logic .citationstyle .CitationStylePreviewLayout ;
24
26
import org .jabref .logic .citationstyle .PreviewLayout ;
25
27
import org .jabref .model .entry .field .SpecialField ;
@@ -34,7 +36,7 @@ public static ContextMenu create(BibEntryTableViewModel entry, KeyBindingReposit
34
36
ActionFactory factory = new ActionFactory (keyBindingRepository );
35
37
36
38
contextMenu .getItems ().add (factory .createMenuItem (StandardActions .COPY , new OldCommandWrapper (Actions .COPY , panel )));
37
- contextMenu .getItems ().add (createCopySubMenu (panel , factory , dialogService ));
39
+ contextMenu .getItems ().add (createCopySubMenu (panel , factory , dialogService , stateManager ));
38
40
contextMenu .getItems ().add (factory .createMenuItem (StandardActions .PASTE , new OldCommandWrapper (Actions .PASTE , panel )));
39
41
contextMenu .getItems ().add (factory .createMenuItem (StandardActions .CUT , new OldCommandWrapper (Actions .CUT , panel )));
40
42
contextMenu .getItems ().add (factory .createMenuItem (StandardActions .DELETE , new OldCommandWrapper (Actions .DELETE , panel )));
@@ -70,7 +72,7 @@ public static ContextMenu create(BibEntryTableViewModel entry, KeyBindingReposit
70
72
return contextMenu ;
71
73
}
72
74
73
- private static Menu createCopySubMenu (BasePanel panel , ActionFactory factory , DialogService dialogService ) {
75
+ private static Menu createCopySubMenu (BasePanel panel , ActionFactory factory , DialogService dialogService , StateManager stateManager ) {
74
76
Menu copySpecialMenu = factory .createMenu (StandardActions .COPY_MORE );
75
77
copySpecialMenu .getItems ().add (factory .createMenuItem (StandardActions .COPY_TITLE , new OldCommandWrapper (Actions .COPY_TITLE , panel )));
76
78
copySpecialMenu .getItems ().add (factory .createMenuItem (StandardActions .COPY_KEY , new OldCommandWrapper (Actions .COPY_KEY , panel )));
@@ -82,15 +84,15 @@ private static Menu createCopySubMenu(BasePanel panel, ActionFactory factory, Di
82
84
PreviewPreferences previewPreferences = Globals .prefs .getPreviewPreferences ();
83
85
PreviewLayout style = previewPreferences .getCurrentPreviewStyle ();
84
86
if (style instanceof CitationStylePreviewLayout ) {
85
- copySpecialMenu .getItems ().add (factory .createMenuItem (StandardActions .COPY_CITATION_HTML , new OldCommandWrapper ( Actions . COPY_CITATION_HTML , panel )));
87
+ copySpecialMenu .getItems ().add (factory .createMenuItem (StandardActions .COPY_CITATION_HTML , new CopyCitationAction ( CitationStyleOutputFormat . HTML , dialogService , stateManager , Globals . clipboardManager , previewPreferences )));
86
88
Menu copyCitationMenu = factory .createMenu (StandardActions .COPY_CITATION_MORE );
87
- copyCitationMenu .getItems ().add (factory .createMenuItem (StandardActions .COPY_CITATION_TEXT , new OldCommandWrapper ( Actions . COPY_CITATION_TEXT , panel )));
88
- copyCitationMenu .getItems ().add (factory .createMenuItem (StandardActions .COPY_CITATION_RTF , new OldCommandWrapper ( Actions . COPY_CITATION_RTF , panel )));
89
- copyCitationMenu .getItems ().add (factory .createMenuItem (StandardActions .COPY_CITATION_ASCII_DOC , new OldCommandWrapper ( Actions . COPY_CITATION_ASCII_DOC , panel )));
90
- copyCitationMenu .getItems ().add (factory .createMenuItem (StandardActions .COPY_CITATION_XSLFO , new OldCommandWrapper ( Actions . COPY_CITATION_XSLFO , panel )));
89
+ copyCitationMenu .getItems ().add (factory .createMenuItem (StandardActions .COPY_CITATION_TEXT , new CopyCitationAction ( CitationStyleOutputFormat . TEXT , dialogService , stateManager , Globals . clipboardManager , previewPreferences )));
90
+ copyCitationMenu .getItems ().add (factory .createMenuItem (StandardActions .COPY_CITATION_RTF , new CopyCitationAction ( CitationStyleOutputFormat . RTF , dialogService , stateManager , Globals . clipboardManager , previewPreferences )));
91
+ copyCitationMenu .getItems ().add (factory .createMenuItem (StandardActions .COPY_CITATION_ASCII_DOC , new CopyCitationAction ( CitationStyleOutputFormat . ASCII_DOC , dialogService , stateManager , Globals . clipboardManager , previewPreferences )));
92
+ copyCitationMenu .getItems ().add (factory .createMenuItem (StandardActions .COPY_CITATION_XSLFO , new CopyCitationAction ( CitationStyleOutputFormat . XSL_FO , dialogService , stateManager , Globals . clipboardManager , previewPreferences )));
91
93
copySpecialMenu .getItems ().add (copyCitationMenu );
92
94
} else {
93
- copySpecialMenu .getItems ().add (factory .createMenuItem (StandardActions .COPY_CITATION_PREVIEW , new OldCommandWrapper ( Actions . COPY_CITATION_HTML , panel )));
95
+ copySpecialMenu .getItems ().add (factory .createMenuItem (StandardActions .COPY_CITATION_PREVIEW , new CopyCitationAction ( CitationStyleOutputFormat . HTML , dialogService , stateManager , Globals . clipboardManager , previewPreferences )));
94
96
}
95
97
96
98
copySpecialMenu .getItems ().add (factory .createMenuItem (StandardActions .EXPORT_TO_CLIPBOARD , new ExportToClipboardAction (panel , dialogService )));
0 commit comments