Skip to content

Commit

Permalink
implement request from issue JabRef#9863
Browse files Browse the repository at this point in the history
  • Loading branch information
YifeiShi99 committed May 16, 2023
1 parent 14a52c9 commit 5768e98
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve
- We added the option to automatically download online files when a new entry is created from an existing ID (e.g. DOI). The option can be disabled in the preferences under "Import and Export" [#9756](https://github.com/JabRef/jabref/issues/9756)
- We added a new Integrity check for unscaped ampersands. [koppor#585](https://github.com/koppor/jabref/issues/585)
- We added the possibility to automatically fetch entries when an IBSN is pasted on the main table [#9864](https://github.com/JabRef/jabref/issues/9864)
- We added key binding to focus on groups <kbd>Shift</kbd> + <kbd>Tab</kbd> [#9863](https://github.com/JabRef/jabref/issues/9863)

### Changed

Expand Down Expand Up @@ -52,6 +53,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve
- We moved the option to run JabRef in memory stick mode into the preferences dialog toolbar. [#9866](https://github.com/JabRef/jabref/pull/9866)
- In case the library contains empty entries, they are not written to disk. [#8645](https://github.com/JabRef/jabref/issues/8645)
- The formatter `remove_unicode_ligatures` is now called `replace_unicode_ligatures`. [#9890](https://github.com/JabRef/jabref/pull/9890)
- The key binding to focus on entry table is changed to <kbd>Tab</kbd> [#9863](https://github.com/JabRef/jabref/issues/9863)

### Fixed

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 @@ -320,6 +320,10 @@ private void initKeyBindings() {
getCurrentLibraryTab().getMainTable().requestFocus();
event.consume();
break;
case FOCUS_GROUP_LIST:
this.stateManager.getGroupTree().requestFocus();
event.consume();
break;
case NEXT_LIBRARY:
tabbedPane.getSelectionModel().selectNext();
event.consume();
Expand Down
12 changes: 12 additions & 0 deletions src/main/java/org/jabref/gui/StateManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@
import javafx.collections.ObservableMap;
import javafx.concurrent.Task;
import javafx.scene.Node;
import javafx.scene.control.TreeTableView;
import javafx.util.Pair;

import org.jabref.gui.edit.automaticfiededitor.LastAutomaticFieldEditorEdit;
import org.jabref.gui.groups.GroupNodeViewModel;
import org.jabref.gui.sidepane.SidePaneType;
import org.jabref.gui.util.BackgroundTask;
import org.jabref.gui.util.CustomLocalDragboard;
Expand Down Expand Up @@ -97,6 +99,8 @@ public OptionalObjectProperty<SearchQuery> activeSearchQueryProperty() {
return activeSearchQuery;
}

private TreeTableView<GroupNodeViewModel> groupTree;

public void setActiveSearchResultSize(BibDatabaseContext database, IntegerProperty resultSize) {
searchResultMap.put(database, resultSize);
}
Expand Down Expand Up @@ -235,4 +239,12 @@ public List<String> getLastSearchHistory(int size) {
public void clearSearchHistory() {
searchHistory.clear();
}

public void setGroupTree(TreeTableView<GroupNodeViewModel> groupTree) {
this.groupTree = groupTree;
}

public TreeTableView<GroupNodeViewModel> getGroupTree() {
return this.groupTree;
}
}
3 changes: 3 additions & 0 deletions src/main/java/org/jabref/gui/groups/GroupTreeView.java
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,9 @@ private void initialize() {

// Filter text field
setupClearButtonField(searchField);

// set GroupTree in StateManger
this.stateManager.setGroupTree(this.groupTree);
}

private StackPane getArrowCell(GroupNodeViewModel viewModel) {
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/org/jabref/gui/keyboard/KeyBinding.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ public enum KeyBinding {
FILE_LIST_EDITOR_MOVE_ENTRY_DOWN("File list editor, move entry down", Localization.lang("File list editor, move entry down"), "ctrl+DOWN", KeyBindingCategory.VIEW),
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_ENTRY_TABLE("Focus entry table", Localization.lang("Focus entry table"), "TAB", KeyBindingCategory.VIEW),
FOCUS_GROUP_LIST("Focus group list", Localization.lang("Focus group list"), "shift+TAB", 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
1 change: 1 addition & 0 deletions src/main/resources/l10n/JabRef_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1367,6 +1367,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 Down

0 comments on commit 5768e98

Please sign in to comment.