Add 'More' option to right click menu in the main table #9432#10659
Merged
Conversation
openingthe preferences
… into test-issue-9432
Siedlerchr
reviewed
Nov 21, 2023
calixtus
reviewed
Nov 23, 2023
…-issue-9432 # Conflicts: # src/main/java/org/jabref/gui/maintable/MainTableHeaderContextMenu.java # src/main/java/org/jabref/gui/preferences/PreferencesDialogView.java # src/main/java/org/jabref/gui/preferences/ShowPreferencesAction.java
Siedlerchr
reviewed
Nov 26, 2023
Siedlerchr
reviewed
Nov 26, 2023
Siedlerchr
previously approved these changes
Nov 26, 2023
calixtus
reviewed
Nov 27, 2023
Comment on lines
+256
to
+281
| private enum RightClickMenuActions implements Action { | ||
|
|
||
| SHOW_PREFS_RIGHT_CLICK_MENU(Localization.lang("More options..."), IconTheme.JabRefIcons.PREFERENCES); | ||
|
|
||
| private final String text; | ||
| private final String description; | ||
| private final Optional<JabRefIcon> icon; | ||
| private final Optional<KeyBinding> keyBinding; | ||
|
|
||
| RightClickMenuActions(String text, IconTheme.JabRefIcons icon) { | ||
| this.text = text; | ||
| this.description = ""; | ||
| this.icon = Optional.of(icon); | ||
| this.keyBinding = Optional.empty(); | ||
| } | ||
|
|
||
| @Override | ||
| public String getText() { | ||
| return text; | ||
| } | ||
|
|
||
| @Override | ||
| public Optional<JabRefIcon> getIcon() { | ||
| return icon; | ||
| } | ||
| } |
Member
There was a problem hiding this comment.
After some thought: The SHOW_PREFS_RIGHT_CLICK_MENU should move to the StandardActions class and be renamed to SHOW_PREFERENCES, as
- This could be reused in other places.
- From an architectural view: Collect all the Actions of the command pattern in a single place to keep it easier to read and understand.
- Composition over inheritance (?)
Member
There was a problem hiding this comment.
This is simliar to the StandardActions implementation
Member
There was a problem hiding this comment.
We had this discussion in the past multiple times and decided against new implementations of the Actions class.
I just introduced a .withText method to provide a solution for this very special occasion when the name must be changed.
Member
|
I took the liberty to create a quick patch, which should make this all a bit more easier. You can undo it, if you don't like it. |
calixtus
reviewed
Nov 27, 2023
Siedlerchr
approved these changes
Nov 27, 2023
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #9432
This PR adds a "More" option to the context menu that appears when a table column is right-clicked. When the "More" option is selected, the Preferences window opens at the "Entry table" tab. See below
Mandatory checks
CHANGELOG.mddescribed in a way that is understandable for the average user (if applicable)