77import org .jabref .Globals ;
88import org .jabref .gui .BasePanel ;
99import org .jabref .gui .DialogService ;
10+ import org .jabref .gui .SendAsEMailAction ;
1011import org .jabref .gui .StateManager ;
1112import org .jabref .gui .actions .ActionFactory ;
1213import org .jabref .gui .actions .Actions ;
1819import org .jabref .gui .menus .ChangeEntryTypeMenu ;
1920import org .jabref .gui .mergeentries .MergeEntriesAction ;
2021import org .jabref .gui .mergeentries .MergeWithFetchedEntryAction ;
22+ import org .jabref .gui .preview .CopyCitationAction ;
2123import org .jabref .gui .specialfields .SpecialFieldMenuItemFactory ;
22- import org .jabref .gui . worker . SendAsEMailAction ;
24+ import org .jabref .logic . citationstyle . CitationStyleOutputFormat ;
2325import org .jabref .logic .citationstyle .CitationStylePreviewLayout ;
2426import org .jabref .logic .citationstyle .PreviewLayout ;
2527import org .jabref .model .entry .field .SpecialField ;
@@ -34,7 +36,7 @@ public static ContextMenu create(BibEntryTableViewModel entry, KeyBindingReposit
3436 ActionFactory factory = new ActionFactory (keyBindingRepository );
3537
3638 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 ));
3840 contextMenu .getItems ().add (factory .createMenuItem (StandardActions .PASTE , new OldCommandWrapper (Actions .PASTE , panel )));
3941 contextMenu .getItems ().add (factory .createMenuItem (StandardActions .CUT , new OldCommandWrapper (Actions .CUT , panel )));
4042 contextMenu .getItems ().add (factory .createMenuItem (StandardActions .DELETE , new OldCommandWrapper (Actions .DELETE , panel )));
@@ -70,7 +72,7 @@ public static ContextMenu create(BibEntryTableViewModel entry, KeyBindingReposit
7072 return contextMenu ;
7173 }
7274
73- private static Menu createCopySubMenu (BasePanel panel , ActionFactory factory , DialogService dialogService ) {
75+ private static Menu createCopySubMenu (BasePanel panel , ActionFactory factory , DialogService dialogService , StateManager stateManager ) {
7476 Menu copySpecialMenu = factory .createMenu (StandardActions .COPY_MORE );
7577 copySpecialMenu .getItems ().add (factory .createMenuItem (StandardActions .COPY_TITLE , new OldCommandWrapper (Actions .COPY_TITLE , panel )));
7678 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
8284 PreviewPreferences previewPreferences = Globals .prefs .getPreviewPreferences ();
8385 PreviewLayout style = previewPreferences .getCurrentPreviewStyle ();
8486 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 )));
8688 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 )));
9193 copySpecialMenu .getItems ().add (copyCitationMenu );
9294 } 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 )));
9496 }
9597
9698 copySpecialMenu .getItems ().add (factory .createMenuItem (StandardActions .EXPORT_TO_CLIPBOARD , new ExportToClipboardAction (panel , dialogService )));
0 commit comments