Skip to content

Add 'More' option to right click menu in the main table #9432#10659

Merged
Siedlerchr merged 25 commits into
JabRef:mainfrom
theoo33:fix-for-issue-9432
Nov 27, 2023
Merged

Add 'More' option to right click menu in the main table #9432#10659
Siedlerchr merged 25 commits into
JabRef:mainfrom
theoo33:fix-for-issue-9432

Conversation

@theoo33

@theoo33 theoo33 commented Nov 21, 2023

Copy link
Copy Markdown
Contributor

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

image
image

Mandatory checks

  • Change in CHANGELOG.md described in a way that is understandable for the average user (if applicable)
  • Tests created for changes (if applicable)
  • Manually tested changed features in running JabRef (always required)
  • Screenshots added in PR description (for UI changes)
  • Checked developer's documentation: Is the information available and up to date? If not, I outlined it in this pull request.
  • Checked documentation: Is the information available and up to date? If not, I created an issue at https://github.com/JabRef/user-documentation/issues or, even better, I submitted a pull request to the documentation repository.

@theoo33 theoo33 marked this pull request as draft November 21, 2023 20:26
@theoo33 theoo33 marked this pull request as ready for review November 21, 2023 21:13
Comment thread src/main/java/org/jabref/gui/preferences/PreferencesDialogView.java Outdated
@theoo33 theoo33 marked this pull request as draft November 21, 2023 23:48
Comment thread src/main/java/org/jabref/gui/maintable/MainTableHeaderContextMenu.java Outdated
…-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
Comment thread src/main/java/org/jabref/gui/maintable/MainTableHeaderContextMenu.java Outdated
Siedlerchr
Siedlerchr previously approved these changes Nov 26, 2023

@Siedlerchr Siedlerchr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm so far works fine

Comment thread src/main/java/org/jabref/gui/maintable/MainTableHeaderContextMenu.java Outdated
Siedlerchr
Siedlerchr previously approved these changes Nov 26, 2023
@Siedlerchr Siedlerchr added the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Nov 26, 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;
}
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 (?)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is simliar to the StandardActions implementation

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@calixtus

Copy link
Copy Markdown
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.

Comment thread src/main/java/org/jabref/gui/preferences/PreferencesDialogView.java Outdated
@calixtus calixtus requested a review from Siedlerchr November 27, 2023 19:17
@Siedlerchr Siedlerchr added this pull request to the merge queue Nov 27, 2023
Merged via the queue into JabRef:main with commit 2a4bd6c Nov 27, 2023
@theoo33 theoo33 deleted the fix-for-issue-9432 branch November 28, 2023 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: maintable component: preferences component: ui status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refine right click menu

5 participants