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 1 commit
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
18 changes: 17 additions & 1 deletion src/main/java/org/jabref/gui/JabRefFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
import org.jabref.gui.externalfiles.AutoLinkFilesAction;
import org.jabref.gui.externalfiles.DownloadFullTextAction;
import org.jabref.gui.externalfiles.FindUnlinkedFilesAction;
import org.jabref.gui.groups.GroupTreeView;
import org.jabref.gui.help.AboutAction;
import org.jabref.gui.help.ErrorConsoleAction;
import org.jabref.gui.help.HelpAction;
Expand Down Expand Up @@ -321,7 +322,7 @@ private void initKeyBindings() {
event.consume();
break;
case FOCUS_GROUP_LIST:
this.stateManager.getGroupTree().requestFocus();
getGroupTreeView().getGroupTree().requestFocus();
calixtus marked this conversation as resolved.
Show resolved Hide resolved
event.consume();
break;
case NEXT_LIBRARY:
Expand Down Expand Up @@ -739,6 +740,21 @@ public LibraryTab getCurrentLibraryTab() {
return (LibraryTab) tabbedPane.getSelectionModel().getSelectedItem();
}

/**
* Returns groupTreeView.
*/
public GroupTreeView getGroupTreeView() {
GroupTreeView groupTreeView = null;

for (Node child : sidePane.getSidePaneComponent(SidePaneType.GROUPS).getChildren()) {
if (child instanceof GroupTreeView) {
groupTreeView = (GroupTreeView) child;
break;
}
}
return groupTreeView;
}

/**
* @return the BasePanel count.
*/
Expand Down
9 changes: 0 additions & 9 deletions src/main/java/org/jabref/gui/StateManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,6 @@ 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 @@ -240,11 +238,4 @@ public void clearSearchHistory() {
searchHistory.clear();
}

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

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

// Filter text field
setupClearButtonField(searchField);

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

private StackPane getArrowCell(GroupNodeViewModel viewModel) {
Expand Down Expand Up @@ -612,4 +609,11 @@ public void execute() {
}
}
}

/**
* Returns GroupTree
*/
public TreeTableView<GroupNodeViewModel> getGroupTree() {
return groupTree;
}
}
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);
}
}