Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue 9863 - Change Tab selection order #9907

Merged
merged 14 commits into from
Jun 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve
- We added the possibility to automatically fetch entries when an ISBN is pasted on the main table. [#9864](https://github.com/JabRef/jabref/issues/9864)
- We added the option to disable the automatic linking of files in the entry editor [#5105](https://github.com/JabRef/jabref/issues/5105)
- We added the link icon for ISBNs in linked identifiers column. [#9819](https://github.com/JabRef/jabref/issues/9819)
- We added key binding to focus on groups <kbd>alt</kbd> + <kbd>s</kbd> [#9863](https://github.com/JabRef/jabref/issues/9863)
- We added the option to unprotect a text selection, which strips all pairs of curly braces away. [#9950](https://github.com/JabRef/jabref/issues/9950)
- We added drag and drop events for field 'Groups' in entry editor panel. [#569](https://github.com/koppor/jabref/issues/569)
- We added support for parsing MathML in the Medline importer. [#4273](https://github.com/JabRef/jabref/issues/4273)
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/org/jabref/gui/JabRefFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,10 @@ private void initKeyBindings() {
getCurrentLibraryTab().getMainTable().requestFocus();
event.consume();
break;
case FOCUS_GROUP_LIST:
sidePane.getSidePaneComponent(SidePaneType.GROUPS).requestFocus();
event.consume();
break;
case NEXT_LIBRARY:
tabbedPane.getSelectionModel().selectNext();
event.consume();
Expand Down
7 changes: 7 additions & 0 deletions src/main/java/org/jabref/gui/groups/GroupTreeView.java
Original file line number Diff line number Diff line change
Expand Up @@ -613,4 +613,11 @@ public void execute() {
}
}
}

/**
* Focus on GroupTree
*/
public void requestFocusGroupTree() {
groupTree.requestFocus();
}
}
2 changes: 1 addition & 1 deletion src/main/java/org/jabref/gui/keyboard/KeyBinding.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public enum KeyBinding {
FILE_LIST_EDITOR_MOVE_ENTRY_UP("File list editor, move entry up", Localization.lang("File list editor, move entry up"), "ctrl+UP", KeyBindingCategory.VIEW),
FIND_UNLINKED_FILES("Search for unlinked local files", Localization.lang("Search for unlinked local files"), "shift+F7", KeyBindingCategory.QUALITY),
FOCUS_ENTRY_TABLE("Focus entry table", Localization.lang("Focus entry table"), "alt+1", KeyBindingCategory.VIEW),
FOCUS_GROUP_LIST("Focus group list", Localization.lang("Focus group list"), "alt+s", KeyBindingCategory.VIEW),
HELP("Help", Localization.lang("Help"), "F1", KeyBindingCategory.FILE),
IMPORT_INTO_CURRENT_DATABASE("Import into current library", Localization.lang("Import into current library"), "ctrl+I", KeyBindingCategory.FILE),
IMPORT_INTO_NEW_DATABASE("Import into new library", Localization.lang("Import into new library"), "ctrl+alt+I", KeyBindingCategory.FILE),
Expand Down Expand Up @@ -83,7 +84,6 @@ public enum KeyBinding {
OPEN_URL_OR_DOI("Open URL or DOI", Localization.lang("Open URL or DOI"), "F3", KeyBindingCategory.TOOLS),
PASTE("Paste", Localization.lang("Paste"), "ctrl+V", KeyBindingCategory.EDIT),
PULL_CHANGES_FROM_SHARED_DATABASE("Pull changes from shared database", Localization.lang("Pull changes from shared database"), "ctrl+shift+R", KeyBindingCategory.FILE),
PREAMBLE_EDITOR_STORE_CHANGES("Preamble editor, store changes", Localization.lang("Preamble editor, store changes"), "alt+S", KeyBindingCategory.FILE),
PREVIOUS_PREVIEW_LAYOUT("Previous preview layout", Localization.lang("Previous preview layout"), "shift+F9", KeyBindingCategory.VIEW),
PREVIOUS_LIBRARY("Previous library", Localization.lang("Previous library"), "ctrl+PAGE_UP", KeyBindingCategory.VIEW),
PUSH_TO_APPLICATION("Push to application", Localization.lang("Push to application"), "ctrl+L", KeyBindingCategory.TOOLS),
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/org/jabref/gui/sidepane/SidePane.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,8 @@ public BooleanBinding paneVisibleBinding(SidePaneType pane) {
public SimpleCommand getToggleCommandFor(SidePaneType sidePane) {
return new TogglePaneAction(stateManager, sidePane, preferencesService.getSidePanePreferences());
}

public SidePaneComponent getSidePaneComponent(SidePaneType type) {
return viewModel.getSidePaneComponent(type);
}
}
10 changes: 10 additions & 0 deletions src/main/java/org/jabref/gui/sidepane/SidePaneComponent.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import javafx.scene.layout.VBox;

import org.jabref.gui.actions.SimpleCommand;
import org.jabref.gui.groups.GroupTreeView;
import org.jabref.gui.icon.IconTheme;
import org.jabref.logic.l10n.Localization;

Expand Down Expand Up @@ -71,4 +72,13 @@ private Node createHeaderView() {
protected void addExtraButtonToHeader(Button button, int position) {
this.buttonContainer.getChildren().add(position, button);
}

public void requestFocus() {
for (Node child : getChildren()) {
if (child instanceof GroupTreeView groupTreeView) {
groupTreeView.requestFocusGroupTree();
break;
}
}
}
}
2 changes: 1 addition & 1 deletion src/main/resources/l10n/JabRef_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1376,6 +1376,7 @@ Entry\ editor,\ previous\ panel\ 2=Entry editor, previous panel 2
File\ list\ editor,\ move\ entry\ down=File list editor, move entry down
File\ list\ editor,\ move\ entry\ up=File list editor, move entry up
Focus\ entry\ table=Focus entry table
Focus\ group\ list=Focus group list
Import\ into\ current\ library=Import into current library
Import\ into\ new\ library=Import into new library
New\ article=New article
Expand All @@ -1386,7 +1387,6 @@ New\ mastersthesis=New mastersthesis
New\ phdthesis=New phdthesis
New\ proceedings=New proceedings
New\ unpublished=New unpublished
Preamble\ editor,\ store\ changes=Preamble editor, store changes
Push\ to\ application=Push to application
Refresh\ OpenOffice/LibreOffice=Refresh OpenOffice/LibreOffice
Resolve\ duplicate\ citation\ keys=Resolve duplicate citation keys
Expand Down