From 4a5f497b8bb017368462a60464149de3bbca4da5 Mon Sep 17 00:00:00 2001 From: Simon Harrer Date: Thu, 10 Mar 2016 17:53:32 +0100 Subject: [PATCH] Add radio buttons to show which of the highlightings (all or any) in groups menu --- CHANGELOG.md | 1 + .../java/net/sf/jabref/gui/JabRefFrame.java | 17 +++++++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1cda511885e..f3ca790d18a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,6 +40,7 @@ to [sourceforge feature requests](https://sourceforge.net/p/jabref/features/) by ### Fixed - Fixed [#598](https://github.com/JabRef/jabref/issues/598) and [#402](https://github.com/JabRef/jabref/issues/402): No more issues with invalid icons for ExternalFileTypes in global search or after editing the settings - Fixed [#883](https://github.com/JabRef/jabref/issues/883): No NPE during cleanup +- Fixed [#845](https://github.com/JabRef/jabref/issues/845): Add checkboxes for highlighting in groups menu, fixes other toggle highlighting as well for all toggle buttons - Fixed [#890](https://github.com/JabRef/jabref/issues/890): No NPE when renaming file - Fixed [#466](https://github.com/JabRef/jabref/issues/466): Rename PDF cleanup now also changes case of file name - Fixed [#621](https://github.com/JabRef/jabref/issues/621) and [#669](https://github.com/JabRef/jabref/issues/669): Encoding and preamble now end with newline. diff --git a/src/main/java/net/sf/jabref/gui/JabRefFrame.java b/src/main/java/net/sf/jabref/gui/JabRefFrame.java index c94ff322cc9..a8c0a2e1d75 100644 --- a/src/main/java/net/sf/jabref/gui/JabRefFrame.java +++ b/src/main/java/net/sf/jabref/gui/JabRefFrame.java @@ -322,12 +322,12 @@ public void actionPerformed(ActionEvent e) { Localization.lang("Toggle entry preview"), Globals.getKeyPrefs().getKey(KeyBinding.TOGGLE_ENTRY_PREVIEW), IconTheme.JabRefIcon.TOGGLE_ENTRY_PREVIEW.getIcon())); - private final Action toggleHighlightAny = new GeneralAction(Actions.TOGGLE_HIGHLIGHTS_GROUPS_MATCHING_ANY, + private final Action toggleHighlightAny = enableToggle(new GeneralAction(Actions.TOGGLE_HIGHLIGHTS_GROUPS_MATCHING_ANY, Localization.menuTitle("Highlight groups matching any selected entry"), - Localization.lang("Highlight groups matching any selected entry")); - private final Action toggleHighlightAll = new GeneralAction(Actions.TOGGLE_HIGHLIGHTS_GROUPS_MATCHING_ALL, + Localization.lang("Highlight groups matching any selected entry"))); + private final Action toggleHighlightAll = enableToggle(new GeneralAction(Actions.TOGGLE_HIGHLIGHTS_GROUPS_MATCHING_ALL, Localization.menuTitle("Highlight groups matching all selected entries"), - Localization.lang("Highlight groups matching all selected entries")); + Localization.lang("Highlight groups matching all selected entries"))); private final AbstractAction switchPreview = new GeneralAction(Actions.SWITCH_PREVIEW, Localization.menuTitle("Switch preview layout"), Globals.getKeyPrefs().getKey(KeyBinding.SWITCH_PREVIEW_LAYOUT)); @@ -1253,8 +1253,13 @@ private void fillMenu() { groups.add(removeFromGroup); groups.add(moveToGroup); groups.addSeparator(); - groups.add(toggleHighlightAny); - groups.add(toggleHighlightAll); + JRadioButtonMenuItem toggleHighlightAnyItem = new JRadioButtonMenuItem(toggleHighlightAny); + groups.add(toggleHighlightAnyItem); + JRadioButtonMenuItem toggleHighlightAllItem = new JRadioButtonMenuItem(toggleHighlightAll); + groups.add(toggleHighlightAllItem); + ButtonGroup highlightButtonGroup = new ButtonGroup(); + highlightButtonGroup.add(toggleHighlightAnyItem); + highlightButtonGroup.add(toggleHighlightAllItem); mb.add(groups); view.add(getBackAction());