Skip to content

Commit 7a3a57f

Browse files
committed
Merge remote-tracking branch 'upstream/main' into fix-issue-#6448
* upstream/main: Bump classgraph from 4.8.152 to 4.8.153 (#9502) Bump slf4j-api from 2.0.5 to 2.0.6 (#9501) Bump org.beryx.jlink from 2.25.0 to 2.26.0 (#9500) Bump lucene-queries from 9.4.1 to 9.4.2 (#9499) Add double click on preview style to add/remove from the selected list (#9498) Fix no context menu with sorting on all entries group (#9497)
2 parents 6d06c01 + bfcd0fe commit 7a3a57f

File tree

4 files changed

+28
-6
lines changed

4 files changed

+28
-6
lines changed

CHANGELOG.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve
1212
### Added
1313

1414
- We added a dropdown menu to let users change the library they want to import into during import.[#6177](https://github.com/JabRef/jabref/issues/6177)
15+
- We added the possibility to add/remove a preview style from the selected list using a double click [#9490](https://github.com/JabRef/jabref/issues/9490)
1516

1617

1718

@@ -29,7 +30,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve
2930

3031
- The tab "deprecated fields" is shown in biblatex-mode only. [#7757](https://github.com/JabRef/jabref/issues/7757)
3132
- We fixed an issue where the last opened libraries were not remembered when a new unsaved libray was open as well [#9190](https://github.com/JabRef/jabref/issues/9190)
32-
33+
- We fixed an issue where no context menu for the group "All entries" was present [forum#3682](https://discourse.jabref.org/t/how-sort-groups-a-z-not-subgroups/3682)
3334

3435
### Removed
3536

build.gradle

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ plugins {
1414

1515
id 'org.openjfx.javafxplugin' version '0.0.13'
1616

17-
id 'org.beryx.jlink' version '2.25.0'
17+
id 'org.beryx.jlink' version '2.26.0'
1818

1919
// nicer test outputs during running and completion
2020
// Homepage: https://github.com/radarsh/gradle-test-logger-plugin
@@ -117,7 +117,7 @@ dependencies {
117117

118118
implementation 'org.apache.lucene:lucene-core:9.4.1'
119119
implementation 'org.apache.lucene:lucene-queryparser:9.4.2'
120-
implementation 'org.apache.lucene:lucene-queries:9.4.1'
120+
implementation 'org.apache.lucene:lucene-queries:9.4.2'
121121
implementation 'org.apache.lucene:lucene-analysis-common:9.4.2'
122122
implementation 'org.apache.lucene:lucene-highlighter:9.4.2'
123123

@@ -178,7 +178,7 @@ dependencies {
178178
implementation 'org.jsoup:jsoup:1.15.3'
179179
implementation 'com.konghq:unirest-java:3.14.1'
180180

181-
implementation 'org.slf4j:slf4j-api:2.0.5'
181+
implementation 'org.slf4j:slf4j-api:2.0.6'
182182
implementation "org.tinylog:tinylog-api:2.5.0"
183183
implementation "org.tinylog:slf4j-tinylog:2.5.0"
184184
implementation "org.tinylog:tinylog-impl:2.5.0"
@@ -204,7 +204,7 @@ dependencies {
204204

205205
implementation group: 'net.harawata', name: 'appdirs', version: '1.2.1'
206206

207-
testImplementation 'io.github.classgraph:classgraph:4.8.152'
207+
testImplementation 'io.github.classgraph:classgraph:4.8.153'
208208
testImplementation 'org.junit.jupiter:junit-jupiter:5.9.1'
209209
testImplementation 'org.junit.platform:junit-platform-launcher:1.9.1'
210210

src/main/java/org/jabref/gui/groups/GroupTreeView.java

+6-1
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ private ContextMenu createContextMenuForGroup(GroupNodeViewModel group) {
447447
menu.getItems().clear();
448448
if (viewModel.isEditable(group)) {
449449
menu.getItems().add(editGroup);
450-
if (group.getChildren().size() > 0 && viewModel.canAddGroupsIn(group)) {
450+
if ((group.getChildren().size() > 0) && viewModel.canAddGroupsIn(group)) {
451451
menu.getItems().add(removeGroupWithSubgroups);
452452
menu.getItems().add(new SeparatorMenuItem());
453453
menu.getItems().add(addSubgroup);
@@ -461,6 +461,11 @@ private ContextMenu createContextMenuForGroup(GroupNodeViewModel group) {
461461
}
462462
}
463463
}
464+
if (group.isRoot()) {
465+
menu.getItems().add(addSubgroup);
466+
menu.getItems().add(removeSubgroups);
467+
menu.getItems().add(sortSubgroups);
468+
}
464469

465470
if (viewModel.canAddEntriesIn(group)) {
466471
menu.getItems().add(new SeparatorMenuItem());

src/main/java/org/jabref/gui/preferences/preview/PreviewTab.java

+16
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ public void initialize() {
131131
availableListView.setOnDragDetected(this::dragDetectedInAvailable);
132132
availableListView.setOnDragDropped(event -> dragDropped(viewModel.availableListProperty(), event));
133133
availableListView.setOnKeyTyped(event -> jumpToSearchKey(availableListView, event));
134+
availableListView.setOnMouseClicked(this::mouseClickedAvailable);
134135
availableListView.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
135136
availableListView.selectionModelProperty().getValue().selectedItemProperty().addListener((observable, oldValue, newValue) ->
136137
viewModel.setPreviewLayout(newValue));
@@ -145,6 +146,7 @@ public void initialize() {
145146
chosenListView.setOnDragDetected(this::dragDetectedInChosen);
146147
chosenListView.setOnDragDropped(event -> dragDropped(viewModel.chosenListProperty(), event));
147148
chosenListView.setOnKeyTyped(event -> jumpToSearchKey(chosenListView, event));
149+
chosenListView.setOnMouseClicked(this::mouseClickedChosen);
148150
chosenListView.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
149151
chosenListView.selectionModelProperty().getValue().selectedItemProperty().addListener((observable, oldValue, newValue) ->
150152
viewModel.setPreviewLayout(newValue));
@@ -275,4 +277,18 @@ public void sortDownButtonAction() {
275277
public void resetDefaultButtonAction() {
276278
viewModel.resetDefaultLayout();
277279
}
280+
281+
private void mouseClickedAvailable(MouseEvent event) {
282+
if (event.getClickCount() == 2) {
283+
viewModel.addToChosen();
284+
event.consume();
285+
}
286+
}
287+
288+
private void mouseClickedChosen(MouseEvent event) {
289+
if (event.getClickCount() == 2) {
290+
viewModel.removeFromChosen();
291+
event.consume();
292+
}
293+
}
278294
}

0 commit comments

Comments
 (0)