Skip to content

Commit c70ac17

Browse files
committed
feat: move search short science and google scholar under search sub-menu
1 parent 9fad2cc commit c70ac17

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

jabgui/src/main/java/org/jabref/gui/actions/StandardActions.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public enum StandardActions implements Action {
3838
OPEN_URL(Localization.lang("Open URL or DOI"), IconTheme.JabRefIcons.WWW, KeyBinding.OPEN_URL_OR_DOI),
3939
SEARCH_SHORTSCIENCE(Localization.lang("Search ShortScience")),
4040
SEARCH_GOOGLE_SCHOLAR(Localization.lang("Search Google Scholar")),
41+
SEARCH(Localization.lang("Search...")),
4142
MERGE_WITH_FETCHED_ENTRY(Localization.lang("Get bibliographic data from %0", "DOI/ISBN/..."), KeyBinding.MERGE_WITH_FETCHED_ENTRY),
4243
ATTACH_FILE(Localization.lang("Attach file"), IconTheme.JabRefIcons.ATTACH_FILE),
4344
ATTACH_FILE_FROM_URL(Localization.lang("Attach file from URL"), IconTheme.JabRefIcons.DOWNLOAD_FILE),

jabgui/src/main/java/org/jabref/gui/maintable/RightClickMenu.java

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,7 @@ public static ContextMenu create(BibEntryTableViewModel entry,
101101
extractFileReferencesOffline,
102102

103103
factory.createMenuItem(StandardActions.OPEN_URL, new OpenUrlAction(dialogService, stateManager, preferences)),
104-
factory.createMenuItem(StandardActions.SEARCH_SHORTSCIENCE, new SearchShortScienceAction(dialogService, stateManager, preferences)),
105-
factory.createMenuItem(StandardActions.SEARCH_GOOGLE_SCHOLAR, new SearchGoogleScholarAction(dialogService, stateManager, preferences)),
106-
104+
createSearchSubMenu(factory, dialogService, stateManager, preferences),
107105
new SeparatorMenuItem(),
108106

109107
new ChangeEntryTypeMenu(libraryTab.getSelectedEntries(), libraryTab.getBibDatabaseContext(), undoManager, entryTypesManager).asSubMenu(),
@@ -220,4 +218,16 @@ private static Menu createSendSubMenu(ActionFactory factory,
220218

221219
return sendMenu;
222220
}
221+
222+
private static Menu createSearchSubMenu(ActionFactory factory,
223+
DialogService dialogService,
224+
StateManager stateManager,
225+
GuiPreferences preferences) {
226+
Menu searchMenu = factory.createMenu(StandardActions.SEARCH);
227+
searchMenu.getItems().addAll(
228+
factory.createMenuItem(StandardActions.SEARCH_SHORTSCIENCE, new SearchShortScienceAction(dialogService, stateManager, preferences)),
229+
factory.createMenuItem(StandardActions.SEARCH_GOOGLE_SCHOLAR, new SearchGoogleScholarAction(dialogService, stateManager, preferences))
230+
);
231+
return searchMenu;
232+
}
223233
}

0 commit comments

Comments
 (0)